mattritchey commited on
Commit
99b4a85
·
verified ·
1 Parent(s): 9bd3977

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -5
main.py CHANGED
@@ -37,8 +37,8 @@ def geocode_address(address):
37
 
38
  def get_hail_data(address, start_date, end_date, radius_miles, get_max):
39
 
40
- resolution=1 # mrms 1 and hrrr is 3
41
- radius = int(np.ceil(radius_miles*1.6/resolution))
42
 
43
 
44
  start_date = pd.Timestamp(str(start_date)).strftime('%Y%m%d')
@@ -81,8 +81,8 @@ def get_hail_data(address, start_date, end_date, radius_miles, get_max):
81
 
82
  # Select Data by Date and Radius
83
  dates = dates[date_idx]
84
- data = f['hail'][date_idx, row-radius:row +
85
- radius+1, col-radius:col+radius+1]
86
 
87
  all_data.append(data)
88
  all_dates.append(dates)
@@ -94,7 +94,7 @@ def get_hail_data(address, start_date, end_date, radius_miles, get_max):
94
  data_mat = np.where(data_all < 0, 0, data_all)*0.0393701
95
 
96
  # Get Radius of Data
97
- disk_mask = np.where(disk(radius) == 1, True, False)
98
  data_mat = np.where(disk_mask, data_mat, -1).round(3)
99
 
100
  # Process to DataFrame
 
37
 
38
  def get_hail_data(address, start_date, end_date, radius_miles, get_max):
39
 
40
+ # resolution=1 # mrms 1 and hrrr is 3
41
+ # radius = int(np.ceil(radius_miles*1.6/resolution))
42
 
43
 
44
  start_date = pd.Timestamp(str(start_date)).strftime('%Y%m%d')
 
81
 
82
  # Select Data by Date and Radius
83
  dates = dates[date_idx]
84
+ data = f['hail'][date_idx, row-radius_miles:row +
85
+ radius_miles+1, col-radius_miles:col+radius_miles+1]
86
 
87
  all_data.append(data)
88
  all_dates.append(dates)
 
94
  data_mat = np.where(data_all < 0, 0, data_all)*0.0393701
95
 
96
  # Get Radius of Data
97
+ disk_mask = np.where(disk(radius_miles) == 1, True, False)
98
  data_mat = np.where(disk_mask, data_mat, -1).round(3)
99
 
100
  # Process to DataFrame