From db3e1e553c8b6d4655389d8b6bf949137d32d2f3 Mon Sep 17 00:00:00 2001 From: Emily Miller Date: Tue, 10 Oct 2023 13:51:38 -0700 Subject: [PATCH 1/3] add sentinel tile --- cyfi/visualize.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cyfi/visualize.py b/cyfi/visualize.py index 590e294..737365f 100644 --- a/cyfi/visualize.py +++ b/cyfi/visualize.py @@ -102,6 +102,7 @@ def plot_image( f"({sample.longitude}, {sample.latitude})", sample.date, sample.imagery_date, + sample.item_id, ) def make_map(): @@ -191,9 +192,12 @@ def make_map(): loc = gr.Textbox(label="Location") date = gr.Textbox(label="Sampling date") days_before_sample = gr.Textbox(label="Satellite imagery date") + tile = gr.Textbox(label="Sentinel-2 tile") data.select( - plot_image, None, [image, density, severity, loc, date, days_before_sample] + plot_image, + None, + [image, density, severity, loc, date, days_before_sample, tile], ) with gr.Row(): From 7e876faa2cab28cba80ecb50a6f081b1afafbff2 Mon Sep 17 00:00:00 2001 From: Emily Miller Date: Tue, 10 Oct 2023 14:03:40 -0700 Subject: [PATCH 2/3] add commas --- cyfi/visualize.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cyfi/visualize.py b/cyfi/visualize.py index 737365f..97f2085 100644 --- a/cyfi/visualize.py +++ b/cyfi/visualize.py @@ -97,7 +97,7 @@ def plot_image( return ( im, - sample.density_cells_per_ml, + f"{sample.density_cells_per_ml:,.0f}", sample.severity, f"({sample.longitude}, {sample.latitude})", sample.date, @@ -167,7 +167,7 @@ def make_map(): "density_cells_per_ml", "severity", ] - ], + ].style.format({"density_cells_per_ml": "{:,.0f}"}), height=200, ) From 3da8d061897b05c608a7b117d0407952ef0091c7 Mon Sep 17 00:00:00 2001 From: Emily Miller Date: Tue, 10 Oct 2023 14:11:03 -0700 Subject: [PATCH 3/3] add comma in hover over --- cyfi/visualize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyfi/visualize.py b/cyfi/visualize.py index 97f2085..7ef8679 100644 --- a/cyfi/visualize.py +++ b/cyfi/visualize.py @@ -121,7 +121,7 @@ def make_map(): mode="markers", marker=dict(size=6, color=map_df.color), hoverinfo="text", - hovertemplate="Sample ID: %{customdata[0]}
Date: %{customdata[1]}
Latitude: %{customdata[2]}
Longitude: %{customdata[3]}
Predicted density: %{customdata[4]}
Predicted severity: %{customdata[5]}", + hovertemplate="Sample ID: %{customdata[0]}
Date: %{customdata[1]}
Latitude: %{customdata[2]}
Longitude: %{customdata[3]}
Predicted density: %{customdata[4]:,.0f}
Predicted severity: %{customdata[5]}", name="", ) )