Keck-DataReductionPipelines / KCWI_DRP

KCWI python DRP
BSD 3-Clause "New" or "Revised" License
9 stars 13 forks source link

RuntimeWarning: divide by zero encountered in true_divide mscal = mcal * 1.e16 / expt -> produces all "nan" in _icubes.fit #65

Open geoffcfchen opened 3 years ago

geoffcfchen commented 3 years ago

I am using the python-based KCWI DRP to reduce the data I obtained on June 7. All the files were reduced successfully except one file. For that file, the final reduced files ending with _icubew.fits, _icubed.fits, and _icube.fits looks normal, but the reduced file ending with _icubes.fit shows all "nan". I looked into the log file. I saw that before DRP produces _icubes.fit file, it showed the following warning messages, which I think that it is probably the reason causing this issue.

2021-06-08 13:29:17:py.warnings:WARNING: /Users/Geoff/GitHub/KCWI_DRP/kcwidrp/primitives/FluxCalibrate.py:91: RuntimeWarning: divide by zero encountered in true_divide mscal = mcal * 1.e16 / expt

2021-06-08 13:29:18:KCWI:INFO: Extinction corrected 2021-06-08 13:29:18:py.warnings:WARNING: /Users/Geoff/GitHub/KCWI_DRP/kcwidrp/primitives/FluxCalibrate.py:99: RuntimeWarning: invalid value encountered in multiply self.action.args.ccddata.data[:, ix, isl] *= mscal

2021-06-08 13:29:18:py.warnings:WARNING: /Users/Geoff/GitHub/KCWI_DRP/kcwidrp/primitives/FluxCalibrate.py:101: RuntimeWarning: invalid value encountered in multiply mscal ** 2

2021-06-08 13:29:19:KCWI:INFO: >>> Saving 4 hdus to redux/kb210608_00040_icubes.fits