Skip to content

Commit a450a45

Browse files
author
Leanne Guy
committed
Fix numberings and update some descrition
1 parent 8e0d3ca commit a450a45

1 file changed

Lines changed: 21 additions & 34 deletions

File tree

Commissioning/rubin_schedule_viewer.ipynb

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
"metadata": {},
230230
"outputs": [],
231231
"source": [
232-
"obsloctap_url = \"https://usdf-rsp-dev.slac.stanford.edu/obsloctap\""
232+
"obsloctap_url = \"https://usdf-rsp.slac.stanford.edu/obsloctap\""
233233
]
234234
},
235235
{
@@ -258,7 +258,7 @@
258258
"id": "16",
259259
"metadata": {},
260260
"source": [
261-
"#### 3.3.1. Query the service header information\n"
261+
"#### 3.2.1. Query the service header information"
262262
]
263263
},
264264
{
@@ -283,7 +283,7 @@
283283
"id": "18",
284284
"metadata": {},
285285
"source": [
286-
"## 3.3 Retrieve the Future Schedule \n",
286+
"### 3.3 Retrieve the Future Schedule \n",
287287
"\n",
288288
"Query the Rubin Schedule Service to get the upcoming forecast for up to 24 hours in advance\n",
289289
"\n",
@@ -373,9 +373,9 @@
373373
"id": "27",
374374
"metadata": {},
375375
"source": [
376-
"### 3.3.3 Request only the next 2 hours or predicted schedule\n",
376+
"### 3.3.2 Request only the next 2 hours or predicted schedule\n",
377377
"\n",
378-
"Define a parameter to only retrieve the next X upcoming hours of schedule"
378+
"Define a parameter to retrieve only the next 2 hours of predicted schedule"
379379
]
380380
},
381381
{
@@ -385,11 +385,10 @@
385385
"metadata": {},
386386
"outputs": [],
387387
"source": [
388-
"params = {\"time\": \"5\"}\n",
388+
"params = {\"time\": \"2\"}\n",
389389
"response = requests.get(schedule_url, params=params)\n",
390-
"assert (\n",
391-
" response.url == \"https://usdf-rsp-dev.slac.stanford.edu/obsloctap/schedule?time=5\"\n",
392-
")\n",
390+
"print(response.url)\n",
391+
"assert response.url == \"https://usdf-rsp.slac.stanford.edu/obsloctap/schedule?time=2\"\n",
393392
"assert response.status_code == 200, f\"request failed with status {response.status_code}\""
394393
]
395394
},
@@ -448,31 +447,17 @@
448447
"outputs": [],
449448
"source": [
450449
"next_visits_from_date = response.json()\n",
451-
"print(\n",
452-
" f\"There are/were {len(next_visits_from_date)} visits \\\n",
450+
"print(f\"There are/were {len(next_visits_from_date)} visits \\\n",
453451
"scheduled in the {params[\"time\"]} hour(s) from {params['start']}.\"\n",
454452
")"
455453
]
456454
},
457455
{
458-
"cell_type": "code",
459-
"execution_count": null,
460-
"id": "34",
461-
"metadata": {},
462-
"outputs": [],
463-
"source": [
464-
"past_time = (Time(\"2025-10-28 22:00:00\", format=\"iso\", scale=\"utc\")).mjd\n",
465-
"print(past_time)"
466-
]
467-
},
468-
{
469-
"cell_type": "code",
470-
"execution_count": null,
471-
"id": "35",
456+
"cell_type": "markdown",
457+
"id": "17eece88-1567-4046-b8de-d78e26bb7506",
472458
"metadata": {},
473-
"outputs": [],
474459
"source": [
475-
"params = {\"time\": \"24\", \"start\": past_time}"
460+
"MJD date formats can also be used"
476461
]
477462
},
478463
{
@@ -482,6 +467,8 @@
482467
"metadata": {},
483468
"outputs": [],
484469
"source": [
470+
"past_time = (Time(\"2025-11-09 22:00:00\", format=\"iso\", scale=\"utc\")).mjd\n",
471+
"params = {\"time\": \"24\", \"start\": past_time}\n",
485472
"response = requests.get(schedule_url, params=params)\n",
486473
"assert response.status_code == 200, f\"request failed with status {response.status_code}\"\n",
487474
"print(response.url)"
@@ -544,9 +531,11 @@
544531
"metadata": {},
545532
"outputs": [],
546533
"source": [
547-
"response = requests.get(schedule_url)\n",
534+
"time = (Time(\"2025-11-27 22:00:00\", format=\"iso\", scale=\"utc\")).mjd\n",
535+
"params = {\"time\": \"24\", \"start\": past_time}\n",
536+
"response = requests.get(schedule_url, params=params)\n",
548537
"df = pd.DataFrame(response.json())\n",
549-
"print(f\"There are {len(df)} visits scheduled in the next 24 hours\")"
538+
"print(f\"There are {len(df)} visits scheduled in the 24 hour time period\")"
550539
]
551540
},
552541
{
@@ -573,9 +562,7 @@
573562
" diff = abs(t_planning[i] - t_planning[i + 1]) * 60 * 60 * 24\n",
574563
" if np.isnan(diff):\n",
575564
" continue\n",
576-
" obs_visit_gap.append(diff)\n",
577-
"\n",
578-
"print(f\"Number of differences: {len(obs_visit_gap)}\")"
565+
" obs_visit_gap.append(diff)"
579566
]
580567
},
581568
{
@@ -611,8 +598,8 @@
611598
" title=\"Histogram of successive visit gaps for scheduled observations\",\n",
612599
" xlabel=\"Gap (seconds)\",\n",
613600
" ylabel=\"Count\",\n",
614-
" width=1000,\n",
615-
" height=500,\n",
601+
" width=800,\n",
602+
" height=400,\n",
616603
" line_color=\"steelblue\",\n",
617604
" fill_color=\"lightblue\",\n",
618605
" line_width=1,\n",

0 commit comments

Comments
 (0)