Skip to content

Commit

Permalink
protect from no data
Browse files Browse the repository at this point in the history
  • Loading branch information
pothiers committed Oct 8, 2024
1 parent 0df8e06 commit f7da1dc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
27 changes: 19 additions & 8 deletions notebooks_tsqr/NightLog.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@
"# Exposure Tally\n",
"md(f\"## Exposure Tally for all Instruments\")\n",
"tally = await allsrc.night_tally_observation_gaps()\n",
"display(pd.DataFrame(tally))\n",
"if tally:\n",
" display(pd.DataFrame(tally))\n",
"\n",
"# Observation gaps\n",
"gaps = allsrc.exp_src.get_observation_gaps()\n",
Expand All @@ -332,13 +333,23 @@
"id": "17",
"metadata": {},
"outputs": [],
"source": [
"tally"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "18",
"metadata": {},
"outputs": [],
"source": [
"gaps"
]
},
{
"cell_type": "markdown",
"id": "18",
"id": "19",
"metadata": {},
"source": [
"# Narrative Log\n"
Expand All @@ -347,7 +358,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "19",
"id": "20",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -363,15 +374,15 @@
},
{
"cell_type": "markdown",
"id": "20",
"id": "21",
"metadata": {},
"source": [
"# Developer Only Section"
]
},
{
"cell_type": "markdown",
"id": "21",
"id": "22",
"metadata": {},
"source": [
"## Where was this run?\n",
Expand All @@ -387,7 +398,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "22",
"id": "23",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -400,7 +411,7 @@
},
{
"cell_type": "markdown",
"id": "23",
"id": "24",
"metadata": {},
"source": [
"# Finale"
Expand All @@ -409,7 +420,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "24",
"id": "25",
"metadata": {},
"outputs": [],
"source": [
Expand Down
2 changes: 1 addition & 1 deletion python/lsst/ts/logging_and_reporting/all_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def night_tally_observation_gaps(self, verbose=True):
)

if targets.empty:
return dict
return None

num_slews = targets[["slewTime"]].astype(bool).sum(axis=0).squeeze()
total_slew_seconds = targets[["slewTime"]].sum().squeeze()
Expand Down

0 comments on commit f7da1dc

Please sign in to comment.