-
Notifications
You must be signed in to change notification settings - Fork 1
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
tickets/PREOPS-4948: functions to support imitating a DES nightsum report using a Times Square notebook #75
Conversation
2f56bad
to
7e33c32
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like we talked about, there are things to rearrange later, but this is a good start.
"note", | ||
"target", | ||
"fieldId", | ||
"proposalId", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop fieldId and proposalId
The visits and their parameters. | ||
""" | ||
ddf_field_names = tuple(ddf_locations().keys()) | ||
constraint = f"target IN {tuple(field_name for field_name in ddf_field_names)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"note" is the scheduler note on how a visit was acquired. For DDFs, this has been pretty consistently
"note like '%DD%'"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But Target is also good to use. Bear in mind it may change, too. (Peter is considering adding a sequence number to the current content).
compute_metric(visits, bundles) | ||
metric_values = {b: bundles[b].metric_values for b in bundles if bundles[b].metric_values is not None} | ||
|
||
return metric_values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I agree that most of this will probably go elsewhere (such as into MAF, then call the batch, etc. or for an advanced use, to just call MAF directly).
visits.insert(1, "day_obs_mjd", day_obs_mjd) | ||
visits.insert(2, "day_obs_date", day_obs_date) | ||
visits.insert(3, "day_obs_iso8601", day_obs_iso8601) | ||
return visits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to go ahead and also incorporate the summit tools as long they don't require the stack to install. And use Merlin's computation of DAYOBS there. Then we would always stay in sync with the same definition of DAYOBS, in case it changes (due to taking flats or other calibration data in the morning, for example).
|
||
value = schedview.compute.compute_metric_by_visit(visits, metric, constraint) | ||
visits.insert(col_index, column_name, value) | ||
return visits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right .. we were going to turn Teff into a stacker ..
filter_col_index = tuple(visits.columns).index("filter") | ||
previous_filter = visits["filter"].shift(1) | ||
visits.insert(filter_col_index + 1, "previous_filter", previous_filter) | ||
return visits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And now I'm wondering what happens regarding focus frames and if the AOS system needs additional time.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #75 +/- ##
===========================================
+ Coverage 13.11% 67.49% +54.37%
===========================================
Files 43 54 +11
Lines 3385 4104 +719
Branches 501 576 +75
===========================================
+ Hits 444 2770 +2326
+ Misses 2932 1097 -1835
- Partials 9 237 +228 ☔ View full report in Codecov by Sentry. |
Several things will get refactored once some things get added as stackers in maf, but I want this done as a separate PR so the initial version doesn't rely on getting updated at the same time as rubin_sim.