Spaces:
Sleeping
Sleeping
mattritchey
commited on
Commit
•
b52bc3a
1
Parent(s):
d091265
Update main.py
Browse files
main.py
CHANGED
@@ -46,15 +46,20 @@ def get_data(address, start_date, end_date, radius_miles, get_max):
|
|
46 |
|
47 |
if len(years) == 0:
|
48 |
years = [pd.Timestamp(start_date).year]
|
49 |
-
|
50 |
-
# Geocode Address
|
51 |
-
lat, lon= geocode_address(address)
|
52 |
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
# Convert Lat Lon to row & col on Array
|
55 |
-
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
58 |
|
59 |
# files = [
|
60 |
# # 'Data/APCP_2024_hrrr_v2.h5',
|
|
|
46 |
|
47 |
if len(years) == 0:
|
48 |
years = [pd.Timestamp(start_date).year]
|
|
|
|
|
|
|
49 |
|
50 |
+
# Geocode Address
|
51 |
+
try:
|
52 |
+
lat, lon= geocode_address(address)
|
53 |
+
except:
|
54 |
+
lat, lon=None, None
|
55 |
|
56 |
# Convert Lat Lon to row & col on Array
|
57 |
+
try:
|
58 |
+
transform = pickle.load(open('Data/hrrr_crs.pkl', 'rb'))
|
59 |
+
row, col = rasterio.transform.rowcol(transform['affine'], lon, lat)
|
60 |
+
except:
|
61 |
+
transform =row=col=None
|
62 |
+
|
63 |
|
64 |
# files = [
|
65 |
# # 'Data/APCP_2024_hrrr_v2.h5',
|