Mosaic.py ValueError: math domain error / ZeroDivisionError: float division by zero

Hello,

I am running the hscPipe6.0 on HSC data. While mosaicking the data, I have come across these errors :

$ mosaic.py . --rerun mosaic --id filter=HSC-I tract=9813

Mosaic INFO: Write Fcr ...
Traceback (most recent call last):
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/6.0b6-hsc+2/bin/mosaic.py", line 5, in <module>
    MosaicTask.parseAndRun()
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/pipe_base/6.0-hsc/python/lsst/pipe/base/cmdLineTask.py", line 591, in parseAndRun
    resultList = taskRunner.run(parsedCmd)
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/pipe_base/6.0-hsc/python/lsst/pipe/base/cmdLineTask.py", line 240, in run
    resultList = list(mapFunc(self, targetList))
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/6.0b6-hsc+2/python/lsst/meas/mosaic/mosaicTask.py", line 80, in __call__
    result = task.run(*args)
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/6.0b6-hsc+2/python/lsst/meas/mosaic/mosaicTask.py", line 1056, in run
    numCoresForReadSource, readTimeout, verbose)
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/6.0b6-hsc+2/python/lsst/meas/mosaic/mosaicTask.py", line 1017, in mosaic
    self.writeFcr(dataRefListToOutput)
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/6.0b6-hsc+2/python/lsst/meas/mosaic/mosaicTask.py", line 650, in writeFcr
    exp_cor = -2.5*math.log10(self.fexp[m.iexp])
ValueError: math domain error

$ mosaic.py . --rerun mosaic --id filter=HSC-Y tract=9813

Mosaic INFO: Write Fcr ...
Traceback (most recent call last):
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/6.0b6-hsc+2/bin/mosaic.py", line 5, in <module>
    MosaicTask.parseAndRun()
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/pipe_base/6.0-hsc/python/lsst/pipe/base/cmdLineTask.py", line 591, in parseAndRun
    resultList = taskRunner.run(parsedCmd)
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/pipe_base/6.0-hsc/python/lsst/pipe/base/cmdLineTask.py", line 240, in run
    resultList = list(mapFunc(self, targetList))
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/6.0b6-hsc+2/python/lsst/meas/mosaic/mosaicTask.py", line 80, in __call__
    result = task.run(*args)
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/6.0b6-hsc+2/python/lsst/meas/mosaic/mosaicTask.py", line 1056, in run
    numCoresForReadSource, readTimeout, verbose)
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/6.0b6-hsc+2/python/lsst/meas/mosaic/mosaicTask.py", line 1017, in mosaic
    self.writeFcr(dataRefListToOutput)
  File "/opt/lsst/6.0/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_mosaic/6.0b6-hsc+2/python/lsst/meas/mosaic/mosaicTask.py", line 699, in writeFcr
    1.0/instFluxMag0,
ZeroDivisionError: float division by zero

Since the process seems to stop directly after those error I am not sure that all the fcr and wcs files are generated. Does this impact the process of the next steps ? Is that a problem of the calibration of the file done before ?

Thank you a lot for your help and your answers

Guillaume

If you’re seeing a traceback, the process didn’t complete cleanly. Try:

mosaic.py . --rerun mosaic --id filter=HSC-I tract=9813 ccd=0..8^10..103

ccd=9 is problematic, due to missing amplifiers.

Another possibility is that you have a bad exposure in the mix somewhere. You might be able to identify it by trolling through the logs. You’ll have to provide a --id specification that doesn’t include that exposure.

In the data I have to make my tests I only have the ccd=49 so the ccd=9 is not the problem. Ok if it is just a matter of bad exposure I will try to find them and discard them from the process.

Thank you !

I recall seeing the same error when too few CCDs are supplied to mosaic.py. What are your input data?

I use visits from the 2015-01-21, HSC-I band and 2015-01-27, HSC-Y band for the SSP_DEEP_COSMOS field with only the ccd=49. If the errors can occur when there are a few number of CCDs, since I am using just one I can see the problem.

Thanks for the answers.