Skip to content

Commit 3b2e8a5

Browse files
Merge pull request #466 from pmpowers-usgs/pgv-ngae-seed
NGA-East seed tree updated to use conditional pgv
2 parents ba0082b + 395baa5 commit 3b2e8a5

1 file changed

Lines changed: 33 additions & 5 deletions

File tree

src/gov/usgs/earthquake/nshmp/gmm/NgaEastUsgs_2017.java

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
import java.io.IOException;
1717
import java.nio.charset.StandardCharsets;
1818
import java.util.ArrayList;
19+
import java.util.EnumSet;
1920
import java.util.List;
2021
import java.util.Map;
22+
import java.util.Set;
2123
import java.util.stream.Collectors;
2224

2325
import com.google.common.annotations.Beta;
@@ -424,13 +426,27 @@ public MultiScalarGroundMotion calc(GmmInput in) {
424426
* based; SP16 is added to the median ground motion array last. NOTE that the
425427
* model ignores the SP16 aleatory variability model for consistency with the
426428
* other seed models.
429+
*
430+
* PGV: rather than use averaged tables for seed that don't provide PGV tables
431+
* (inital implementation), we delegate to UsgsPgvSupport. This requires quick
432+
* short circuiting of those Gmms lacking support. In doing so we use the
433+
* individual seed models which results in repeated position lookups. Needs
434+
* improvement TODO. Both sigma models considered include coefficients for
435+
* PGV.
427436
*/
428437
static class UsgsSeeds extends NgaEastUsgs_2017 {
429438
static final String NAME = "NGA-East Updated Seed Tree";
430439
static final String SP16_ID = "SP16";
440+
static final Set<Gmm> noPgvSeeds = EnumSet.of(
441+
Gmm.NGA_EAST_SEED_PEER_GP,
442+
Gmm.NGA_EAST_SEED_GRAIZER16,
443+
Gmm.NGA_EAST_SEED_GRAIZER17,
444+
Gmm.NGA_EAST_SEED_PZCT15_M1SS,
445+
Gmm.NGA_EAST_SEED_PZCT15_M2ES);
431446

432447
/* ids for table based models only; skips SP16 */
433448
static final List<String> ids;
449+
static final List<Gmm> enumIds; // pgv helper
434450
/* includes SP16 as last entry */
435451
static final double[] weights;
436452

@@ -450,6 +466,10 @@ static class UsgsSeeds extends NgaEastUsgs_2017 {
450466
.addAll(wtList)
451467
.add(USGS_SEED_WEIGHTS.get(SP16_ID))
452468
.build());
469+
enumIds = ids.stream()
470+
.map(id -> "NGA_EAST_SEED_" + id.toUpperCase())
471+
.map(Gmm::valueOf)
472+
.collect(Collectors.toList());
453473
}
454474

455475
UsgsSeeds(Imt imt) {
@@ -464,12 +484,20 @@ static class UsgsSeeds extends NgaEastUsgs_2017 {
464484
public MultiScalarGroundMotion calc(GmmInput in) {
465485
Position p = tables[0].position(in.rRup, in.Mw);
466486
int seedCount = ids.size();
467-
double[] μs = new double[seedCount + 1];
487+
double[] μs = new double[seedCount + 1]; // +1 for SP_16
468488
for (int i = 0; i < ids.size(); i++) {
469-
double μ = tables[i].get(p);
470-
double μPga = exp(pgaTables[i].get(p));
471-
SiteAmp.Value fSite = siteAmp.calc(μPga, in.vs30);
472-
μs[i] = fSite.apply(μ);
489+
Gmm seed = enumIds.get(i);
490+
double μ;
491+
if (imt == Imt.PGV && noPgvSeeds.contains(seed)) {
492+
// site will be considered when using individual seed
493+
μ = UsgsPgvSupport.calcAB20Pgv(seed, in).mean();
494+
} else {
495+
double μRock = tables[i].get(p);
496+
double μPga = exp(pgaTables[i].get(p));
497+
SiteAmp.Value fSite = siteAmp.calc(μPga, in.vs30);
498+
μ = fSite.apply(μRock);
499+
}
500+
μs[i] = μ;
473501
}
474502
/* add SP16; already includes NGA-East site amp */
475503
μs[seedCount] = sp16.calc(in).mean();

0 commit comments

Comments
 (0)