From b29c796bb057f2f887dde5fa86012dee1497d9c1 Mon Sep 17 00:00:00 2001 From: Steve Pothier Date: Mon, 11 Nov 2024 15:32:08 -0700 Subject: [PATCH] sort Data Log table rows by field name --- notebooks_tsqr/NightLog.ipynb | 619 +++------------------------------- 1 file changed, 52 insertions(+), 567 deletions(-) diff --git a/notebooks_tsqr/NightLog.ipynb b/notebooks_tsqr/NightLog.ipynb index b4950cb..0702bdf 100644 --- a/notebooks_tsqr/NightLog.ipynb +++ b/notebooks_tsqr/NightLog.ipynb @@ -133,7 +133,7 @@ "NarrativeLogAdapter(server_url='https://usdf-rsp-dev.slac.stanford.edu', max_dayobs='2024-11-11', min_dayobs='2024-11-10', limit=None\n", "Using endpoint='https://usdf-rsp-dev.slac.stanford.edu/narrativelog/messages'\n", "Using url='https://usdf-rsp-dev.slac.stanford.edu/narrativelog/messages?is_human=either&is_valid=true&order_by=-date_added&offset=0&limit=1000&min_date_added=2024-11-10T00%3A00%3A00&max_date_added=2024-11-11T00%3A00%3A00'\n", - "Loaded data from sources in 4.3 seconds\n" + "Loaded data from sources in 4.0 seconds\n" ] } ], @@ -363,80 +363,80 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
(times in UTC)(times in UTC)
Moon Rise2024-11-09 16:37:10.226Moon Rise2024-11-09 16:37:10.226
Moon Set2024-11-10 06:08:59.597Moon Set2024-11-10 06:08:59.597
Moon Illumination60%(% illuminated)Moon Illumination60%(% illuminated)
Astronomical Twilight (morning)2024-11-10 08:11:41.944(-18 degrees)Astronomical Twilight (morning)2024-11-10 08:11:41.944(-18 degrees)
Astronomical Twilight (evening)2024-11-10 00:41:49.376(-18 degrees)Astronomical Twilight (evening)2024-11-10 00:41:49.376(-18 degrees)
Solar Midnight2024-11-10 04:26:45.656Solar Midnight2024-11-10 04:26:45.656
Nautical Twilight (morning)2024-11-10 08:44:04.416(-12 degrees)Nautical Twilight (morning)2024-11-10 08:44:04.416(-12 degrees)
Nautical Twilight (evening)2024-11-10 00:09:26.878(-12 degrees)Nautical Twilight (evening)2024-11-10 00:09:26.878(-12 degrees)
Civil Twilight (morning)2024-11-10 09:15:02.510(-6 degrees)Civil Twilight (morning)2024-11-10 09:15:02.510(-6 degrees)
Civil Twilight (evening)2024-11-09 23:38:28.725(-6 degrees)Civil Twilight (evening)2024-11-09 23:38:28.725(-6 degrees)
Sun Rise2024-11-10 09:45:01.340Sun Rise2024-11-10 09:45:01.340
Sun Set2024-11-09 23:08:29.791Sun Set2024-11-09 23:08:29.791
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1185,515 +1185,8 @@ "output_type": "display_data" } ], - "source": [ - "for instrum in allsrc.exp_src.exposures.keys():\n", - " md(f'**{instrum}: {len(allsrc.exp_src.exposures[instrum])} total exposures**')\n", - " df_dict = allsrc.fields_count_exposure(instrum)\n", - " for field_name,df in df_dict.items():\n", - " if df.empty:\n", - " continue\n", - " print(field_name.title().replace('_',' '))\n", - " display(df)" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "id": "22", - "metadata": {}, - "outputs": [ - { - "data": { - "text/markdown": [ - "Tally exposures with specific values of selected fields" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**LSSTComCamSim: 0 total exposures**" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**LATISS: 0 total exposures**" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**LSSTComCam: 239 total exposures**" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Observation Type\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
acqbiascwfsdarkscience
good00000
questionable00000
junk00000
unknown941081468
total941081468
\n", - "
" - ], - "text/plain": [ - " acq bias cwfs dark science\n", - "good 0 0 0 0 0\n", - "questionable 0 0 0 0 0\n", - "junk 0 0 0 0 0\n", - "unknown 94 10 81 46 8\n", - "total 94 10 81 46 8" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Observation Reason\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
checkingcomcam-usdf-checkoutcomcam_twilight_flatextraextra_alignment_sweep_m2rxextra_alignment_sweep_m2ryextra_best_m2_ryextra_sitcom-826infocusinfocus_alignment_sweep_m2rxinfocus_alignment_sweep_m2ryinfocus_sitcom-826intraintra_alignment_sweep_m2rxintra_alignment_sweep_m2ryintra_best_m2_ryintra_sitcom-826sciencetmacheckout
good0000000000000000000
questionable0000000000000000000
junk0000000000000000000
unknown610873717112371712371811288
total610873717112371712371811288
\n", - "
" - ], - "text/plain": [ - " checking comcam-usdf-checkout comcam_twilight_flat extra \\\n", - "good 0 0 0 0 \n", - "questionable 0 0 0 0 \n", - "junk 0 0 0 0 \n", - "unknown 6 10 87 3 \n", - "total 6 10 87 3 \n", - "\n", - " extra_alignment_sweep_m2rx extra_alignment_sweep_m2ry \\\n", - "good 0 0 \n", - "questionable 0 0 \n", - "junk 0 0 \n", - "unknown 7 17 \n", - "total 7 17 \n", - "\n", - " extra_best_m2_ry extra_sitcom-826 infocus \\\n", - "good 0 0 0 \n", - "questionable 0 0 0 \n", - "junk 0 0 0 \n", - "unknown 1 12 3 \n", - "total 1 12 3 \n", - "\n", - " infocus_alignment_sweep_m2rx infocus_alignment_sweep_m2ry \\\n", - "good 0 0 \n", - "questionable 0 0 \n", - "junk 0 0 \n", - "unknown 7 17 \n", - "total 7 17 \n", - "\n", - " infocus_sitcom-826 intra intra_alignment_sweep_m2rx \\\n", - "good 0 0 0 \n", - "questionable 0 0 0 \n", - "junk 0 0 0 \n", - "unknown 12 3 7 \n", - "total 12 3 7 \n", - "\n", - " intra_alignment_sweep_m2ry intra_best_m2_ry intra_sitcom-826 \\\n", - "good 0 0 0 \n", - "questionable 0 0 0 \n", - "junk 0 0 0 \n", - "unknown 18 1 12 \n", - "total 18 1 12 \n", - "\n", - " science tmacheckout \n", - "good 0 0 \n", - "questionable 0 0 \n", - "junk 0 0 \n", - "unknown 8 8 \n", - "total 8 8 " - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Science Program\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
BLOCK-T215BLOCK-T246BLOCK-T248BLOCK-T249BLOCK-T250BLOCK-T279BLOCK-T92PP-SURVEY
good00000000
questionable00000000
junk00000000
unknown8710171169828
total8710171169828
\n", - "
" - ], - "text/plain": [ - " BLOCK-T215 BLOCK-T246 BLOCK-T248 BLOCK-T249 BLOCK-T250 \\\n", - "good 0 0 0 0 0 \n", - "questionable 0 0 0 0 0 \n", - "junk 0 0 0 0 0 \n", - "unknown 87 10 17 11 6 \n", - "total 87 10 17 11 6 \n", - "\n", - " BLOCK-T279 BLOCK-T92 PP-SURVEY \n", - "good 0 0 0 \n", - "questionable 0 0 0 \n", - "junk 0 0 0 \n", - "unknown 98 2 8 \n", - "total 98 2 8 " - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/markdown": [ - "**LSSTCam: 0 total exposures**" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], "source": [ "# Exposure Report\n", - "md(\"Tally exposures with specific values of selected fields\")\n", - "\n", "for instrum in allsrc.exp_src.exposures.keys():\n", " md(f'**{instrum}: {len(allsrc.exp_src.exposures[instrum])} total exposures**')\n", " df_dict = allsrc.fields_count_exposure(instrum)\n", @@ -1701,15 +1194,7 @@ " if df.empty:\n", " continue\n", " print(field_name.title().replace('_',' '))\n", - " display(df.T)" - ] - }, - { - "cell_type": "markdown", - "id": "261925dc-1171-4429-b6a8-3bf62d71904f", - "metadata": {}, - "source": [ - "Note: *Added counts of Exposures with messages*" + " display(df)" ] }, { @@ -1722,7 +1207,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 14, "id": "26", "metadata": { "editable": true, @@ -4822,7 +4307,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 15, "id": "6e220d29-aac6-4d70-80e2-7dd3ef99944c", "metadata": { "jupyter": { @@ -4886,7 +4371,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 16, "id": "b076e98a-44a2-437c-9342-a180fe2cd829", "metadata": { "jupyter": { @@ -4996,7 +4481,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 17, "id": "39", "metadata": { "jupyter": { @@ -5051,7 +4536,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 18, "id": "42", "metadata": { "jupyter": { @@ -5188,7 +4673,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 19, "id": "43", "metadata": { "jupyter": { @@ -5220,7 +4705,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 20, "id": "24", "metadata": {}, "outputs": [ @@ -5264,7 +4749,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 21, "id": "45", "metadata": { "jupyter": { @@ -5276,7 +4761,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Finished 2024-11-11 22:30:07.230753\n" + "Finished 2024-11-11 22:31:53.852033\n" ] } ],