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-5360: clean up the nightsum and prenight Times Square notebooks by updating schedview to support them better #101

Merged
merged 7 commits into from
Sep 13, 2024

Conversation

ehneilsen
Copy link
Collaborator

No description provided.

@rhiannonlynne
Copy link
Member

rhiannonlynne commented Sep 12, 2024

Can you add a screenshot of what gets produced by create_metric_visit_map_grid?
I think I know but want to make sure - I think the model observatory and thus conditions are only used to put in the sun and moon positions right? Is this function useful enough that it should be available even if conditions are not available, and then the sun/moon are just skipped? If not, it's fine -- I know when you're plotting things using these tools, you almost always have all the information like the model observatory up and available.

@rhiannonlynne
Copy link
Member

Looks fine, but ruff failure.

warn("No visits match constraints.")
visits = pd.DataFrame(rubin_scheduler.scheduler.utils.empty_observation()).drop(index=0)
if "observationId" not in visits.columns and "ID" in visits.columns:
visits.rename(columns={"ID": "observationId"}, inplace=True)
Copy link
Member

Choose a reason for hiding this comment

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

empty_observation gives you an "observation" array, not a "visits" (MAF) array .. maybe just run empty_observation through schema converter so all the columns match what you expect? Or maybe it doesn't matter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

At present it doesn't matter, but you are correct that using SchemaConverter.obs2opsim will get it right, whereas what's there now will not. Fixing it now.

@ehneilsen
Copy link
Collaborator Author

create_metric_visit_map_grid creates the maps of most recent and accumulated visits in the nightsum pages. The model observatory is used not only for the sun and moon positions, but also to get the observatory latitude which is needed for the horizon circles at sunrise and sunset.
Could it be optional so this could be run without a model observatory, if we did not plot these things? Sure, but I suspect that someone doing this might just want to go directly to the metric plotting tools in maf, or use maf plus raw uranography of the healpix map: much of the point in these functions is to put together all the elements needed for the specific plots needed for the nightsum and similar notebooks, so I don't think making the model observatory optional will be of much use.

@ehneilsen
Copy link
Collaborator Author

Sample output from create_metric_visit_map metric_visit_map.

@ehneilsen ehneilsen merged commit 4cfe30b into main Sep 13, 2024
7 checks passed
@ehneilsen ehneilsen deleted the tickets/PREOPS-5360 branch September 13, 2024 20:29
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