Skip to content

Commit

Permalink
First play content
Browse files Browse the repository at this point in the history
  • Loading branch information
ehneilsen committed Feb 14, 2024
1 parent 6c94074 commit 975f5f3
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 2 deletions.
101 changes: 99 additions & 2 deletions prenight/prenight.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,110 @@
"id": "78a0ef72-3c8c-482c-a91e-caff394de59c",
"metadata": {},
"source": [
"# Prenight briefing test"
"# Prenight Briefing"
]
},
{
"cell_type": "markdown",
"id": "e62944f7-3180-4018-bd4f-1ced0b25f117",
"metadata": {},
"source": [
"This is presently just a playground for building a pre-night briefing."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1443b550-9836-495b-8f95-3a3d85d72372",
"metadata": {},
"outputs": [],
"source": [
"# This cell is only for setting parameter defaults\n",
"day_obs = \"2025-05-01\""
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "08317287-76ce-4918-9852-9b0544c81164",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import bokeh\n",
"import bokeh.io\n",
"import bokeh.plotting\n",
"import bokeh.models\n",
"import sqlite3\n",
"import numpy as np\n",
"from astropy.time import Time\n",
"from lsst.resources import ResourcePath"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ead64dfd-8c37-4380-8cd8-c14a07ab4e8b",
"metadata": {},
"outputs": [],
"source": [
"bokeh.io.output_notebook()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b8cab2ac-4a4c-41e5-b0eb-3226f45532ca",
"metadata": {},
"outputs": [],
"source": [
"baseline_opsim_rp = ResourcePath('/sdf/group/rubin/web_data/sim-data/sims_featureScheduler_runs3.4/baseline/baseline_v3.4_10yrs.db')\n",
"day_obs_mjd = int(Time(day_obs).mjd)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f7aa1d15-c064-44eb-ab5f-9c72eb52ae52",
"metadata": {},
"outputs": [],
"source": [
"with baseline_opsim_rp.as_local() as local_baseline_opsim_rp:\n",
" with sqlite3.connect(local_baseline_opsim_rp.ospath) as baseline_db_connection:\n",
" visits = pd.read_sql_query(f\"SELECT * FROM observations WHERE FLOOR(observationStartMJD-0.5)={day_obs_mjd}\", baseline_db_connection)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5fa45fce-be7e-4deb-84c9-9515960b49d1",
"metadata": {},
"outputs": [],
"source": [
"visits['fieldSPD'] = visits['fieldDec'] + 90"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e860fc22-4c3d-4759-a8f6-bb622b93849b",
"metadata": {},
"outputs": [],
"source": [
"p = bokeh.plotting.figure(x_axis_type=None, y_axis_type=None,)\n",
"polar_transform = bokeh.models.PolarTransform(\n",
" angle='fieldRA',\n",
" angle_units='deg',\n",
" radius='fieldSPD'\n",
")\n",
"p.circle(polar_transform.x, polar_transform.y, source=visits)\n",
"bokeh.plotting.show(p)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f24fcc62-1538-41b3-9b30-1ff2d0691d39",
"id": "d1a1d2fe-eb94-49c2-9e72-a2acc32a1c62",
"metadata": {},
"outputs": [],
"source": []
Expand Down
10 changes: 10 additions & 0 deletions prenight/prenight.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: prenight
description: Pre-night briefing
authors:
- name: Eric H. Neilsen, Jr.
slack: neilsen
paramaters:
day_obs:
type: string
description: Date of observation (YYYY-MM-DD)
default: "2025-05-01"

0 comments on commit 975f5f3

Please sign in to comment.