-
Type: Story
-
Status: Done (View Workflow)
-
Priority: Normal
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: pfs_pipe2d
-
Labels:None
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