New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-24537: Add Isr calibration base class #135
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry but I have lots of questions. Hopefully they're all straightforward though. This is definitely something we want to do and I think fairly soon we are going to have to try switching Curve and Defects to this scheme to prove it works.
python/lsst/ip/isr/calibType.py
Outdated
|
||
Parameters | ||
---------- | ||
registryName : `str`, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a registry name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had intended this to be some way to identify the Butler repository that constructed the calibration, to ensure all the dataIds recorded could be transformed if needed. This now seems unnecessary, as any Butler instance should get the same dataIds for the same data from astro_metadata_translator.
I'm changing this to instrument, as it still feels like we need some additional information in the provenance, and I think that's provided by that.
IsrCalib should be the base class used by calibration data. IsrProvenance supplies a concrete example subclass that will allow calibrations to store their inputs in a way that can be used to reconstruct the calibration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments. Code looks much simpler without afw. Did it make any difference to I/O performance?
associated metadata. | ||
|
||
""" | ||
if format == 'yaml' or (format == 'auto' and filename.lower().endswith((".yaml", ".YAML"))): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this means that I can pass in a file name of "hello.ecsv" and say "format=yaml" and end up with a yaml file that has a .ecsv extension. In Defects I force the extension to be correct and I think you have to do that here -- it's why the returned filename doesn't have to match the supplied filename.
python/lsst/ip/isr/calibType.py
Outdated
calib.updateMetadata(setDate=False, **dictionary['metadata']) | ||
calib._detectorName = dictionary['detectorName'] | ||
calib._detectorSerial = dictionary['detectorSerial'] | ||
calib.instrument = dictionary['metadata']['INSTRUME'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fromTable doesn't an "instrument" field get filled in to the dict so I'm not sure why we need to look in the metadata here.
Running a timing test shows that the new astropy code is significantly faster than afwTable in 100 iterations with timeit: |
These types are not used in C++, so it's faster and less confusing to use astropy tables instead.
Add IsrCalib and IsrProvenance classes.
IsrCalib should be the base class used by calibration data.
IsrProvenance supplies a concrete example subclass that will allow
calibrations to store their inputs in a way that can be used to
reconstruct the calibration.