Motivation
The engine currently obtains ShakeMap ground motions primarily from grid.xml and uncertainty.xml. The resulting data contain the conditioned median and conditional total standard deviation at each grid point.
The Silva&Horspool implementation then constructs a new covariance matrix by applying spatial and cross-IMT correlation models to those total standard deviations. In particular, the spatial covariance is constructed from shakemap['std'] in hazardlib/shakemap/gmfs.py.
This does not distinguish between within-event and between-event residual components. Consequently, a spatial correlation model calibrated for within-event residuals (Jayaram and Baker, 2009) is effectively applied to the total uncertainty, while the spatially common between-event contribution is not sampled separately. A hardcoded cross-IMT correlation model is also applied to the total residuals.
This was a reasonable approximation when only total ShakeMap uncertainty was available through uncertainty.xml, but modern ShakeMap products provide the information needed for uncertainty component-aware, ShakeMap-consistent realizations.
As opposed to grid.xml and uncertainty.xml, the shake_result.hdf product contains several additional realization bookkeeping for each IMT, including:
C
Sigma_HH_YD
add_uncertainty
sta_per_ix
sta_phi
- station coordinates
These arrays were extended to all IMTs in shakemap-modules 1.1.4 and are described in the source as the information used to reconstruct realizations. See:
Proposed change
Switch to using shake_result.hdf as the preferred source for ShakeMap-based GMF calculations and reconstruct the posterior covariance represented by the information available in the HDF rather than imposing a new correlation structure on the total std grids from uncertainty.xml.
The workflow should:
- Prefer
download/shake_result.hdf when retrieving a ShakeMap by USGS ID.
- Read the conditioned mean and uncertainty components for the requested IMTs.
- Reconstruct the station-conditioned within-event covariance from the recorded correlation model and station bookkeeping.
- Reconstruct the conditional between-event covariance from the saved
C and Sigma_HH_YD factors.
- Generate GMFs around the conditioned ShakeMap mean using the common correlation/sampling machinery used by regular scenario and event-based calculations.
- Use the same correlation model used by ShakeMap for conditioning, normally Loth and Baker (2013), for generating the gmf realizations.
- Preserve the existing XML and NPY inputs as a legacy compatibility path. When correlated realizations are generated from marginal XML uncertainties, document and warn that this is an approximation rather than exact posterior sampling.
Existing oq run, oq engine --run, and oq shakemap2gmfs workflows should continue to function as before.
Backward compatibility
- Current XML and NPY inputs should remain supported.
- Existing uncorrelated or median-only or legacy calculations should retain their current results.
- Scenarios starting from ShakeMaps for new/recent events should be based on
shake_result.hdf
- Older or incomplete products can continue using the legacy xml files or fail clearly when exact posterior sampling is explicitly required.
Relationship to the correlation refactor
This work depends on the common covariance/sampling interfaces and implementation of the Loth and Baker (2013) spatial-cross-IMT implementation proposed in #11230
Motivation
The engine currently obtains ShakeMap ground motions primarily from
grid.xmlanduncertainty.xml. The resulting data contain the conditioned median and conditional total standard deviation at each grid point.The
Silva&Horspoolimplementation then constructs a new covariance matrix by applying spatial and cross-IMT correlation models to those total standard deviations. In particular, the spatial covariance is constructed fromshakemap['std']in hazardlib/shakemap/gmfs.py.This does not distinguish between within-event and between-event residual components. Consequently, a spatial correlation model calibrated for within-event residuals (Jayaram and Baker, 2009) is effectively applied to the total uncertainty, while the spatially common between-event contribution is not sampled separately. A hardcoded cross-IMT correlation model is also applied to the total residuals.
This was a reasonable approximation when only total ShakeMap uncertainty was available through
uncertainty.xml, but modern ShakeMap products provide the information needed for uncertainty component-aware, ShakeMap-consistent realizations.As opposed to
grid.xmlanduncertainty.xml, theshake_result.hdfproduct contains several additional realization bookkeeping for each IMT, including:CSigma_HH_YDadd_uncertaintysta_per_ixsta_phiThese arrays were extended to all IMTs in
shakemap-modules1.1.4 and are described in the source as the information used to reconstruct realizations. See:Proposed change
Switch to using
shake_result.hdfas the preferred source for ShakeMap-based GMF calculations and reconstruct the posterior covariance represented by the information available in the HDF rather than imposing a new correlation structure on the totalstdgrids fromuncertainty.xml.The workflow should:
download/shake_result.hdfwhen retrieving a ShakeMap by USGS ID.CandSigma_HH_YDfactors.Existing
oq run,oq engine --run, andoq shakemap2gmfsworkflows should continue to function as before.Backward compatibility
shake_result.hdfRelationship to the correlation refactor
This work depends on the common covariance/sampling interfaces and implementation of the Loth and Baker (2013) spatial-cross-IMT implementation proposed in #11230