Spaces:
Sleeping
Sleeping
mattritchey
commited on
Update main.py
Browse files
main.py
CHANGED
@@ -17,7 +17,7 @@ app = FastAPI()
|
|
17 |
#Root endpoints
|
18 |
@app.get("/")
|
19 |
def root():
|
20 |
-
return {"API": "
|
21 |
|
22 |
def geocode_address(address):
|
23 |
|
@@ -50,16 +50,15 @@ def get_hail_data(address, start_date, end_date, radius_miles, get_max):
|
|
50 |
lat, lon= geocode_address(address)
|
51 |
|
52 |
# Convert Lat Lon to row & col on Array
|
53 |
-
transform = pickle.load(open('Data/
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
files = [
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
]
|
63 |
|
64 |
files_choosen = [i for i in files if any(i for j in years if str(j) in i)]
|
65 |
|
|
|
17 |
#Root endpoints
|
18 |
@app.get("/")
|
19 |
def root():
|
20 |
+
return {"API": "ACPC HRRR"}
|
21 |
|
22 |
def geocode_address(address):
|
23 |
|
|
|
50 |
lat, lon= geocode_address(address)
|
51 |
|
52 |
# Convert Lat Lon to row & col on Array
|
53 |
+
transform = pickle.load(open('Data/hrrr_crs.pkl', 'rb'))
|
54 |
+
row, col = rasterio.transform.rowcol(transform['affine'], lon, lat)
|
55 |
+
|
56 |
+
|
57 |
+
files = ["Data/APCP_2024_hrrr_v2.h5",
|
58 |
+
"Data/APCP_2020_hrrr_v3.h5",
|
59 |
+
"Data/APCP_2021_hrrr_3.h5",
|
60 |
+
"Data/APCP_2022_hrrr_v2.h5",
|
61 |
+
"Data/APCP_2023_hrrr_v2c.h5"]
|
|
|
62 |
|
63 |
files_choosen = [i for i in files if any(i for j in years if str(j) in i)]
|
64 |
|