Update src/seismic_hazard_forecasting.py
This commit is contained in:
@@ -501,8 +501,7 @@ verbose: {verbose}")
|
||||
grid_y_max = int(ceil(y_max / grid_dim) * grid_dim)
|
||||
grid_y_min = int(floor(y_min / grid_dim) * grid_dim)
|
||||
|
||||
grid_lat_max, grid_lon_max = utm.to_latlon(grid_x_max, grid_y_max, utm_zone_number, utm_zone_letter)
|
||||
grid_lat_min, grid_lon_min = utm.to_latlon(grid_x_min, grid_y_min, utm_zone_number, utm_zone_letter)
|
||||
|
||||
|
||||
# rectangular grid
|
||||
nx = int((grid_x_max - grid_x_min) / grid_dim) + 1
|
||||
@@ -517,6 +516,10 @@ verbose: {verbose}")
|
||||
nx = ny
|
||||
grid_x_max = int(grid_x_min + (nx - 1) * grid_dim)
|
||||
|
||||
# update grid extent in lat/lon
|
||||
grid_lat_max, grid_lon_max = utm.to_latlon(grid_x_max, grid_y_max, utm_zone_number, utm_zone_letter)
|
||||
grid_lat_min, grid_lon_min = utm.to_latlon(grid_x_min, grid_y_min, utm_zone_number, utm_zone_letter)
|
||||
|
||||
# new x and y range
|
||||
x_range = np.linspace(grid_x_min, grid_x_max, nx)
|
||||
y_range = np.linspace(grid_y_min, grid_y_max, ny)
|
||||
@@ -861,8 +864,8 @@ verbose: {verbose}")
|
||||
vmax_hd = np.nanmax(iml_grid_hd)
|
||||
|
||||
# generate image overlay
|
||||
north, south = lat.max(), lat.min() # Latitude range
|
||||
east, west = lon.max(), lon.min() # Longitude range
|
||||
north, south = grid_lat_max, grid_lat_min # Latitude range
|
||||
east, west = grid_lon_max, grid_lon_min # Longitude range
|
||||
bounds = [[south, west], [north, east]]
|
||||
|
||||
map_center = [np.mean([north, south]), np.mean([east, west])]
|
||||
|
||||
Reference in New Issue
Block a user