Uploaded image for project: 'DRP 2-D Pipeline'
  1. DRP 2-D Pipeline
  2. PIPE2D-1394

DetectorMap.clone() doesn't handle slit offsets correctly

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done (View Workflow)
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: pfs_pipe2d
    • Labels:
      None

      Description

      Cloning a detector map appears to make an insufficiently deep copy.

      dataId = {'visit': 107418, 'arm': 'n', 'spectrograph': 3}
      detMap = butler.get("detectorMap", dataId)
      
      detMap0 = detMap.clone()
      
      spatialOffsets0 = detMap.getSpatialOffsets().copy()
      spectralOffsets0 = detMap.getSpectralOffsets().copy()
      
      dx = 1000
      fid = 1817
      
      print(f"Initially: {np.mean(detMap.getXCenter(fid)):.1f}")
      
      detMap.setSlitOffsets(fid, detMap.getSpatialOffset(fid) + dx, detMap.getSpectralOffset(fid))
      
      print(f"After {dx}: {np.mean(detMap.getXCenter(fid)):.1f}")
      print(f"detMap0: {np.mean(detMap0.getXCenter(fid)):.1f}")
      

      results in

      Initially: 888.9
      After 1000: 1888.9
      detMap0: 1888.9
      

      Note that the value from detMap0 has been modified

        Attachments

          Activity

            People

            • Assignee:
              price price
              Reporter:
              rhl rhl
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: