21cmfast / 21cmFAST

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

[BUG] The lightcone_coords attribute of a LightCone class seems to be wrongly defined #344

Open frankn1ng opened 12 months ago

frankn1ng commented 12 months ago

In outputs.py, the lightcone_coords attribute of a LightCone class is defined as follows:

def lightcone_coords(self):
    """Co-ordinates [Mpc] of each cell along the redshift axis."""
    return np.linspace(0, self.lightcone_dimensions[-1], self.n_slices)

I believe the intention was to create an array with fixed intervals of cell_size. However, the code here does not achieve this because both ends are included, and the interval will be slightly increased from cell_size. Changing the above line to

return np.linspace(0, self.lightcone_dimensions[-1], self.n_slices, endpoint=False)

should do.

steven-murray commented 12 months ago

Thanks @Frank-N1ng, this is true, and is fixed in an open PR (I can't remember which). I hope to be merging it soon.