21cmfast / 21cmFAST

Official repository for 21cmFAST: a code for generating fast simulations of the cosmological 21cm signal
MIT License
56 stars 37 forks source link

[BUG] lightcone.lightcone_redshifts error #393

Open JasperSolt opened 1 month ago

JasperSolt commented 1 month ago

When I run the following code in the v4-prep branch:

lc = p21c.outputs.LightCone.read(fname, lc_path)
print(lc.lightcone_redshifts)

I get an error. This is because internally, when calling z_at_value, it is written like this:

z_at_value(self.cosmo_params.cosmo.comoving_distance, d)

An easy fix is to rewrite it as this:

f = lambda x: self.cosmo_params.cosmo.comoving_distance(x).value
z_at_value(f, d)

Just wanted to bring this to your attention.

steven-murray commented 1 month ago

I think this was just fixed in #392 -- can you try it?

JasperSolt commented 1 month ago

I've tried it and now I have an entirely different issue where I can't open my lightcones at all, I'll open a new issue for clarity