Skip to content
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

Improve association generation script #1461

Open
schlafly opened this issue Oct 17, 2024 · 2 comments
Open

Improve association generation script #1461

schlafly opened this issue Oct 17, 2024 · 2 comments
Assignees

Comments

@schlafly
Copy link
Collaborator

As part of the initial association generation script merge, we identified the following areas for future work:

  • Let's extend the skycell wcs info info to include the orientat_cent from orientat_projection_center. This is the only field remaining in order to have a full tangent plane WCS definition. It's not critical for the initial merge since it is presently always zero, and for now we can just throw an error if it's not equal to that, but it's the one bit of information we're not tracking.
  • We should add the code to resample to use the new skycell wcs info from the projection cell.
  • This code presently generates only the "visit" products, though it kind of just assumes that you pass it a visit. It would be good if it could take a list of files, and the code figured out how to make the various pass / visit / full combinations. I think one could generate those with an additional loop over the file names, with something like the following pseudocode:
obsid_list = []
for file_name in filelist:
    obsid_list.append(cal_file.meta.observation.obs_id)
visitid = [o[:19] for o in obsid_list]
passid = [o[:10] for o in obsid_list]
fullid = [o[:5] for o in obsid_list]
# generate visit products
for visit in unique(visitid):
    generate_products([f for f, v in zip(filelist, visitid) if v == visit], type='visit')
# generate pass products
for passno in unique(passid):
    generate_products([f for f, p in zip(filelist, passid) if p == passno], type='pass')
for progno in np.unique(fullid):
    generate_products([f for f, p in zip(filelist, fullid) if p == progno), type='full')

The other thing that we would need to loop over would be the filter names, so that generate_products only sees one filter at a time.

@ddavis-stsci
Copy link
Collaborator

skycell_asn is intended to be a low level routine that only processes a list of files that it is given. The design plan is to have a higher level script to generate the list based on the association rules which should be more flexible. So I don't think it is a good idea to add list processing to the current module.

@schlafly
Copy link
Collaborator Author

I don't feel strongly about whether it's in this module or in another module, but we should have the functionality to generate all of these products. It looks to me like a modest addition to the existing module, but another module could work fine.

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

No branches or pull requests

2 participants