Skip to content

Commit 4928e20

Browse files
author
Leanne Guy
committed
Change obsloctap URL from dev to prod and parameterise
1 parent 1496738 commit 4928e20

1 file changed

Lines changed: 35 additions & 29 deletions

File tree

Commissioning/102_rubin_schedule_viewer.ipynb

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -157,26 +157,46 @@
157157
},
158158
{
159159
"cell_type": "markdown",
160-
"id": "8",
160+
"id": "d7cbe189-5a7c-4373-8fcb-076d661b0a6f",
161161
"metadata": {},
162162
"source": [
163163
"## 2. Rubin Schedule Viewer\n",
164164
"\n",
165+
"The Rubin Schedule Viewer runs at the US Data Facility at SLAC. \n",
166+
"\n",
167+
"Define the ObsLocTAP URL of the service."
168+
]
169+
},
170+
{
171+
"cell_type": "code",
172+
"execution_count": null,
173+
"id": "13",
174+
"metadata": {},
175+
"outputs": [],
176+
"source": [
177+
"obsloctap_url = \"https://usdf-rsp.slac.stanford.edu/obsloctap\""
178+
]
179+
},
180+
{
181+
"cell_type": "markdown",
182+
"id": "8",
183+
"metadata": {},
184+
"source": [
165185
"### 2.1. Graphical User Interface\n",
166186
"\n",
167187
"The Rubin Schedule Viewer User Interface (UI) provides a convenient graphical user interface to query and explore the Rubin schedule of observations. \n",
168188
"It provides the facility to interactively query the historical and future schedule from a specified point in time (MJD or ISO) for a number of hours into the future.\n",
169189
"It provides a filter by execution status, e.g. executed or scheduled, and a filter by `target_name`, e.g `low-dust`, `LMC_SMC`, `dusty_plane`.\n",
170190
"\n",
171-
"The Rubin Schedule Viewer runs at the US Data Facility at SLAC and have a publicly accessible user interface at: [https://usdf-rsp.slac.stanford.edu/obsloctap/static/viewer.html](https://usdf-rsp.slac.stanford.edu/obsloctap/static/viewer.html) . "
191+
"The publicly accessible user interface is: [https://usdf-rsp.slac.stanford.edu/obsloctap/static/viewer.html](https://usdf-rsp.slac.stanford.edu/obsloctap/static/viewer.html) . "
172192
]
173193
},
174194
{
175195
"cell_type": "markdown",
176196
"id": "9",
177197
"metadata": {},
178198
"source": [
179-
"Programmatically check the health of the static UI by executing the following cell, and assert that the service must be alive."
199+
"Programmatically check the health of the static UI by executing the following cell, and assert that the static user interface service must be alive."
180200
]
181201
},
182202
{
@@ -186,9 +206,7 @@
186206
"metadata": {},
187207
"outputs": [],
188208
"source": [
189-
"rubin_static_schedule_url = (\n",
190-
" \"https://usdf-rsp.slac.stanford.edu/obsloctap/static/viewer.html\"\n",
191-
")\n",
209+
"rubin_static_schedule_url = obsloctap_url + \"/static/viewer.html\"\n",
192210
"response = requests.get(rubin_static_schedule_url)\n",
193211
"assert response.status_code == 200, f\"request failed with status {response.status_code}\"\n",
194212
"print(f\"Rubin Schedule Viewer at {response.url} is alive.\")"
@@ -201,20 +219,8 @@
201219
"source": [
202220
"### 2.2. Programmatic access\n",
203221
"\n",
204-
"The service’s web page is also accessible programmatically, via ObsLocTAP, allowing users to extract metadata from the Schedule Viewer itself, including links such as the GitHub repository for the service code.\n",
205-
"The Schedule Viewer does not require authentication, which is essential for publicly distributing the observing schedule.\n",
206-
"\n",
207-
"Define the URL of the ObsLocTAP service."
208-
]
209-
},
210-
{
211-
"cell_type": "code",
212-
"execution_count": null,
213-
"id": "13",
214-
"metadata": {},
215-
"outputs": [],
216-
"source": [
217-
"obsloctap_url = \"https://usdf-rsp-dev.slac.stanford.edu/obsloctap\""
222+
"The service is also accessible programmatically, via ObsLocTAP, allowing users to extract metadata from the Schedule Viewer itself, including links such as the GitHub repository for the service code.\n",
223+
"The Schedule Viewer does not require authentication, which is essential for publicly distributing the observing schedule.\n"
218224
]
219225
},
220226
{
@@ -392,7 +398,7 @@
392398
"source": [
393399
"params = {\"time\": \"2\"}\n",
394400
"response = requests.get(schedule_url, params=params)\n",
395-
"expected_url = f\"https://usdf-rsp-dev.slac.stanford.edu/obsloctap/schedule?time={params['time']}\"\n",
401+
"expected_url = f\"{schedule_url}?time={params['time']}\"\n",
396402
"\n",
397403
"assert (response.url == expected_url)\n",
398404
"assert response.status_code == 200, f\"request failed with status {response.status_code}\""
@@ -494,7 +500,7 @@
494500
"source": [
495501
"Times can also be defined with the `astropy` package's `Time` module.\n",
496502
"\n",
497-
"Define `past_time` as October 28 2025, and print it as a Modified Julian Date (MJD)."
503+
"Define `past_time` as October 29 2025, and print it as a Modified Julian Date (MJD)."
498504
]
499505
},
500506
{
@@ -504,7 +510,7 @@
504510
"metadata": {},
505511
"outputs": [],
506512
"source": [
507-
"past_time = (Time(\"2025-10-28 22:00:00\", format=\"iso\", scale=\"utc\")).mjd\n",
513+
"past_time = (Time(\"2025-10-29 22:00:00\", format=\"iso\", scale=\"utc\")).mjd\n",
508514
"print(past_time)"
509515
]
510516
},
@@ -569,7 +575,7 @@
569575
"source": [
570576
"### 4.1. Execution status\n",
571577
"\n",
572-
"Note the values in the \"Execution Status\" field for the night of Oct 28 2025: they are all \"Not Observed\"."
578+
"Note the values in the \"Execution Status\" field for the night of Oct 29 2025: they are all \"Not Observed\"."
573579
]
574580
},
575581
{
@@ -599,7 +605,7 @@
599605
"source": [
600606
"## 5. Analyze a predicted schedule\n",
601607
"\n",
602-
"Use the 24 hours of schedule prediction for Oct 28 2025, which was retrieved in Section 4."
608+
"Use the 24 hours of schedule prediction for Oct 29 2025, which was retrieved in Section 4."
603609
]
604610
},
605611
{
@@ -693,7 +699,7 @@
693699
"histogram = hv.Histogram(\n",
694700
" np.histogram(obs_visit_gap, bins=50), kdims=\"Time Gap\", vdims=\"Counts\"\n",
695701
").opts(\n",
696-
" title=\"Successive planned visit gaps for Oct 28 2025\",\n",
702+
" title=\"Successive planned visit gaps for Oct 29 2025\",\n",
697703
" xlabel=\"Gap (seconds)\",\n",
698704
" ylabel=\"log(Count)\",\n",
699705
" width=600,\n",
@@ -723,7 +729,7 @@
723729
"source": [
724730
"### 5.2. Planned time by target field\n",
725731
"\n",
726-
"Plot curves of the scheduled observation times for each target field that was planned to be observed the night of Oct 28 2025.\n",
732+
"Plot curves of the scheduled observation times for each target field that was planned to be observed the night of Oct 29 2025.\n",
727733
"\n",
728734
"Get unique target names."
729735
]
@@ -874,7 +880,7 @@
874880
" tools=[hover, \"pan\", \"wheel_zoom\", \"box_zoom\", \"reset\", \"save\"],\n",
875881
" xlabel=\"Scheduled Observation Time (MJD)\",\n",
876882
" ylabel=\"Target Name\",\n",
877-
" title=\"Planned observations by target for Oct 28 2025\",\n",
883+
" title=\"Planned observations by target for Oct 29 2025\",\n",
878884
" size=8,\n",
879885
" alpha=0.7,\n",
880886
" legend_position=\"right\",\n",
@@ -891,7 +897,7 @@
891897
"id": "e2583fe5-0c8e-4552-b6bb-041c13c49c32",
892898
"metadata": {},
893899
"source": [
894-
"> **Figure 2:** The time of the planned observation (x-axis) for each of the planned target fields (y-axis), for the night of Oct 28 2025."
900+
"> **Figure 2:** The time of the planned observation (x-axis) for each of the planned target fields (y-axis), for the night of Oct 29 2025."
895901
]
896902
},
897903
{

0 commit comments

Comments
 (0)