Skip to content

Commit

Permalink
tweak exposure with nested lists
Browse files Browse the repository at this point in the history
  • Loading branch information
pothiers committed Oct 15, 2024
1 parent 6098985 commit 43d83d3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 36 deletions.
36 changes: 14 additions & 22 deletions notebooks_tsqr/NightLog.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,20 @@
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"id": "6",
"metadata": {},
"outputs": [],
"source": [
"instrum_str = \", \".join(list(allsrc.exp_src.instruments.keys()))\n",
"md(f\"# Showing data for {min_date.date()} to {max_date.date()} for {instrum_str}\")"
]
},
{
"cell_type": "markdown",
"id": "7",
"metadata": {},
"source": [
"# Table of Contents\n",
"(TODO: update to reflect new content and ordering change)\n",
Expand All @@ -163,17 +174,6 @@
"* [Developer Only](#dev-only)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7",
"metadata": {},
"outputs": [],
"source": [
"instrum_str = \", \".join(list(allsrc.exp_src.instruments.keys()))\n",
"md(f\"# Showing data for {min_date.date()} to {max_date.date()} for {instrum_str}\")"
]
},
{
"cell_type": "markdown",
"id": "8",
Expand Down Expand Up @@ -320,11 +320,7 @@
"cell_type": "code",
"execution_count": null,
"id": "20",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"metadata": {},
"outputs": [],
"source": [
"# Exposure Report\n",
Expand All @@ -344,11 +340,7 @@
"cell_type": "code",
"execution_count": null,
"id": "22",
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"metadata": {},
"outputs": [],
"source": [
"# Narrative Report\n",
Expand Down
20 changes: 6 additions & 14 deletions python/lsst/ts/logging_and_reporting/source_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ def day_table(
self,
datetime_field,
dayobs_field=None,
# row_str_func=None,
zero_message=False,
):
"""Break on TELESCOPE, DATE. Within that only show time."""
Expand Down Expand Up @@ -322,9 +321,9 @@ def telescope(rec):
table.append(f"```\n{msg}\n```")
crew_list = rec.get("observers_crew", [])
crew_str = ", ".join(crew_list)
status = rec.get("telescope_status", "NA")
table.append(f"Telescope Status: *{status}*")
table.append(f"Authors: *{crew_str}*")
status = rec.get("telescope_status", "Not Available")
table.append(f"Telescope Status: {status}")
table.append(f"Authors: {crew_str}")
return table

def OBSOLETE_row_str_func(self, datetime_str, rec): # TODO remove
Expand Down Expand Up @@ -602,13 +601,7 @@ def OBSOLETE_row_str_func(self, datetime_str, rec): # TODO remove
)

# Exposurelog
def day_table(
self,
datetime_field,
dayobs_field=None,
# row_str_func=None,
zero_message=False,
):
def day_table(self, datetime_field, dayobs_field=None, zero_message=False):
"""Break on INSTRUMENT, DATE. Within that only show time."""

def obs_night(rec):
Expand Down Expand Up @@ -642,11 +635,10 @@ def obs_id(rec):
table.append(f"### Instrument: {instrum}")
for obsid, g1 in itertools.groupby(recs, key=obs_id):
recs = list(g1)
attrstr = f"#### {obsid} - {recs[0][datetime_field]}"
table.append(f"{attrstr}\n")
attrstr = f"{obsid} : {recs[0][datetime_field]}"
for rec in recs:
msg = rec["message_text"].strip()
table.append(f"```\n{msg}\n```")
table.append(f"* {attrstr}\n - `{msg}`")
return table

def check_endpoints(self, timeout=None, verbose=True):
Expand Down

0 comments on commit 43d83d3

Please sign in to comment.