Commit 2a63bbd4 authored by Médéric Boquien's avatar Médéric Boquien
Browse files

Be more resilient by converting the array of SFR to float. This avoids a...

Be more resilient by converting the array of SFR to float. This avoids a possible crash down the road when doing an in-place assignment of an integer with a float.
parent af42d0a2
......@@ -20,6 +20,7 @@
- For sfh2exp, when setting the scale of the SFH with sfr0, the normalisation was incorrect by a factor exp(-1/tau_main). (Médéric Boquien)
- The mass-dependent physical properties are computed assuming the redshift of the model. However because we round the observed redshifts to two decimals, there can be a difference of 0.005 in redshift between the models and the actual observation if CIGALE computes the list of redshifts itself. At low redshift, this can cause a discrepancy in the mass-dependent physical properties: ~0.35 dex at z=0.010 vs 0.015 for instance. Therefore we now evaluate these physical quantities at the observed redshift at full precision. (Médéric Boquien, issue reported by Samir Salim)
- In the sfhfromfile module, an extraneous offset in the column index made that it took the previous column as the SFR rather than the selected column. (Médéric Boquien)
- In sfhfromfile, if the SFR is made of integers cigale crashed. Now we systematically convert it to float. (Médéric Boquien)
### Optimised
- Prior to version 0.7.0, we needed to maintain the list of redshifts for all the computed models. Past 0.7.0 we just infer the redshift from a list unique redshifts. This means that we can now discard the list of redshifts for all the models and only keep the list of unique redshifts. This saves ~8 MB of memory for every 10⁶ models. the models should be computed slightly faster but it is in the measurement noise. (Médéric Boquien)
......@@ -71,7 +71,7 @@ class SfhFromFile(CreationModule):
time_grid = table.columns[0].data
sfr_column_number = int(self.parameters['sfr_column'])
sfr = table.columns[sfr_column_number].data
sfr = table.columns[sfr_column_number].data.astype(np.float)
age = int(self.parameters['age'])
normalise = (self.parameters["normalise"].lower() == "true")
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