Skip to content

Commit a6206b9

Browse files
author
field
committed
CONUS-TD test class
1 parent b11b110 commit a6206b9

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package scratch.ned.nshm23;
2+
3+
import java.io.File;
4+
import java.io.IOException;
5+
import java.util.ArrayList;
6+
7+
import org.opensha.sha.earthquake.faultSysSolution.FaultSystemSolution;
8+
import org.opensha.sha.earthquake.faultSysSolution.util.MergedSolutionCreator;
9+
import org.opensha.sha.earthquake.param.HistoricOpenIntervalParam;
10+
import org.opensha.sha.earthquake.param.ProbabilityModelOptions;
11+
import org.opensha.sha.earthquake.param.ProbabilityModelParam;
12+
import org.opensha.sha.earthquake.rupForecastImpl.nshm23.timeDependence.DOLE_SubsectionMapper;
13+
import org.opensha.sha.earthquake.rupForecastImpl.nshm23.timeDependence.DOLE_SubsectionMapper.DOLE_MappingAlgorithm;
14+
15+
import scratch.UCERF3.erf.FaultSystemSolutionERF;
16+
import scratch.ned.nshm23.CEUS_FSS_creator.FaultModelEnum;
17+
18+
public class CONUS_TD_ERF_Demo {
19+
20+
public static void main(String[] args) throws IOException {
21+
22+
23+
// load the fault system solution
24+
// this is NSHM23 ba, download from:
25+
// https://data.opensha.org/ftp/kmilner/markdown/batch_inversions/2024_02_02-nshm23_branches-WUS_FM_v3/results_WUS_FM_v3_branch_averaged_gridded_simplified.zip
26+
FaultSystemSolution conusSol = FaultSystemSolution.load(new File("/Users/field/nshm-haz_data/results_WUS_FM_v3_branch_averaged_gridded_simplified.zip"));
27+
// load DOLE data
28+
DOLE_SubsectionMapper.mapDOLE(conusSol.getRupSet().getFaultSectionDataList(), DOLE_MappingAlgorithm.FULL_PARENT, true); // boolean is for verbose
29+
30+
31+
String nshmModelDirPath = "/Users/field/nshm-haz_data/nshm-conus-6.b.4/";
32+
ArrayList<FaultSystemSolution> ceusSolList = CEUS_FSS_creator.getFaultSystemSolutionList(nshmModelDirPath,CEUS_FSS_creator.FaultModelEnum.PREFERRED);
33+
34+
35+
FaultSystemSolution cascadiaSol = scratch.ned.nshm23.Cascadia_FSS_creator.getFaultSystemSolution(nshmModelDirPath, Cascadia_FSS_creator.FaultModelEnum.MIDDLE);
36+
37+
// if you need to merge multiple solutions, you can use this util:
38+
// it doesn't yet do anything with gridded seismicity
39+
FaultSystemSolution sol = MergedSolutionCreator.merge(conusSol, ceusSolList.get(0), ceusSolList.get(1), cascadiaSol);
40+
// FaultSystemSolution sol = MergedSolutionCreator.merge(conusSol);
41+
42+
System.out.println("DONE with sol");
43+
44+
// ERF
45+
FaultSystemSolutionERF erf = new FaultSystemSolutionERF(sol);
46+
47+
// prob model
48+
erf.setParameter(ProbabilityModelParam.NAME, ProbabilityModelOptions.U3_PREF_BLEND);
49+
erf.setParameter(HistoricOpenIntervalParam.NAME, 2024d-1875d); // or whatever
50+
erf.getTimeSpan().setStartTime(2024);
51+
erf.getTimeSpan().setDuration(50d);
52+
53+
erf.updateForecast();
54+
55+
System.out.println("DONE");
56+
}
57+
58+
}

0 commit comments

Comments
 (0)