Skip to content

Commit

Permalink
DM-48259
Browse files Browse the repository at this point in the history
  • Loading branch information
pothiers committed Dec 23, 2024
1 parent 8e99572 commit cfb8d7a
Show file tree
Hide file tree
Showing 9 changed files with 240 additions and 154 deletions.
95 changes: 69 additions & 26 deletions notebooks_tsqr/ExposureDetail.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"# day_obs values: TODAY, YESTERDAY, YYYY-MM-DD\n",
"# Report on observing nights that start upto but not included this day.\n",
"#!day_obs = '2024-09-25' # Value to use for local testing (usdf)\n",
"day_obs = \"2024-12-05\" # TODO Change to 'YESTERDAY' to test with default before push\n",
"day_obs = \"2024-11-20\" # TODO Change to 'YESTERDAY' to test with default before push\n",
"instrument = \"LSSTComCam\" # LSSTComCam, LATISS, LSSTCam\n",
"observation_reason = \"ALL\"\n",
"observation_type = \"science\" # TODO: \"science\", \"acq\", default=\"ALL\"\n",
Expand All @@ -25,7 +25,11 @@
"cell_type": "code",
"execution_count": null,
"id": "1",
"metadata": {},
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"outputs": [],
"source": [
"# IMPORT everything\n",
Expand Down Expand Up @@ -56,7 +60,11 @@
"cell_type": "code",
"execution_count": null,
"id": "2",
"metadata": {},
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"outputs": [],
"source": [
"# Set default env to \"usdf\" and try before PUSH to repo.\n",
Expand Down Expand Up @@ -84,7 +92,11 @@
"cell_type": "code",
"execution_count": null,
"id": "3",
"metadata": {},
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"outputs": [],
"source": [
"# Normalize Parameters (both explicit Times Squares params, in implicit ones)\n",
Expand Down Expand Up @@ -114,7 +126,7 @@
" min_dayobs=min_day_obs,\n",
" max_dayobs=max_day_obs,\n",
" verbose=False, # TODO change to False before push\n",
" warning=False, # TODO change to True before push\n",
" warning=True, # TODO change to True before push\n",
" limit=5000,\n",
")"
]
Expand All @@ -125,6 +137,16 @@
"id": "5",
"metadata": {},
"outputs": [],
"source": [
"# https://usdf-rsp-dev.slac.stanford.edu/consdb/query"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"metadata": {},
"outputs": [],
"source": [
"if observation_reason:\n",
" md(f\"# Observation Reason: {observation_reason}\")\n",
Expand All @@ -139,43 +161,52 @@
" observation_type=observation_type,\n",
")\n",
"\n",
"md(f\"The number of exposures in this filtered result is {len(df.index)}\")\n",
"md(f\"The number of exposures in this filtered result is {len(df.index)}.\")\n",
"md(\n",
" f\"Exposures cover the day_obs range starting {allsrc.min_dayobs} and ending before {allsrc.max_dayobs}.\"\n",
")\n",
"display(HTML(df.to_html(index=False)))"
]
},
{
"cell_type": "markdown",
"id": "6",
"id": "7",
"metadata": {},
"source": [
"| Symbol | Meaning |\n",
"|:---|:---|\n",
"| <font style=\"background-color:green; color:white; font-size:20px\">&nbsp;G&nbsp;</font>| Good |\n",
"| <font style=\"background-color:yellow; color:black; font-size:20px\">&nbsp;?&nbsp;</font> | Questionable |\n",
"| <font style=\"background-color:red; color:black; font-size:20px\">&nbsp;R&nbsp;</font> | Junk |"
"-----------------"
]
},
{
"cell_type": "markdown",
"id": "7",
"metadata": {},
"id": "8",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"-----------------"
"# Developer Only Section"
]
},
{
"cell_type": "markdown",
"id": "8",
"cell_type": "raw",
"id": "9",
"metadata": {},
"source": [
"# Developer Only Section"
"| Symbol | Meaning |\n",
"|:---|:---|\n",
"| <font style=\"background-color:green; color:white; font-size:20px\">&nbsp;G&nbsp;</font>| Good |\n",
"| <font style=\"background-color:yellow; color:black; font-size:20px\">&nbsp;?&nbsp;</font> | Questionable |\n",
"| <font style=\"background-color:red; color:black; font-size:20px\">&nbsp;R&nbsp;</font> | Junk |"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9",
"metadata": {},
"id": "10",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"outputs": [],
"source": [
"display(params)\n",
Expand All @@ -186,8 +217,12 @@
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"metadata": {},
"id": "11",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"outputs": [],
"source": [
"print({k: len(v) for k, v in allsrc.exp_src.exposures.items()})"
Expand All @@ -196,8 +231,12 @@
{
"cell_type": "code",
"execution_count": null,
"id": "11",
"metadata": {},
"id": "12",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"outputs": [],
"source": [
"allsrc"
Expand All @@ -206,8 +245,12 @@
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"metadata": {},
"id": "13",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"outputs": [],
"source": [
"print(f\"Elapsed time (excluding code import): {timer.toc:.1f} seconds\")\n",
Expand Down
Loading

0 comments on commit cfb8d7a

Please sign in to comment.