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

Verify usability and correctness of AuxTel defects list produced in DM-18749

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Verify that the defects file for auxTel produced in DM-18749 are usable and correct by rerunning the `findDefects.py` task with `doDefect=True` and checking that all defects are masked and therefore not found  (this has not been tried before). 

        Attachments

          Issue Links

            Activity

            Hide
            plazas Andrés Alejandro Plazas Malagón added a comment -

            Thank you Tim. Do you have an example of code that reads the fits file to create a Defects object and be able to use Defects.maskPixels as you suggest?

            Show
            plazas Andrés Alejandro Plazas Malagón added a comment - Thank you Tim. Do you have an example of code that reads the fits file to create a Defects object and be able to use Defects.maskPixels as you suggest?
            Hide
            tjenness Tim Jenness added a comment -

            something like (untested mainly pseudocode-ish) for one defect:

            defects1 = lsst.meas.algorithms.Defects.readFits("file1.fits")
            # Then create an empty mask of the right shape
            ccdImage = afwImage.MaskedImageF(4096, 4096)
            defects1.maskPixels(ccdImage, maskName="BAD")
            mask = ccdImage.getMask()
            bitMask = mask.getPlaneBitMask('BAD')
            

            and then do whatever you want with the masks (display them or compare them). This is the approach I was suggesting you used in the other defects code you were writing since you can go from the mask back to a Defects object.

            Show
            tjenness Tim Jenness added a comment - something like (untested mainly pseudocode-ish) for one defect: defects1 = lsst.meas.algorithms.Defects.readFits( "file1.fits" ) # Then create an empty mask of the right shape ccdImage = afwImage.MaskedImageF( 4096 , 4096 ) defects1.maskPixels(ccdImage, maskName = "BAD" ) mask = ccdImage.getMask() bitMask = mask.getPlaneBitMask( 'BAD' ) and then do whatever you want with the masks (display them or compare them). This is the approach I was suggesting you used in the other defects code you were writing since you can go from the mask back to a Defects object.
            Hide
            tjenness Tim Jenness added a comment -

            Oh, and use Defects.readText)) if you want to read the .ecsv files.

            Show
            tjenness Tim Jenness added a comment - Oh, and use Defects.readText)) if you want to read the .ecsv files.
            Hide
            plazas Andrés Alejandro Plazas Malagón added a comment -

            Thank you so much!

            Show
            plazas Andrés Alejandro Plazas Malagón added a comment - Thank you so much!
            Hide
            plazas Andrés Alejandro Plazas Malagón added a comment -

            Plotting mask.array for both files, the number of bad pixels goes from 3069 (when isrForDarks.doDefect=False isrForFlats.doDefect=False, the default) to 84 (when the defects file created in the first pass is used by setting isrForDarks.doDefect=True isrForFlats.doDefect=True):

            isrForDarks.doDefect=False isrForFlats.doDefect=False:

            isrForDarks.doDefect=True isrForFlats.doDefect=True:

            Show
            plazas Andrés Alejandro Plazas Malagón added a comment - Plotting mask.array for both files, the number of bad pixels goes from 3069 (when isrForDarks.doDefect=False isrForFlats.doDefect=False, the default) to 84 (when the defects file created in the first pass is used by setting isrForDarks.doDefect=True isrForFlats.doDefect=True): isrForDarks.doDefect=False isrForFlats.doDefect=False: isrForDarks.doDefect=True isrForFlats.doDefect=True:

              People

              • Assignee:
                plazas Andrés Alejandro Plazas Malagón
                Reporter:
                plazas Andrés Alejandro Plazas Malagón
                Watchers:
                Andrés Alejandro Plazas Malagón, John Swinbank, Kian-Tat Lim, Merlin Fisher-Levine, Simon Krughoff, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel