New code to create Photom reference files based on T. Desjardins code. It includes code to apply PAM correction and an environment file.#74
Conversation
|
Please review this request |
rgcosentino
left a comment
There was a problem hiding this comment.
Please do the ruff check --fix first
I made a bunch of comments for you to know where we are going with development. We will make a refactor plan at Monday's RFP meeting. I can try to adapt the pixel area map to show you how we refactor from dev scripts to the RFP repo.
I will approve and merge after you do the ruff and acknowledge my review and comments.
|
|
||
| stats = {} | ||
|
|
||
| for i in range(18): |
There was a problem hiding this comment.
We will want to separate the class to be independent for each detector. One of the required meta data is the WFI detector number. So this is a great way to show how we make each file for each detector.
| stats = {} | ||
|
|
||
| for i in range(18): | ||
| meta.update({'ROMAN.META.INSTRUMENT.DETECTOR': f'WFI{i+1:02d}'}) |
There was a problem hiding this comment.
This is great code to get the gain file. Keep this ready and handy. Make this a separate method.
|
|
||
| # Imaging filters (must exist as columns in the ECSV table) | ||
| #IMAGING_FILTERS = ['F106'] #['F062', 'F087', 'F106', 'F129', 'F146', 'F158', 'F184', 'F213'] | ||
| IMAGING_FILTERS = ['F062', 'F087', 'F106', 'F129', 'F146', 'F158', 'F184', 'F213'] |
There was a problem hiding this comment.
We have all of these listed in constants.py, so we can important them as lists and use however we want
| OUTPUT_ASDF = f'roman_wfi{DET_INDEX:02d}_photom.asdf' | ||
|
|
||
| # Pixel Area Map | ||
| import make_pam as pam |
There was a problem hiding this comment.
I will help with the pixel area reference file so you can use it somewhat similar to the gain reference file from CRDS
| return { | ||
| 'median': float(stats[key]['median']), | ||
| 'stddev': float(stats[key]['stddev']), | ||
| } |
There was a problem hiding this comment.
Combine this with the gain method from CRDS to return stats that you need
| # HELPER FUNCTIONS | ||
| # ----------------------------- | ||
|
|
||
| def build_filter_entry( |
There was a problem hiding this comment.
We will call this something like optical element helper or something
| # dm.phot_table = phot_table | ||
|
|
||
|
|
||
| phot_meta = {'reftype': 'PHOTOM', |
There was a problem hiding this comment.
A lot of this we can put into a meta maker or a template file or config file for this ref type
No description provided.