Commit 16188615 authored by Médéric Boquien's avatar Médéric Boquien

Improve the sanitation of input data so that upper limits of extensive...

Improve the sanitation of input data so that upper limits of extensive properties are not eliminated from the quantities to be fitted when upper limits are activated
parent 303f2827
Pipeline #1964 skipped with stage
......@@ -37,6 +37,7 @@
- Some math libraries such as MKL or OpenBLAS sometime try to be (too) smart, starting computation threads on their own. As cigale is already parallel, this just oversubscribes the CPU and can lead to important slowdowns. An environment variable could be set by the user to disable this, but this is cumbersome. Rather, we set these variables directly in the code at the startup of cigale. (Yannick Roehlly & Médéric Boquien)
- Fix a crash in `pcigale-plots` when plotting the SED of models computed without stellar populations. (Médéric Boquien)
- Make sure that upper limits on physical properties are correctly taken into account. (Médéric Boquien)
- Improve the sanitation of input data so that upper limits of extensive properties are not eliminated from the quantities to be fitted when upper limits are activated. (Médéric Boquien)
### Optimised
- Slight speedup of the computation of the likelihood from the χ² using a multiplication rather than a division. (Médéric Boquien)
- Speedup of the computation of the χ² by ~10% taking the opposite of a scalar rather than of an array. (Médéric Boquien)
......
......@@ -66,6 +66,7 @@ class ObservationsManagerPassbands(object):
self._check_errors(defaulterror)
self._check_invalid(config['analysis_params']['lim_flag'],
threshold)
print(self.table)
self._add_model_error(modelerror)
# Rebuild the quantities to fit after vetting them
......@@ -172,16 +173,14 @@ class ObservationsManagerPassbands(object):
for item in self.bands + self.extprops:
error = item + '_err'
w = np.where((self.table[item] < threshold) |
(self.table[error] < threshold))
self.table[item][w] = np.nan
self.table[error][w] = np.nan
if upperlimits is False:
w = np.where(self.table[error] <= 0.)
self.table[item][w] = np.nan
w = np.where((self.table[item] < threshold) |
(self.table[error] <= 0.))
else:
w = np.where(self.table[error] == 0.)
self.table[item][w] = np.nan
w = np.where((self.table[item] < threshold) |
(self.table[error] == 0.))
self.table[item][w] = np.nan
self.table[error][w] = np.nan
if np.all(~np.isfinite(self.table[item])):
allinvalid.append(item)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment