Closed daviesje closed 1 month ago
The important part of this issue was fixed by #392. While being able to load lightcones from previous versions would be nice in the future, it will be easier to regenerate lightcones in the vast majority of cases, so I'm closing this issue.
Describe the bug: There are a couple of small issues with loading lightcones since the "distances" field was added. The first is that lightcones generated from a previous version no longer load, since they cannot find this field. The second is that the units in the
LightCone.lightcone_distances
field don't seem to be saved, so that when you getlightcone_redshifts
with a lightcone loaded from file it crashes when trying to callastropy.cosmology.z_at_value
.Solutions To fix the first problem, I think it would be a good idea to have an optional "compatibility" flag for reading which does not attempt the fields which would cause a crash across version, these include the
global_parameters
structure and any key used directly in theLightCone.read_particular
method. In this case we may want to print warnings about missing fields and perhaps disallow further computation.To fix the second, if we want
lightcone_distances
to have units, we should add them inread_particular
, otherwise we can fix them to Mpc, and add the units when doing thelightcone_redshifts
calculation.