Closed heather999 closed 6 years ago
@SimonKrughoff It appears that we will need new files in tests/data
that have the correct geometries for the overscan regions, etc.. For those, I expect that we need to run phosim v3.7.9, which I can do. Of the two failed unit tests that Heather found, the test_getId.py
error looks unconnected with the amplifier image geometry changes in v3.7.9. Do you know what the issue is? Here is the output from Heather's post in #desc-dm-dc2:
__________________________________ GetIdTestCase.testId ____________________________________
self = <test_getId.GetIdTestCase testMethod=testId>
def testId(self):
"""Test retrieval of exposure ids"""
bits = self.butler.get("ampExposureId_bits", immediate=True)
self.assertEqual(bits, 45)
id = self.butler.get("ampExposureId", visit=85471048, snap=0, raft='0,3', sensor='0,1',
channel='1,0', immediate=True)
self.assertEqual(id, (85471048 << 13) + 480 + 16 + 8)
dr = self.butler.dataRef("raw", visit=85471048, raft='2,1', sensor='1,2')
bits = dr.get("ampExposureId_bits")
id = dr.get("ampExposureId", snap=0, channel='1,4')
self.assertEqual(bits, 45)
self.assertEqual(id, (85471048 << 13) + 11*160 + 5*16 + 12)
bits = dr.get("ccdExposureId_bits")
id = dr.get("ccdExposureId")
self.assertEqual(bits, 41)
self.assertEqual(id, (85471048 << 9) + 11*10 + 5)
dataId = dict(tract=1, patch='2,3', filter='z')
bits = self.butler.get("deepCoaddId_bits", dataId, immediate=True)
id = self.butler.get("deepCoaddId", dataId, immediate=True)
self.assertEqual(bits, 37)
> self.assertEqual(id, ((((1 * 8192) + 2) * 8192) + 3)*8 + 4)
E AssertionError: 69828 != 537002012
tests/test_getId.py:60: AssertionError
------------------------------------ Captured stdout call ------------------------------------
@jchiang87 I had a quick look and I don't really understand what's going on. The obs_sdss
package has the same test, and is presumably passing. There were no changes in the PR that should affect that value. I'll try to reproduce because I'll probably have to drop into a debugger.
test_getId.py problem was fixed by https://github.com/LSSTDESC/obs_lsstSim/pull/12
I've reverted to v3.7.9. Ok to merge this PR? We'll fix up the unit tests as soon as possible, but not today.
Ok - removed the old code and added Simon as a reviewer
Updating local files for phoSim v3.7.9 following the recipe in the README, with some modifications. We used bias data generated using phoSim v3.7.9, making sure to update the script to ignore the eimage files due to the presence of the wave front sensor data. Also handled the introduction of a new column in phosim's focalplanelayout.txt file - which meant we had to modify the assumed indices for all >=8 when reading the files. One final bit is to fix up the unit tests.