mattritchey commited on
Commit
1852263
1 Parent(s): 2789c69

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -6
app.py CHANGED
@@ -81,15 +81,23 @@ def get_data(row, col, radius):
81
  return df, data_max_2
82
 
83
 
 
 
 
 
 
 
 
 
 
 
84
  def lat_lon_to_row_col(lat, lon):
85
  crs_dic = pickle.load(open('data/hrrr_crs.pkl', 'rb'))
86
- transform = crs_dic['affine']
87
- trans_rtma = crs_dic['proj_4326']
88
- lon_rtma, lat_rtma = trans_rtma.transform(lon, lat)
 
89
 
90
- row, col = rasterio.transform.rowcol(transform, lon_rtma, lat_rtma)
91
- row, col = int(row), int(col)
92
- return row, col
93
 
94
 
95
  def map_folium(lat, lon, files_dates_selected, actual_point, max_point):
 
81
  return df, data_max_2
82
 
83
 
84
+ # def lat_lon_to_row_col(lat, lon):
85
+ # crs_dic = pickle.load(open('data/hrrr_crs.pkl', 'rb'))
86
+ # transform = crs_dic['affine']
87
+ # trans_rtma = crs_dic['proj_4326']
88
+ # lon_rtma, lat_rtma = trans_rtma.transform(lon, lat)
89
+
90
+ # row, col = rasterio.transform.rowcol(transform, lon_rtma, lat_rtma)
91
+ # row, col = int(row), int(col)
92
+ # return row, col
93
+
94
  def lat_lon_to_row_col(lat, lon):
95
  crs_dic = pickle.load(open('data/hrrr_crs.pkl', 'rb'))
96
+ lon_hrrr, lat_hrrr = crs_dic['proj_4326'].transform(lon, lat)
97
+ row, col = rasterio.transform.rowcol(crs_dic['affine'], lon_hrrr, lat_hrrr)
98
+ return int(row), int(col)
99
+
100
 
 
 
 
101
 
102
 
103
  def map_folium(lat, lon, files_dates_selected, actual_point, max_point):