Spaces:
Running
Running
mattritchey
commited on
Commit
•
fe784e6
1
Parent(s):
f963f41
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,3 @@
|
|
1 |
-
|
2 |
-
|
3 |
import plotly.graph_objects as go
|
4 |
from folium.raster_layers import ImageOverlay
|
5 |
import re
|
@@ -8,7 +6,6 @@ import pickle
|
|
8 |
import h5py
|
9 |
import rasterio
|
10 |
import streamlit as st
|
11 |
-
import os
|
12 |
import branca.colormap as cm
|
13 |
import folium
|
14 |
import numpy as np
|
@@ -39,7 +36,7 @@ def geocode(address):
|
|
39 |
lat, lon = location.latitude, location.longitude
|
40 |
return pd.DataFrame({'Lat': lat, 'Lon': lon}, index=[0])
|
41 |
|
42 |
-
|
43 |
def get_data(row, col, radius=8):
|
44 |
files = [
|
45 |
"data/2023_hail.h5",
|
@@ -75,7 +72,7 @@ def get_data(row, col, radius=8):
|
|
75 |
|
76 |
return df, data_max_2
|
77 |
|
78 |
-
|
79 |
def map_folium(lat, lon, files_dates_selected):
|
80 |
|
81 |
# Create a base map
|
|
|
|
|
|
|
1 |
import plotly.graph_objects as go
|
2 |
from folium.raster_layers import ImageOverlay
|
3 |
import re
|
|
|
6 |
import h5py
|
7 |
import rasterio
|
8 |
import streamlit as st
|
|
|
9 |
import branca.colormap as cm
|
10 |
import folium
|
11 |
import numpy as np
|
|
|
36 |
lat, lon = location.latitude, location.longitude
|
37 |
return pd.DataFrame({'Lat': lat, 'Lon': lon}, index=[0])
|
38 |
|
39 |
+
@st.cache_data
|
40 |
def get_data(row, col, radius=8):
|
41 |
files = [
|
42 |
"data/2023_hail.h5",
|
|
|
72 |
|
73 |
return df, data_max_2
|
74 |
|
75 |
+
@st.cache_data
|
76 |
def map_folium(lat, lon, files_dates_selected):
|
77 |
|
78 |
# Create a base map
|