Proposed implementation notes... a GMM without native PGV support can implement the UsgsPgv calculator (set a private flag? e.g. pgvCalculatorIsSupported = true; or detect dummy PGV coefficients == 0?):
If imt is PGV and pgvCalculatorIsSupported { // initialize UsgsPgv calculator UsgsPgv usgsPgv = new UsgsPgv( Mw, rRup ); /* package up the following in UsgsPgv instead of each individual Gmm? */ // get Tpgv to calculate GM double pgvT = usgsPgv.TPgv; // get range of bounding Imts Range<Imt> imtBounds = Imt.fromPeriodtoRange(pgvT); // see next proposal //... detect if pgvT 'fuzzyEquals' an Imt... Imt.fromPeriod() for direct calc() rather than // interpolatedGmm... // as long as imtBounds has been set correctly (pgvT not equal any IMT), then: private final GroundMotionModel interpolatedGmm = new InterpolatedGmm(subtype, pgvT, imtBounds) // ??? Alternate form of InterpolatedGmm? (see next proposal) --------> double // interpolate calcMean for bounding Ts //final GmmInput in; ScalarGroundMotion psa = interpolatedGmm.calc(in) // compute PGV ScalarGroundMotion pgv = usgsPgv.calcPGV(psa)}
, in seconds, return bounding Imts as Range<Imt> for use in INTERPOLATED_IMTS, which, instead of Map<Imt, Range<Imt>>, could be Map<Double<T>, Range<Imt>>, throwing an error if
T_{PGV}
is outside the range of SA Imts (run fromPeriod first to determine if target T has an 'exact' match Imt?):
public static Range<Imt> fromPeriodToRange(double targetPeriod) { boolean lowerFound = false; for (Imt imt : Imt.values()) { if (imt.name().startsWith("SA") { if (!lowerFound && saPeriod <= targetPeriod) { lowerImt = imt; continue; } if (lowerFound && saPeriod > targetPeriod) { upperImt = imt; return Range.closed(lowerImt, upperImt); } } } // error checking...}
this requires(???) alternate form for InterpolatedGmm():
// current:InterpolatedGmm(Gmm gmm, Imt targetImt, Range<Imt> imtRange) {...} // may need to modify checkArgument(imtRange.contains(targetImt)) ???`// alternate:InterpolatedGmm(Gmm gmm, double targetPeriod, Range<Imt> imtRange) {...}
method to obtain rangeImt bracketing TPgv should operate on subset of IMTs supported by gmm
(future) if the number of available IMTs for the gmm is less than some threshold, alternatively use the coefficients for the PGA-based or PSA(T=1)-based models for PGV