From fe9d886499e12cb97bc52a9abcea60bac04bf5e8 Mon Sep 17 00:00:00 2001 From: ftong Date: Fri, 12 Sep 2025 10:37:03 +0200 Subject: [PATCH] interpolation is always used on the final grid --- src/seismic_hazard_forecasting.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index 257c0f2..ad58232 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -524,22 +524,16 @@ verbose: {verbose}") up_factor = 4 iml_grid_hd = resize(iml_grid_tmp, (up_factor * len(iml_grid_tmp), up_factor * len(iml_grid_tmp)), mode='reflect', anti_aliasing=False) - interp_method = 'bilinear' trim_thresh = vmin iml_grid_hd[iml_grid_hd < trim_thresh] = np.nan else: iml_grid_hd = iml_grid_tmp - interp_method = 'none' iml_grid_hd[iml_grid_hd == 0.0] = np.nan # change zeroes back to nan #vmin_hd = min(x for x in iml_grid_hd.flatten() if not isnan(x)) vmax_hd = max(x for x in iml_grid_hd.flatten() if not isnan(x)) - # trim edges so the grid is not so blocky - #trim_thresh = vmin - #iml_grid_hd[iml_grid_hd < trim_thresh] = np.nan - # generate image overlay north, south = lat.max(), lat.min() # Latitude range east, west = lon.max(), lon.min() # Longitude range @@ -551,7 +545,7 @@ verbose: {verbose}") cmap_name = 'YlOrRd' cmap = plt.get_cmap(cmap_name) fig, ax = plt.subplots(figsize=(6, 6)) - ax.imshow(iml_grid_hd, origin='lower', cmap=cmap, vmin=vmin, vmax=vmax, interpolation=interp_method) + ax.imshow(iml_grid_hd, origin='lower', cmap=cmap, vmin=vmin, vmax=vmax, interpolation='bilinear') ax.axis('off') # Save the figure