Skip to content

Commit

Permalink
DM-48131 add time-loss from narrativelog API
Browse files Browse the repository at this point in the history
  • Loading branch information
pothiers committed Dec 27, 2024
1 parent ee641e7 commit 7d16664
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
8 changes: 8 additions & 0 deletions notebooks_tsqr/dashboard.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@
"source": [
"print(f\"Finished {str(datetime.now())}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "13",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
16 changes: 14 additions & 2 deletions python/lsst/ts/logging_and_reporting/all_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,20 @@ def night_tally_observation_gaps(self, verbose=False):
# These need join between exposures and messages.
# But in messages, they aren't reliable numbers anyhow.
# TODO despite unreliability, use messages values.
loss_fault = pd.NA # hours
loss_weather = pd.NA # hours
ltypes = set([r["time_lost_type"] for r in self.nar_src.records])
ltime = defaultdict(int)
for t in ltypes:
for r in self.nar_src.records:
ltime[t] += r["time_lost"]
if "fault" in ltypes:
loss_fault = ltime["fault"] # hours
else:
loss_fault = pd.NA # hours

if "weather" in ltypes:
loss_weather = ltime["weather"] # hours
else:
loss_weather = pd.NA # hours

used_hours = exposure_hours + readout_hours
if pd.notna(slew_hours):
Expand Down

0 comments on commit 7d16664

Please sign in to comment.