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

DM-46562: Add bps templates for LSSTCam/LSSTComCam/LATISS calibration creation. #292

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

erykoff
Copy link
Contributor

@erykoff erykoff commented Jan 22, 2025

No description provided.

output: ${USER_CALIB_PREFIX}${INSTRUMENT}/calib/${TICKET}/${TAG}/flatGen-${FLAT_BAND}.${RERUN}
butlerConfig: ${REPO}
inCollection: ${USER_CALIB_PREFIX}${INSTRUMENT}/calib/${TICKET}/${TAG},${RAW_COLLECTION},${CALIB_COLLECTIONS}
dataQuery: ${!SELECTION_FLAT_BAND}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this exclamation point is a typo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is bash "indirection" which should allow one template to be used for all the flats with different selection variables. That's the idea, at least. I haven't gotten to testing this part yet!

```
export FLAT_BAND=g
export SELECTION_FLAT_BAND=SELECTION_FLAT_g
export SELECTION_FLAT_g="instrument='LSSTComCam' and selection-string"
Copy link
Contributor

Choose a reason for hiding this comment

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

This uses selection-string instead of selection_string used elsewhere. Not really a "bug" as this is documentation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actual comment: If we have a band variable, we should constrain the query to just that band. This will prevent future accidents where we generate a 15 input g flat and a 1 input r flat in the same collection because an endpoint was misread.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True but not trivial because we need to know the physical filter in the constraint, so I can't easily template that generally for LATISS/LSSTComCam/LSSTCam. But we can put strong recommendation that SELECTION_FLAT_g and friends include a physical filter constraint!

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to know the physical_filter. I assume pipetask and butler query-dimension-records use the same resolver, so something like this should work:

butler query-dimension-records /repo/main exposure --where "instrument='LSSTComCam' AND physical_filter.band='g'" --limit 1
instrument       id      day_obs         group         physical_filter        obs_id        exposure_time    dark_time    observation_type observation_reason seq_num seq_start seq_end target_name science_program tracking_ra tracking_dec sky_angle azimuth zenith_angle has_simulated can_see_sky               timespan (TAI)              
---------- ------------- -------- -------------------- --------------- -------------------- ------------- --------------- ---------------- ------------------ ------- --------- ------- ----------- --------------- ----------- ------------ --------- ------- ------------ ------------- ----------- ------------------------------------------
LSSTComCam 2021040100003 20210401 CALSET_20210401_1601            g_07 CC_O_20210401_000003           1.0 1.5343017578125             flat               flat       3         3       3     UNKNOWN         unknown        None         None      None    None         None         False        None [2021-04-01T16:24:36, 2021-04-01T16:24:37)

Copy link
Member

Choose a reason for hiding this comment

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

"instrument='LSSTComCam' AND band='g'" should work and is shorter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When getting a flat from a calib repo that doesn't work, so I guess I had assumed we needed it in the constraint as well.

output: ${USER_CALIB_PREFIX}${INSTRUMENT}/calib/${TICKET}/${TAG}/linearizerGen.${RERUN}
butlerConfig: ${REPO}
inCollection: ${USER_CALIB_PREFIX}${INSTRUMENT}/calib/${TICKET}/${TAG},${RAW_COLLECTION},${CALIB_COLLECTIONS}
dataQuery: ${SELECTION_PTC_LINEARIZER-$SELECTION_PTC}
Copy link
Contributor

Choose a reason for hiding this comment

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

This has a typo as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More bash magic that is supposed to use $SELECTION_PTC_LINEARIZER if it is set and otherwise use $SELECTION_PTC. Also not yet tested if the bps vars support this...

Environment Variables
---------------------

These are the environment variables that must be used. Examples are substituted in.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should also note that selection_string is a dummy variable here, and that it needs to be filled with something explicit. I was going to suggest putting in the information being used on DM-46562 (the ticket used below), but I see that's this ticket adding the BPS templates, not a generation ticket.

@erykoff erykoff force-pushed the tickets/DM-46562 branch 3 times, most recently from 84105fc to 2850fa2 Compare January 23, 2025 17:46
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.

3 participants