spacetelescope / jwst

Python library for science observations from the James Webb Space Telescope
https://jwst-pipeline.readthedocs.io/en/latest/
Other
560 stars 167 forks source link

Add group_id to Level 3 associations #8523

Open stscijgbot-jp opened 4 months ago

stscijgbot-jp commented 4 months ago

Issue JP-3644 was created on JIRA by Nadia Dencheva:

Consider adding group_id to associations.

Some steps in the Level 3 pipelines group observations. For example resample groups images to do relative alignment per group before aligning to an external catalog. The groups are computed in ModelContainer.grouped_models and an attribute "model.meta.group_id" is added to each model.

This requires that every model is opened to read the metadata below and save the group_id, making the process very memory intensive. Computing the group_id when the association is generated and adding it to the association will help with memory management.

The following metadata is used to group data

 


        meta.observation.program_number
        meta.observation.observation_number
        meta.observation.visit_number
        meta.observation.visit_group
        meta.observation.sequence_id
        meta.observation.activity_id
        meta.observation.exposure_number``` 
stscijgbot-jp commented 4 months ago

Comment by Jonathan Eisenhamer on JIRA:

Current association pools have columns for all the required data:


        meta.observation.program_number -> program
        meta.observation.observation_number -> obs_num
        meta.observation.visit_number -> visit
        meta.observation.visit_group -> visitgrp
        meta.observation.sequence_id -> seq_id
        meta.observation.activity_id -> act_id
        meta.observation.exposure_number -> exposure```
stscijgbot-jp commented 4 months ago

Comment by Jonathan Eisenhamer on JIRA:

Proposed solution

Each member will have a new attribute, group_id. The value of this attribute will be a string with the following format, as derived from the referenced code in the description:

jw_<program><obs_num><visit>_<visitgrp><seq_id><act_id>_exposure

Though this is specific to NIRCam, the proposal would be to add this globally to all members. There is no harm in the extra information and will future-proof if other cases need this attribute.