Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-11776

"RuntimeWarning: invalid value encountered in greater/less" in processing HSC data

    Details

      Description

      When running singleFrameDriver or processCcd with HSC RC data, it's frequent to see warnings like these:

      /software/lsstsw/stack/Linux64/meas_algorithms/13.0-18-gc4ad422+4/python/lsst/meas/algorithms/objectSizeStarSelector.py:400: RuntimeWarning: invalid value encountered in less
        bad = numpy.logical_or(bad, width < self.config.widthMin)
      /software/lsstsw/stack/Linux64/meas_algorithms/13.0-18-gc4ad422+4/python/lsst/meas/algorithms/objectSizeStarSelector.py:401: RuntimeWarning: invalid value encountered in greater
        bad = numpy.logical_or(bad, width > self.config.widthMax)
      /software/lsstsw/stack/Linux64/meas_algorithms/13.0-18-gc4ad422+4/python/lsst/meas/algorithms/matcherSourceSelector.py:126: RuntimeWarning: invalid value encountered in greater
        return sourceCat.get(self.fluxKey)/sourceCat.get(self.fluxSigmaKey) > self.config.minSnr
      

      Jim Bosch thinks they are likely from comparisons with NaNs for flagged sources. It'd be good to make them go away.

      An example data id to reproduce is to run:
      processCcd.py /datasets/hsc/repo/ --rerun private/username/abcd --id visit=28398 ccd=29
      Its output is attached in example.log

        Attachments

          Issue Links

            Activity

            Hide
            price Paul Price added a comment -

            /tigress/HSC/LSST/stack3_tiger_20171219/stack/miniconda3-4.3.21-10a4fa6/Linux64/
            ip_isr/14.0-3-g27b2198+5/python/lsst/ip/isr/isrFunctions.py:382: RuntimeWarning:
             invalid value encountered in true_divide
              weights=indices*~collapsedMask)[0]/numPerBin
            

            Show
            price Paul Price added a comment - /tigress/HSC/LSST/stack3_tiger_20171219/stack/miniconda3-4.3.21-10a4fa6/Linux64/ ip_isr/14.0-3-g27b2198+5/python/lsst/ip/isr/isrFunctions.py:382: RuntimeWarning: invalid value encountered in true_divide weights=indices*~collapsedMask)[0]/numPerBin
            Hide
            price Paul Price added a comment -

            I added the numpy.errstate context manager in a bunch of places identified from a recent processing of HSC SXDS i-band observations, which I believe also covers the above. This won't catch every instance of those warnings, but it catches the dominant ones I see in HSC processing. At least some of the warnings coming from tests will be a distinct population that I have not caught here, and I do not propose to deal with them myself.

            Jenkins is running along nicely (but doesn't include one more case in meas_alg).

            price@pap-laptop:~/LSST/afw (tickets/DM-11776 %=) $ git sub
            commit e2971d31a4af7e00f0bee347699fdfc9af51174f (HEAD -> tickets/DM-11776, origin/tickets/DM-11776)
            Author: Paul Price <price@astro.princeton.edu>
            Date:   Thu Feb 1 14:15:19 2018 -0500
             
                rgb: suppress NAN warnings
             
             python/lsst/afw/display/rgb.py | 9 +++++----
             1 file changed, 5 insertions(+), 4 deletions(-)
             
             
            price@pap-laptop:~/LSST/meas_algorithms (tickets/DM-11776=) $ git sub
            commit 996418b6539b348ef933f9628f1004ca2868e3a7 (HEAD -> tickets/DM-11776, origin/tickets/DM-11776)
            Author: Paul Price <price@astro.princeton.edu>
            Date:   Thu Feb 1 13:55:23 2018 -0500
             
                suppress numpy warnings about NAN
                
                /software/lsstsw/stack/Linux64/meas_algorithms/13.0-18-gc4ad422+4/python/lsst/meas/algorithms/objectSizeStarSelector.py:400: RuntimeWarning: invalid value encountered in less
                  bad = numpy.logical_or(bad, width < self.config.widthMin)
                /software/lsstsw/stack/Linux64/meas_algorithms/13.0-18-gc4ad422+4/python/lsst/meas/algorithms/objectSizeStarSelector.py:401: RuntimeWarning: invalid value encountered in greater
                  bad = numpy.logical_or(bad, width > self.config.widthMax)
                /software/lsstsw/stack/Linux64/meas_algorithms/13.0-18-gc4ad422+4/python/lsst/meas/algorithms/matcherSourceSelector.py:126: RuntimeWarning: invalid value encountered in greater
                  return sourceCat.get(self.fluxKey)/sourceCat.get(self.fluxSigmaKey) > self.config.minSnr
             
             .../lsst/meas/algorithms/astrometrySourceSelector.py   |  3 ++-
             python/lsst/meas/algorithms/matcherSourceSelector.py   |  3 ++-
             python/lsst/meas/algorithms/measureApCorr.py           |  3 ++-
             python/lsst/meas/algorithms/objectSizeStarSelector.py  | 18 +++++++++---------
             python/lsst/meas/algorithms/sourceSelector.py          |  9 +++++----
             5 files changed, 20 insertions(+), 16 deletions(-)
             
             
            price@pap-laptop:~/LSST/ip_isr (tickets/DM-11776=) $ git sub
            commit b1a803cbae5fb8b5b12c9bfea81769d73a634d96 (HEAD -> tickets/DM-11776, origin/tickets/DM-11776)
            Author: Paul Price <price@astro.princeton.edu>
            Date:   Thu Feb 1 14:11:14 2018 -0500
             
                suppress numpy NAN warnings
                
                We don't care, and they clutter the output.
             
             python/lsst/ip/isr/isrFunctions.py | 15 ++++++++-------
             python/lsst/ip/isr/isrTask.py      | 31 ++++++++++++++++---------------
             2 files changed, 24 insertions(+), 22 deletions(-)
             
             
            price@pap-laptop:~/LSST/pipe_tasks (tickets/DM-11776=) $ git sub
            commit 3a70a1dbff64d392e1f95be588ea252e929fe6dd (HEAD -> tickets/DM-11776, origin/tickets/DM-11776)
            Author: Paul Price <price@astro.princeton.edu>
            Date:   Thu Feb 1 14:25:04 2018 -0500
             
                assembleCoadd: suppress numpy NAN warning
             
             python/lsst/pipe/tasks/assembleCoadd.py | 3 ++-
             1 file changed, 2 insertions(+), 1 deletion(-)
            

            Show
            price Paul Price added a comment - I added the numpy.errstate context manager in a bunch of places identified from a recent processing of HSC SXDS i-band observations, which I believe also covers the above. This won't catch every instance of those warnings, but it catches the dominant ones I see in HSC processing. At least some of the warnings coming from tests will be a distinct population that I have not caught here, and I do not propose to deal with them myself. Jenkins is running along nicely (but doesn't include one more case in meas_alg). price@pap-laptop:~/LSST/afw (tickets/DM-11776 %=) $ git sub commit e2971d31a4af7e00f0bee347699fdfc9af51174f (HEAD -> tickets/DM-11776, origin/tickets/DM-11776) Author: Paul Price <price@astro.princeton.edu> Date: Thu Feb 1 14:15:19 2018 -0500   rgb: suppress NAN warnings   python/lsst/afw/display/rgb.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)     price@pap-laptop:~/LSST/meas_algorithms (tickets/DM-11776=) $ git sub commit 996418b6539b348ef933f9628f1004ca2868e3a7 (HEAD -> tickets/DM-11776, origin/tickets/DM-11776) Author: Paul Price <price@astro.princeton.edu> Date: Thu Feb 1 13:55:23 2018 -0500   suppress numpy warnings about NAN /software/lsstsw/stack/Linux64/meas_algorithms/13.0-18-gc4ad422+4/python/lsst/meas/algorithms/objectSizeStarSelector.py:400: RuntimeWarning: invalid value encountered in less bad = numpy.logical_or(bad, width < self.config.widthMin) /software/lsstsw/stack/Linux64/meas_algorithms/13.0-18-gc4ad422+4/python/lsst/meas/algorithms/objectSizeStarSelector.py:401: RuntimeWarning: invalid value encountered in greater bad = numpy.logical_or(bad, width > self.config.widthMax) /software/lsstsw/stack/Linux64/meas_algorithms/13.0-18-gc4ad422+4/python/lsst/meas/algorithms/matcherSourceSelector.py:126: RuntimeWarning: invalid value encountered in greater return sourceCat.get(self.fluxKey)/sourceCat.get(self.fluxSigmaKey) > self.config.minSnr   .../lsst/meas/algorithms/astrometrySourceSelector.py | 3 ++- python/lsst/meas/algorithms/matcherSourceSelector.py | 3 ++- python/lsst/meas/algorithms/measureApCorr.py | 3 ++- python/lsst/meas/algorithms/objectSizeStarSelector.py | 18 +++++++++--------- python/lsst/meas/algorithms/sourceSelector.py | 9 +++++---- 5 files changed, 20 insertions(+), 16 deletions(-)     price@pap-laptop:~/LSST/ip_isr (tickets/DM-11776=) $ git sub commit b1a803cbae5fb8b5b12c9bfea81769d73a634d96 (HEAD -> tickets/DM-11776, origin/tickets/DM-11776) Author: Paul Price <price@astro.princeton.edu> Date: Thu Feb 1 14:11:14 2018 -0500   suppress numpy NAN warnings We don't care, and they clutter the output.   python/lsst/ip/isr/isrFunctions.py | 15 ++++++++------- python/lsst/ip/isr/isrTask.py | 31 ++++++++++++++++--------------- 2 files changed, 24 insertions(+), 22 deletions(-)     price@pap-laptop:~/LSST/pipe_tasks (tickets/DM-11776=) $ git sub commit 3a70a1dbff64d392e1f95be588ea252e929fe6dd (HEAD -> tickets/DM-11776, origin/tickets/DM-11776) Author: Paul Price <price@astro.princeton.edu> Date: Thu Feb 1 14:25:04 2018 -0500   assembleCoadd: suppress numpy NAN warning   python/lsst/pipe/tasks/assembleCoadd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
            Hide
            price Paul Price added a comment -

            I propose that although what I've done has not dealt with every instance of those warnings in the entire stack, it is a good start on this problem and cleans up HSC processing which was the original driver of this ticket. I myself have no reason to go much further, and so if we believe more cleanup is warranted I suggest we accept what I've done and start a new ticket (preferably with a list of file and line number) for any further instances that need to be dealt with.

            Hsin-Fang Chiang, would you mind reviewing this work?

            Show
            price Paul Price added a comment - I propose that although what I've done has not dealt with every instance of those warnings in the entire stack, it is a good start on this problem and cleans up HSC processing which was the original driver of this ticket. I myself have no reason to go much further, and so if we believe more cleanup is warranted I suggest we accept what I've done and start a new ticket (preferably with a list of file and line number) for any further instances that need to be dealt with. Hsin-Fang Chiang , would you mind reviewing this work?
            Hide
            hchiang2 Hsin-Fang Chiang added a comment -

            Looks good to me to suppress these instances, and new tickets can be opened if more instances are found.

            Show
            hchiang2 Hsin-Fang Chiang added a comment - Looks good to me to suppress these instances, and new tickets can be opened if more instances are found.
            Hide
            price Paul Price added a comment -

            Thanks Hsin-Fang Chiang.

            Merged to master

            Show
            price Paul Price added a comment - Thanks Hsin-Fang Chiang . Merged to master

              People

              • Assignee:
                price Paul Price
                Reporter:
                hchiang2 Hsin-Fang Chiang
                Reviewers:
                Hsin-Fang Chiang
                Watchers:
                Hsin-Fang Chiang, Jim Bosch, John Parejko, Paul Price, Scott Daniel, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: