From 72dc427a0ea79aed0b4bd6221f93d5669028e5b3 Mon Sep 17 00:00:00 2001 From: ftong <95+ftong@noreply.example.org> Date: Tue, 23 Jun 2026 10:56:54 +0200 Subject: [PATCH] Update src/seismic_hazard_forecasting.py --- src/seismic_hazard_forecasting.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index ea718d4..b6d2daf 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -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])]