From 3d4f9138d73a34054dfc33327a43310c35c4a7b3 Mon Sep 17 00:00:00 2001 From: ftong <95+ftong@noreply.example.org> Date: Mon, 22 Jun 2026 19:23:13 +0200 Subject: [PATCH] Update src/seismic_hazard_forecasting.py fix attempt 2 --- src/seismic_hazard_forecasting.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/seismic_hazard_forecasting.py b/src/seismic_hazard_forecasting.py index c3b0426..1b7880e 100644 --- a/src/seismic_hazard_forecasting.py +++ b/src/seismic_hazard_forecasting.py @@ -803,6 +803,19 @@ verbose: {verbose}") iml_grid_prep = iml_grid.copy() # temp ground motion grids if use_AOI: + + for j in range(0, len(products)): + # Reassemble the grid cleanly using the original shape + # Initialize a flat array filled entirely with NaNs + iml_grid_flat = np.full(num_points, np.nan, dtype=np.float64) + + # Assign the computed values to their exact original 1D index positions + iml_grid_flat[indices_filtered] = iml_grid_raw[j] + + # Reshape back using the exact shape of your original xx/yy grids + iml_grid_prep[j] = iml_grid_flat.reshape(grid_shape) + + for i in indices: if i in indices_filtered: for j in range(0, len(products)):