HERA-Team / hera_pspec

HERA power spectrum estimation code and data formats
http://hera-pspec.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

get rid of nans from P_SN correction. #356

Closed aewallwi closed 2 years ago

aewallwi commented 2 years ago

Fix bug in P_SN correction calculation where nans can be introduced if both P_N and P_SN are infinite. If this is the case, then P_SN should still be np.inf after correction but instead it is set to Nan since the calculation takes the ratio between P_N and P_SN and numpy assigns inf/inf=nan (offending line is at https://github.com/HERA-Team/hera_pspec/blob/e6b73604ed771b6c1d56b4cf0396ccda2d56635d/hera_pspec/utils.py#L1514 )

This PR sets all nans introduced by this step to infinty.