Details
-
Type:
Improvement
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: cbp
-
Labels:None
-
Story Points:2
-
Epic Link:
-
Team:Alert Production
Description
Please update the cbp package for change in how Detectors and Cameras are built.
I suggest you use the tickets/DM-20488 branch or base your branch off of that one. Or, if you prefer, cherry-pick those changes.
I think the main class that needs updating is SampleCoordinateConverter in testUtils.py.
I had a try at this myself (see attached file), and was able to make a list of Detectors and get rid of the no-longer-needed AmpInfoTable (the test code doesn't care about amplifiers), but could not figure out how to create a Camera (nor verify that the Detectors I made were correct).
Attachments
Issue Links
Activity
Description |
Please update the cbp package for change in how Detectors and Cameras are built.
I suggest you use the tickets/ |
Please update the cbp package for change in how Detectors and Cameras are built.
I suggest you use the tickets/ I think the main class that needs updating is SampleCoordinateConverter in testUtils.py. I had a try at this myself, and was able to a list of Detectors, but could not figure out how to create a Camera. SampleCoordinateConverter._makeAmpInfoCatalog can almost certainly be deleted, since the cbp code does not care about amplifiers (I only created an AmpInfoTable because it was required to make a Detector, and that is no longer the case. I have attached my attempted update of testUtils.py in case it is a useful starting point. |
Attachment | testUtils.py [ 41940 ] |
Description |
Please update the cbp package for change in how Detectors and Cameras are built.
I suggest you use the tickets/ I think the main class that needs updating is SampleCoordinateConverter in testUtils.py. I had a try at this myself, and was able to a list of Detectors, but could not figure out how to create a Camera. SampleCoordinateConverter._makeAmpInfoCatalog can almost certainly be deleted, since the cbp code does not care about amplifiers (I only created an AmpInfoTable because it was required to make a Detector, and that is no longer the case. I have attached my attempted update of testUtils.py in case it is a useful starting point. |
Please update the cbp package for change in how Detectors and Cameras are built.
I suggest you use the tickets/ I think the main class that needs updating is SampleCoordinateConverter in testUtils.py. I had a try at this myself (see attached file), and was able to make a list of Detectors and get rid of the no-longer-needed AmpInfoTable (the test code doesn't care about amplifiers), but could not figure out how to create a Camera (nor verify that the Detectors I made were correct). |
Epic Link |
|
Status | To Do [ 10001 ] | In Progress [ 3 ] |
Reviewers | Russell Owen [ rowen ] | |
Status | In Progress [ 3 ] | In Review [ 10004 ] |
Team | DM Science [ 12218 ] | Alert Production [ 10300 ] |
Status | In Review [ 10004 ] | Reviewed [ 10101 ] |
Resolution | Done [ 10000 ] | |
Status | Reviewed [ 10101 ] | Done [ 10002 ] |
Assignee | Merlin Fisher-Levine [ mfisherlevine ] | John Swinbank [ swinbank ] |
Russell Owen — could you please take a look at https://github.com/lsst/cbp/pull/7 and see what you think?
A couple of things are worth noting:
First, some of the code in both the tests and in computeHolePositions assumes that list(cameraGeom.getNameIter()) returns a list sorted in a particular order. That doesn't seem to be true in practice (and I don't think that's a bug). I've worked around this by the expedient method of using sorted() where necessary and switching to set (rather than list) comparisons, which works (as far as the tests are concerned), but feels a little clunky. You undoubtedly have more insight into what the code should be doing than I do, so you may wish to suggest a better approach.
Secondly, even with these changes, I see a test failure:
for telRotObserved in (0*degrees, -32*degrees, 167*degrees):
self.cco.rotAzAltObserved = telRotObserved
self.assertAnglesAlmostEqual(self.cco.rotAzAltObserved, telRotObserved)
predictedRotInternal = telRotObserved/self.cco.config.telRotScale - self.cco.config.telRotOffset
> self.assertAnglesAlmostEqual(self.cco.telRotInternal, predictedRotInternal)
tests/test_coordinateConverter.py:466:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/lsst/software/stack/stack/miniconda3-4.7.12-984c9f7/Linux64/geom/19.0.0-2-gde8e5e3+2/python/lsst/geom/testUtils.py:84: in assertAnglesAlmostEqual
testCase.fail("ang0 is NaN")
E AssertionError: ang0 is NaN
After a few minutes looking at the code, I can't see how this is supposed to work (I don't see why self.cco.telRotInternal would be anything other than NaN). Further, I note that this test fails with the oldest stacks I have available, dating from far before the cameraGeom changes late last year.
Perhaps you could take a look at this test and see if you still think it is useful?
Oh, and I should say thanks to Chris Morrison [X] for the help (and moral support!) while fighting with cameraGeom weirdness!