Skip to content

New code to create Photom reference files based on T. Desjardins code. It includes code to apply PAM correction and an environment file.#74

Open
acalamid wants to merge 2 commits intospacetelescope:mainfrom
acalamid:dev_apcorr
Open

New code to create Photom reference files based on T. Desjardins code. It includes code to apply PAM correction and an environment file.#74
acalamid wants to merge 2 commits intospacetelescope:mainfrom
acalamid:dev_apcorr

Conversation

@acalamid
Copy link
Copy Markdown

No description provided.

@acalamid
Copy link
Copy Markdown
Author

Please review this request

Copy link
Copy Markdown
Collaborator

@rgcosentino rgcosentino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}'})
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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']
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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']),
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combine this with the gain method from CRDS to return stats that you need

# HELPER FUNCTIONS
# -----------------------------

def build_filter_entry(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will call this something like optical element helper or something

# dm.phot_table = phot_table


phot_meta = {'reftype': 'PHOTOM',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of this we can put into a meta maker or a template file or config file for this ref type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants