Skip to content

Commit 91e181d

Browse files
committed
ensure ints
1 parent e3fa4da commit 91e181d

File tree

1 file changed

+44
-33
lines changed

1 file changed

+44
-33
lines changed

prenight/run_sim.ipynb

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"id": "1a3d4bff-443a-4cb9-9342-09f059bed6df",
2020
"metadata": {},
2121
"source": [
22-
"# Run simulation for {params.day_obs} "
22+
"# Run simulation for {{ params.day_obs }}"
2323
]
2424
},
2525
{
@@ -191,6 +191,17 @@
191191
"#%load_ext memory_profiler"
192192
]
193193
},
194+
{
195+
"cell_type": "code",
196+
"execution_count": null,
197+
"id": "52639da3-457d-4bc2-8dd8-f0a06b59f526",
198+
"metadata": {},
199+
"outputs": [],
200+
"source": [
201+
"day_obs = int(day_obs)\n",
202+
"sim_nights = int(sim_nights)"
203+
]
204+
},
194205
{
195206
"cell_type": "code",
196207
"execution_count": null,
@@ -863,44 +874,44 @@
863874
"metadata": {},
864875
"outputs": [],
865876
"source": [
866-
"# # schedview is noisy with warnings about things we don't need here \n",
867-
"# # Make a spinny globe armillary sphere map of the simulated visits\n",
868-
"# if sim_nights < 3:\n",
869-
"# with warnings.catch_warnings(record=True) as w:\n",
870-
"# warnings.simplefilter(\"always\") \n",
877+
"# schedview is noisy with warnings about things we don't need here \n",
878+
"# Make a spinny globe armillary sphere map of the simulated visits\n",
879+
"if sim_nights < 3:\n",
880+
" with warnings.catch_warnings(record=True) as w:\n",
881+
" warnings.simplefilter(\"always\") \n",
871882
" \n",
872-
"# from schedview.compute.visits import add_coords_tuple\n",
873-
"# from schedview.plot.visitmap import create_visit_skymaps\n",
874-
"# from schedview.collect.visits import NIGHT_STACKERS\n",
875-
"# from schedview import DayObs\n",
876-
"# import bokeh.io\n",
877-
"# from bokeh.plotting import output_file\n",
883+
" from schedview.compute.visits import add_coords_tuple\n",
884+
" from schedview.plot.visitmap import create_visit_skymaps\n",
885+
" from schedview.collect.visits import NIGHT_STACKERS\n",
886+
" from schedview import DayObs\n",
887+
" import bokeh.io\n",
888+
" from bokeh.plotting import output_file\n",
878889
"\n",
879-
"# bokeh.io.output_notebook(hide_banner=True)\n",
880-
"# timezone = \"Chile/Continental\"\n",
890+
" bokeh.io.output_notebook(hide_banner=True)\n",
891+
" timezone = \"Chile/Continental\"\n",
881892
" \n",
882-
"# oo = SchemaConverter().obs2opsim(observations).to_records()\n",
883-
"# for stacker in NIGHT_STACKERS:\n",
884-
"# oo = stacker.run(oo)\n",
885-
"# od = pd.DataFrame(oo)\n",
893+
" oo = SchemaConverter().obs2opsim(observations).to_records()\n",
894+
" for stacker in NIGHT_STACKERS:\n",
895+
" oo = stacker.run(oo)\n",
896+
" od = pd.DataFrame(oo)\n",
886897
" \n",
887898
" \n",
888-
"# print(f\"SIMULATION for {day_obs}\")\n",
899+
" print(f\"SIMULATION for {day_obs}\")\n",
889900
" \n",
890-
"# if len(od):\n",
891-
"# od = add_coords_tuple(od)\n",
892-
"# vmap, vmap_data = create_visit_skymaps(\n",
893-
"# visits=od,\n",
894-
"# night_date=DayObs.from_date(day_obs).date,\n",
895-
"# timezone=timezone,\n",
896-
"# observatory=observatory,\n",
897-
"# )\n",
898-
"# bokeh.io.show(vmap)\n",
899-
"# # this would let you make a little stand-alone html map\n",
900-
"# # output_file(\"sim_visit.html\")\n",
901-
"# # bokeh.io.save(vmap)\n",
902-
"# else:\n",
903-
"# print(\"No visits\")"
901+
" if len(od):\n",
902+
" od = add_coords_tuple(od)\n",
903+
" vmap, vmap_data = create_visit_skymaps(\n",
904+
" visits=od,\n",
905+
" night_date=DayObs.from_date(day_obs).date,\n",
906+
" timezone=timezone,\n",
907+
" observatory=observatory,\n",
908+
" )\n",
909+
" bokeh.io.show(vmap)\n",
910+
" # this would let you make a little stand-alone html map\n",
911+
" # output_file(\"sim_visit.html\")\n",
912+
" # bokeh.io.save(vmap)\n",
913+
" else:\n",
914+
" print(\"No visits\")"
904915
]
905916
},
906917
{

0 commit comments

Comments
 (0)