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

tickets/PREOPS-4948: functions to support imitating a DES nightsum report using a Times Square notebook #75

Merged
merged 6 commits into from
Mar 6, 2024

Conversation

ehneilsen
Copy link
Collaborator

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.

@ehneilsen ehneilsen changed the title tickets/PREOPS-4948: functions to support immitating a DES nightsum report using a Times Square notebook tickets/PREOPS-4948: functions to support imitating a DES nightsum report using a Times Square notebook Feb 27, 2024
@ehneilsen ehneilsen marked this pull request as draft February 27, 2024 23:04
@ehneilsen ehneilsen marked this pull request as ready for review February 28, 2024 16:34
Copy link
Member

@rhiannonlynne rhiannonlynne left a 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",
Copy link
Member

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)}"
Copy link
Member

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%'"

Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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.

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

Attention: Patch coverage is 92.79661% with 34 lines in your changes are missing coverage. Please review.

Project coverage is 67.49%. Comparing base (470e267) to head (f1d7f82).

❗ Current head f1d7f82 differs from pull request most recent head 7749366. Consider uploading reports for the commit 7749366 to get more accurate results

Files Patch % Lines
schedview/collect/opsim.py 77.50% 2 Missing and 7 partials ⚠️
schedview/plot/survey.py 87.27% 3 Missing and 4 partials ⚠️
schedview/app/prenight/prenight.py 37.50% 4 Missing and 1 partial ⚠️
schedview/plot/overhead.py 88.63% 2 Missing and 3 partials ⚠️
schedview/compute/visits.py 96.87% 0 Missing and 2 partials ⚠️
schedview/plot/nightly.py 0.00% 1 Missing and 1 partial ⚠️
schedview/compute/maf.py 97.43% 0 Missing and 1 partial ⚠️
schedview/plot/cadence.py 96.29% 0 Missing and 1 partial ⚠️
schedview/plot/visits.py 93.75% 0 Missing and 1 partial ⚠️
tests/test_compute_maf.py 96.55% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

@ehneilsen ehneilsen merged commit 7bff853 into main Mar 6, 2024
7 checks passed
@ehneilsen ehneilsen deleted the tickets/PREOPS-4948 branch March 6, 2024 21:06
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