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

SingleFrameVariancePlugin can give numpy warnings

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: meas_base
    • Labels:
      None
    • Story Points:
      2
    • Sprint:
      DRP X16-2, DRP X16-3
    • Team:
      Data Release Production

      Description

      SingleFrameVariancePlugin can produce the following numpy warning, with no hint as to where the problem is coming from:

      /Users/rowen/UW/LSST/lsstsw/miniconda/lib/python2.7/site-packages/numpy/core/_methods.py:59: RuntimeWarning: Mean of empty slice.
        warnings.warn("Mean of empty slice.", RuntimeWarning)
      

      I tracked it down by adding the following code to the calling code:

      import warnings
      with warnings.catch_warnings():
          warnings.filterwarnings('error')
      

      It would be nice if the measurement plugin handled this situation more gracefully, such as turning the warning into an exception or testing for it and handling it.

      One way to reproduce this problem is to run tests/testProcessCcd.py in pipe_tasks. However, it is commonly seen when running processCcd on other data, as well.

        Attachments

          Issue Links

            Activity

            Hide
            vpk24 Vishal Kasliwal [X] (Inactive) added a comment -

            Using Nate Lust's recommendation for how to use the existing MeasurementError framework to gracefuly handle empty slices.

            Show
            vpk24 Vishal Kasliwal [X] (Inactive) added a comment - Using Nate Lust 's recommendation for how to use the existing MeasurementError framework to gracefuly handle empty slices.
            Hide
            vpk24 Vishal Kasliwal [X] (Inactive) added a comment -

            Hi John, can you give this ticket a review. The ticket has been tested on Jenkins. This is Nate Lust's recommendation (branch u/nlust/DM-5427) with just a minor change.

            Show
            vpk24 Vishal Kasliwal [X] (Inactive) added a comment - Hi John, can you give this ticket a review. The ticket has been tested on Jenkins. This is Nate Lust 's recommendation (branch u/nlust/ DM-5427 ) with just a minor change.
            Hide
            swinbank John Swinbank added a comment -

            Just to be clear – am I reviewing the code on Nate's user branch, or on the ticket branch?

            (As an aside, it's often helpful if you give a link to the specific branch, commits or PR which you'd like reviewed.)

            Show
            swinbank John Swinbank added a comment - Just to be clear – am I reviewing the code on Nate's user branch, or on the ticket branch? (As an aside, it's often helpful if you give a link to the specific branch, commits or PR which you'd like reviewed.)
            Hide
            vpk24 Vishal Kasliwal [X] (Inactive) added a comment - - edited

            Hi John Swinbank! Please review the ticket branch tickets/DM-5427 at https://github.com/lsst/meas_base/compare/tickets/DM-5427 . I'll be sure to include links hereafter. Thanks!

            Show
            vpk24 Vishal Kasliwal [X] (Inactive) added a comment - - edited Hi John Swinbank ! Please review the ticket branch tickets/ DM-5427 at https://github.com/lsst/meas_base/compare/tickets/DM-5427 . I'll be sure to include links hereafter. Thanks!
            Hide
            swinbank John Swinbank added a comment -

            Review comments on this pull request. Mostly just typos and formatting issues; however, I would like to make sure this is properly tested before merging.

            Show
            swinbank John Swinbank added a comment - Review comments on this pull request . Mostly just typos and formatting issues; however, I would like to make sure this is properly tested before merging.
            Hide
            vpk24 Vishal Kasliwal [X] (Inactive) added a comment -

            Merged to master.

            Show
            vpk24 Vishal Kasliwal [X] (Inactive) added a comment - Merged to master.

              People

              Assignee:
              vpk24 Vishal Kasliwal [X] (Inactive)
              Reporter:
              rowen Russell Owen
              Reviewers:
              John Swinbank
              Watchers:
              Jim Bosch, John Swinbank, Russell Owen, Vishal Kasliwal [X] (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.