mattritchey commited on
Commit
bccf49f
·
verified ·
1 Parent(s): 11ba6e1

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -11
main.py CHANGED
@@ -17,7 +17,7 @@ app = FastAPI()
17
  #Root endpoints
18
  @app.get("/")
19
  def root():
20
- return {"API": "Hail API 2020"}
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/transform_mrms.pkl', 'rb'))
54
-
55
- row, col = rasterio.transform.rowcol(transform, lon, lat)
56
-
57
- files = [
58
- 'Data/2023_hail.h5',
59
- 'Data/2022_hail.h5',
60
- 'Data/2021_hail.h5',
61
- 'Data/2020_hail.h5'
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