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

Very abnormal PSF in RC2 images

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: pipe_tasks
    • Labels:
      None
    • Story Points:
      0.5
    • Team:
      Data Release Production
    • Urgent?:
      No

      Description

      In at least one RC2 patch there is a region that has a very wonky PSF

      From Mike Jarvis on SLACK:

      Looks to me like a bad extrapolation to a part of the image with few (or no) stars. If there are a couple outliers nearby, but then no good stars in some part of the image, the fit can end up going crazy near the edges. Usually the options are (1) apply stricter input rejection criteria to remove bad PSF examplars at the start, (2) lower the interpolation order, (3) identify the bad fit via some kind of heuristic on the output model.

      Since this occurred during the regular HSC reprocessing it seems like we should likely look at his suggestions (1) and (3) to attempt to prevent this from happening again.

      To generate the bad image:

      # DataId info
      skymap = "hsc_rings_v1"
      tract = 9697
      patch = 7
      collections = ["HSC/runs/RC2/w_2022_32/PREOPS-1225"]
      band = "i"
       
      # Load the data
      butler = Butler("/sdf/group/rubin/repo/main_20220411", skymap=skymap, collections=collections)
      psfModel = butler.get("deepCoadd_calexp.psf", tract=tract, patch=patch, band=band)
      position = Point2D(30417, 1641.5)
      psfImage = psfModel.computeKernelImage(position).array
      

        Attachments

        1. badPsf.png
          badPsf.png
          7 kB
        2. screenshot-1.png
          screenshot-1.png
          57 kB
        3. screenshot-2.png
          screenshot-2.png
          465 kB
        4. screenshot-3.png
          screenshot-3.png
          1.06 MB

          Activity

          Hide
          erykoff Eli Rykoff added a comment -

          I looked at the component psfs:

          from lsst.daf.butler import Butler
          import lsst.geom
           
           
          # DataId info
          skymap = "hsc_rings_v1"
          tract = 9697
          patch = 7
          collections = ["HSC/runs/RC2/w_2022_32/PREOPS-1225"]
          band = "i"
           
          # Load the data
          butler = Butler("/sdf/group/rubin/repo/main_20220411", skymap=skymap, collections=collections)
          psfModel = butler.get("deepCoadd_calexp.psf", tract=tract, patch=patch, band=band)
          coadd_wcs =  butler.get("deepCoadd_calexp.wcs", tract=tract, patch=patch, band=band)
          calexp = butler.get("deepCoadd_calexp", tract=tract, patch=patch, band=band)
           
          pos = lsst.geom.Point2D(30417, 1641.5)
           
          im = psfModel.computeImage(pos)
           
          for i in range(psfModel.getComponentCount()):
              print(i)
              psf = psfModel.getPsf(i)
              wcs = psfModel.getWcs(i)
              poly = psfModel.getValidPolygon(i)
           
              im_pos = wcs.skyToPixel(coadd_wcs.pixelToSky(pos))
           
              if not poly.contains(im_pos):
                  print('  Not overlapping.')
                  continue
           
              image = psf.computeImage(im_pos)
           
              plt.imshow(image.array)
              plt.show()
          

          Input 32 was suspect, visit 36202, detector 71.

          This is a position that is not in the stars that are part of the PSF model:

          And it's a miracle the other component psfs worked because this is the bad image:

          And this is the patch:

          Overall, this is not a region where we can get a reliable psf model, but cell-based coadds will allow us to more accurately pinpoint bad regions to keep one bad psf model from spoiling the whole bag.

          Show
          erykoff Eli Rykoff added a comment - I looked at the component psfs: from lsst.daf.butler import Butler import lsst.geom     # DataId info skymap = "hsc_rings_v1" tract = 9697 patch = 7 collections = [ "HSC/runs/RC2/w_2022_32/PREOPS-1225" ] band = "i"   # Load the data butler = Butler( "/sdf/group/rubin/repo/main_20220411" , skymap = skymap, collections = collections) psfModel = butler.get( "deepCoadd_calexp.psf" , tract = tract, patch = patch, band = band) coadd_wcs = butler.get( "deepCoadd_calexp.wcs" , tract = tract, patch = patch, band = band) calexp = butler.get( "deepCoadd_calexp" , tract = tract, patch = patch, band = band)   pos = lsst.geom.Point2D( 30417 , 1641.5 )   im = psfModel.computeImage(pos)   for i in range (psfModel.getComponentCount()): print (i) psf = psfModel.getPsf(i) wcs = psfModel.getWcs(i) poly = psfModel.getValidPolygon(i)   im_pos = wcs.skyToPixel(coadd_wcs.pixelToSky(pos))   if not poly.contains(im_pos): print ( ' Not overlapping.' ) continue   image = psf.computeImage(im_pos)   plt.imshow(image.array) plt.show() Input 32 was suspect, visit 36202, detector 71. This is a position that is not in the stars that are part of the PSF model: And it's a miracle the other component psfs worked because this is the bad image: And this is the patch: Overall, this is not a region where we can get a reliable psf model, but cell-based coadds will allow us to more accurately pinpoint bad regions to keep one bad psf model from spoiling the whole bag.
          Hide
          fred3m Fred Moolekamp added a comment -

          Thanks for looking into this Eli!

          Show
          fred3m Fred Moolekamp added a comment - Thanks for looking into this Eli!

            People

            Assignee:
            erykoff Eli Rykoff
            Reporter:
            fred3m Fred Moolekamp
            Reviewers:
            Fred Moolekamp
            Watchers:
            Eli Rykoff, Fred Moolekamp, Joshua Meyers
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.