Skip to content

Commit

Permalink
Add log message timeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ehneilsen committed Nov 11, 2024
1 parent 3f9e24b commit a5fafb3
Showing 1 changed file with 47 additions and 50 deletions.
97 changes: 47 additions & 50 deletions nightly/scheduler-nightsum.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
" day_obs = \"2024-06-26\"\n",
" visit_origin = \"lsstcomcamsim\"\n",
"else:\n",
" day_obs = \"2024-11-04\"\n",
" day_obs = \"2024-11-10\"\n",
" visit_origin = \"lsstcomcam\""
]
},
Expand Down Expand Up @@ -84,7 +84,7 @@
"from astropy.coordinates import SkyCoord, get_body\n",
"from astropy.time import Time\n",
"from astropy.visualization import ZScaleInterval\n",
"from IPython.display import HTML, display, Markdown\n",
"from IPython.display import HTML, display, Markdown, HTML\n",
"from lsst.resources import ResourcePath"
]
},
Expand Down Expand Up @@ -118,13 +118,13 @@
"outputs": [],
"source": [
"sched_source = 'times_square_stable'\n",
"sched_source = 'devel'\n",
"# sched_source = 'devel'\n",
"match sched_source:\n",
" case 'times_square_stable':\n",
" sys.path.insert(0, \"/sdf/data/rubin/user/neilsen/devel/times_square_sources/2024-03-25/uranography\")\n",
" sys.path.insert(0, \"/sdf/data/rubin/user/neilsen/devel/times_square_sources/2024-11-04/rubin_scheduler\")\n",
" sys.path.insert(0, \"/sdf/data/rubin/user/neilsen/devel/times_square_sources/2024-11-04/rubin_sim\")\n",
" sys.path.insert(0, \"/sdf/data/rubin/user/neilsen/devel/times_square_sources/2024-11-04/schedview\")\n",
" sys.path.insert(0, \"/sdf/data/rubin/user/neilsen/devel/times_square_sources/2024-11-11T16/schedview\")\n",
" case 'devel':\n",
" sys.path.insert(0, \"/sdf/data/rubin/user/neilsen/devel/times_square_sources/2024-03-25/uranography\")\n",
" sys.path.insert(0, \"/sdf/data/rubin/user/neilsen/devel/rubin_scheduler\")\n",
Expand Down Expand Up @@ -285,6 +285,7 @@
"observatory = ModelObservatory(init_load_length=1)\n",
"timezone = \"Chile/Continental\"\n",
"telescope = ORIGIN_TELESCOPE[visit_origin]\n",
"from_opsim = visit_origin not in KNOWN_INSTRUMENTS\n",
"use_matplotlib = True"
]
},
Expand All @@ -302,7 +303,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "c0ff5108-06d1-4c72-9b00-f9d30794b85f",
"id": "9d78b1af-7dc7-4665-9fdb-747cf7d30921",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -312,14 +313,15 @@
{
"cell_type": "code",
"execution_count": null,
"id": "60531d94",
"id": "e0596573-423a-473d-87cd-462f2c7ca65c",
"metadata": {},
"outputs": [],
"source": [
"night_reports = schedview.collect.nightreport.get_night_report(day_obs, telescope)\n",
"best_version_of_night_report = schedview.compute.nightreport.best_night_report(night_reports)\n",
"night_report_markdown = schedview.plot.nightreport.night_report_markdown(best_version_of_night_report)\n",
"Markdown(night_report_markdown)"
"if not from_opsim:\n",
" night_reports = schedview.collect.nightreport.get_night_report(day_obs, telescope)\n",
" best_version_of_night_report = schedview.compute.nightreport.best_night_report(night_reports)\n",
" night_report_markdown = schedview.plot.nightreport.night_report_markdown(best_version_of_night_report)\n",
" Markdown(night_report_markdown)"
]
},
{
Expand Down Expand Up @@ -416,6 +418,41 @@
" print(\"No visits\")"
]
},
{
"cell_type": "markdown",
"id": "1332b0b8-ebab-4003-ae94-cfb828b54102",
"metadata": {},
"source": [
"## Value timelines"
]
},
{
"cell_type": "markdown",
"id": "98e62b05-250a-4a98-80b7-759e41a36f49",
"metadata": {},
"source": [
"Select a value to plot vs. time using the dropdown at the bottom."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "84cb5cc0-6798-4939-adc3-f553656664c3",
"metadata": {},
"outputs": [],
"source": [
"if from_opsim:\n",
" if len(visits):\n",
" fig = schedview.plot.plot_visit_param_vs_time(visits, 'skyBrightness', show_column_selector=True)\n",
" bokeh.io.show(fig)\n",
" else:\n",
" print(\"No visits\")\n",
"else:\n",
" messages = schedview.collect.nightreport.get_night_narrative(day_obs, telescope)\n",
" p = schedview.plot.make_timeline_scatterplots(log_messages=messages, visits=visits, jitter=False)\n",
" bokeh.io.show(p)"
]
},
{
"cell_type": "markdown",
"id": "e5ac8114-2e48-4f05-9296-e7ea0271ae7c",
Expand Down Expand Up @@ -568,16 +605,6 @@
"### Map the most recent visit so far"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1c4972bc-dbe9-4b4a-96a3-d1029506d594",
"metadata": {},
"outputs": [],
"source": [
"previous_visits.head()"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -735,36 +762,6 @@
"Slew time and previous and current filters are noted, because filter changes are the greatest expected contributions to overhead."
]
},
{
"cell_type": "markdown",
"id": "1332b0b8-ebab-4003-ae94-cfb828b54102",
"metadata": {},
"source": [
"## Value timelines"
]
},
{
"cell_type": "markdown",
"id": "98e62b05-250a-4a98-80b7-759e41a36f49",
"metadata": {},
"source": [
"Select a value to plot vs. time using the dropdown on the left."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1978d30f-5a3b-4f89-9726-d39006443b49",
"metadata": {},
"outputs": [],
"source": [
"if len(visits):\n",
" fig = schedview.plot.plot_visit_param_vs_time(visits, 'skyBrightness', show_column_selector=True)\n",
" bokeh.io.show(fig)\n",
"else:\n",
" print(\"No visits\")"
]
},
{
"cell_type": "markdown",
"id": "0e3605be-cd8f-4d3f-8e93-64ced652db0b",
Expand Down

0 comments on commit a5fafb3

Please sign in to comment.