While running a data reduction of IR observations with IRAF, the ccdproc printed this error:
ERROR (502, “floating point invalid operation”)
which means that some values of the image used (the flat image in this case) are not suitable for the performing mathematical actions (like division with 0s). Moreover the IR ccds have many bad pixels so the best is to replace these values with standard ones in order to know exactly which areas are problematic.
In order to replace them the imcalc command (stsdas / toolbox / imgtools) can be used to replace these values, like:
imcalc master_flat_temp.fits output="master_flat.fits" equals="if (im1.le.0.0) then -9.0 else im1"
if we want for example to replace all values lower or equal (le) to 0.0 with -9.0.