MickaelRigault / ztfimg

ZTF Images tools
Apache License 2.0
5 stars 4 forks source link

invalid value warnings in pocket correction #15

Open saimn opened 7 months ago

saimn commented 7 months ago

With some flat exposures the pocket correction emits warnings about invalid values (NaNs probably):

In [22]: img = ztfimg.RawCCD.from_filename("raw/2019/0404/096493/ztf_20190404096493_000000_zr_c01_f.fits.fz")

In [23]: img.get_data(overscan_prop={'userange': [25, 30]}, corr_overscan=True, corr_nl=True, corr_pocket=True)
/home/sconseil/dev/ztf/ztfsensors/ztfsensors/pocket.py:94: RuntimeWarning: invalid value encountered in power
  outval = cmax * (1 - x)**alpha * y**beta

we should check that NaNs do not propagate badly and that the correction is robust to those values.

cc @nregnault

saimn commented 7 months ago

Another exposure: raw/2019/0404/097269/ztf_20190404097269_000000_zr_c01_f.fits.fz