|
2 | 2 |
|
3 | 3 | import java.io.File;
|
4 | 4 | import java.io.IOException;
|
| 5 | +import java.text.SimpleDateFormat; |
5 | 6 | import java.util.ArrayList;
|
| 7 | +import java.util.Date; |
6 | 8 | import java.util.List;
|
7 | 9 |
|
| 10 | +import org.opensha.commons.geo.json.Feature; |
8 | 11 | import org.opensha.commons.logicTree.LogicTreeBranch;
|
9 | 12 | import org.opensha.commons.logicTree.LogicTreeLevel;
|
10 | 13 | import org.opensha.commons.logicTree.LogicTreeNode;
|
|
20 | 23 | import org.opensha.sha.earthquake.rupForecastImpl.nshm23.logicTree.NSHM23_U3_HybridLogicTreeBranch;
|
21 | 24 | import org.opensha.sha.earthquake.rupForecastImpl.nshm23.prior2018.NSHM18_FaultModels;
|
22 | 25 | import org.opensha.sha.earthquake.rupForecastImpl.nshm23.prior2018.NSHM18_LogicTreeBranch;
|
| 26 | +import org.opensha.sha.earthquake.rupForecastImpl.nshm23.util.NSHM23_RegionLoader; |
23 | 27 |
|
24 | 28 | import com.google.common.base.Preconditions;
|
25 | 29 |
|
26 | 30 | import scratch.UCERF3.enumTreeBranches.FaultModels;
|
| 31 | +import scratch.ned.nshm23.CEUS_FSS_creator.FaultModelEnum; |
27 | 32 |
|
28 | 33 | public class FakeBALogicTreeGen {
|
29 | 34 |
|
@@ -71,55 +76,55 @@ public static void main(String[] args) throws IOException {
|
71 | 76 | /*
|
72 | 77 | * UCERF3/NSHM18, possibly adding NSHM23 branch averaged
|
73 | 78 | */
|
74 |
| - File inputDir = new File("/home/kevin/OpenSHA/UCERF4/batch_inversions/" |
75 |
| -// + "2022_12_20-nshm23_u3_hybrid_branches-FM3_1-CoulombRupSet-DsrUni-TotNuclRate-NoRed-ThreshAvgIterRelGR"); |
76 |
| -// + "2023_01_25-nshm18_branches-new_scale-NSHM18_WUS_PlusU3_FM_3p1-CoulombRupSet-BRANCH_AVERAGED-TotNuclRate-NoRed-ThreshAvgIterRelGR"); |
77 |
| -// + "2023_04_13-nshm18_branches-new_scale-u3_paleo-NSHM18_WUS_PlusU3_FM_3p1-CoulombRupSet-BRANCH_AVERAGED-TotNuclRate-NoRed-ThreshAvgIterRelGR"); |
78 |
| -// + "2023_04_14-nshm18_branches-wc_94-u3_paleo-NSHM18_WUS_PlusU3_FM_3p1-CoulombRupSet-BRANCH_AVERAGED-TotNuclRate-NoRed-ThreshAvgIterRelGR"); |
79 |
| - + "2023_04_14-nshm23_u3_hybrid_branches-CoulombRupSet-DsrUni-TotNuclRate-NoRed-ThreshAvgIterRelGR"); |
80 |
| -//// LogicTreeLevel<? extends LogicTreeNode> level = NSHM23_U3_HybridLogicTreeBranch.U3_FM; |
81 |
| -//// nodes.add(FaultModels.FM3_1); |
82 |
| -// LogicTreeLevel<? extends LogicTreeNode> level = NSHM18_LogicTreeBranch.FM; |
83 |
| -// nodes.add(NSHM18_FaultModels.NSHM18_WUS_PlusU3_FM_3p1); |
84 |
| -// FaultSystemSolution tmpSol = FaultSystemSolution.load(new File(inputDir, "results_FM3_1_CoulombRupSet_branch_averaged.zip")); |
85 |
| -//// FaultSystemSolution tmpSol = FaultSystemSolution.load(new File(inputDir, "results_NSHM18_WUS_PlusU3_FM_3p1_CoulombRupSet_branch_averaged.zip")); |
86 |
| -//// FaultSystemSolution tmpSol = FaultSystemSolution.load(new File(inputDir, "node_branch_averaged/SegModel_Classic.zip")); |
87 |
| -//// FaultSystemSolution tmpSol = FaultSystemSolution.load(new File(inputDir, "results_FM3_1_CoulombRupSet_NoClassic_branch_averaged.zip")); |
88 |
| -//// tmpSol.setGridSourceProvider(FaultSystemSolution.load(new File("/home/kevin/OpenSHA/UCERF3/rup_sets/modular/FM3_1_branch_averaged.zip")).getGridSourceProvider()); |
89 |
| -// tmpSol.setGridSourceProvider(FaultSystemSolution.load(new File("/data/kevin/nshm23/batch_inversions/" |
| 79 | +// File inputDir = new File("/home/kevin/OpenSHA/UCERF4/batch_inversions/" |
| 80 | +//// + "2022_12_20-nshm23_u3_hybrid_branches-FM3_1-CoulombRupSet-DsrUni-TotNuclRate-NoRed-ThreshAvgIterRelGR"); |
| 81 | +//// + "2023_01_25-nshm18_branches-new_scale-NSHM18_WUS_PlusU3_FM_3p1-CoulombRupSet-BRANCH_AVERAGED-TotNuclRate-NoRed-ThreshAvgIterRelGR"); |
| 82 | +//// + "2023_04_13-nshm18_branches-new_scale-u3_paleo-NSHM18_WUS_PlusU3_FM_3p1-CoulombRupSet-BRANCH_AVERAGED-TotNuclRate-NoRed-ThreshAvgIterRelGR"); |
| 83 | +//// + "2023_04_14-nshm18_branches-wc_94-u3_paleo-NSHM18_WUS_PlusU3_FM_3p1-CoulombRupSet-BRANCH_AVERAGED-TotNuclRate-NoRed-ThreshAvgIterRelGR"); |
| 84 | +// + "2023_04_14-nshm23_u3_hybrid_branches-CoulombRupSet-DsrUni-TotNuclRate-NoRed-ThreshAvgIterRelGR"); |
| 85 | +////// LogicTreeLevel<? extends LogicTreeNode> level = NSHM23_U3_HybridLogicTreeBranch.U3_FM; |
| 86 | +////// nodes.add(FaultModels.FM3_1); |
| 87 | +//// LogicTreeLevel<? extends LogicTreeNode> level = NSHM18_LogicTreeBranch.FM; |
| 88 | +//// nodes.add(NSHM18_FaultModels.NSHM18_WUS_PlusU3_FM_3p1); |
| 89 | +//// FaultSystemSolution tmpSol = FaultSystemSolution.load(new File(inputDir, "results_FM3_1_CoulombRupSet_branch_averaged.zip")); |
| 90 | +////// FaultSystemSolution tmpSol = FaultSystemSolution.load(new File(inputDir, "results_NSHM18_WUS_PlusU3_FM_3p1_CoulombRupSet_branch_averaged.zip")); |
| 91 | +////// FaultSystemSolution tmpSol = FaultSystemSolution.load(new File(inputDir, "node_branch_averaged/SegModel_Classic.zip")); |
| 92 | +////// FaultSystemSolution tmpSol = FaultSystemSolution.load(new File(inputDir, "results_FM3_1_CoulombRupSet_NoClassic_branch_averaged.zip")); |
| 93 | +////// tmpSol.setGridSourceProvider(FaultSystemSolution.load(new File("/home/kevin/OpenSHA/UCERF3/rup_sets/modular/FM3_1_branch_averaged.zip")).getGridSourceProvider()); |
| 94 | +//// tmpSol.setGridSourceProvider(FaultSystemSolution.load(new File("/data/kevin/nshm23/batch_inversions/" |
| 95 | +//// + "2023_09_01-nshm23_branches-mod_pitas_ddw-NSHM23_v2-CoulombRupSet-DsrUni-TotNuclRate-NoRed-ThreshAvgIterRelGR/" |
| 96 | +//// + "results_NSHM23_v2_CoulombRupSet_branch_averaged_gridded.zip")).getGridSourceProvider()); |
| 97 | +//// nodeSols.add(tmpSol); |
| 98 | +////// |
| 99 | +////// SolutionProcessor processor = null; |
| 100 | +//// SolutionProcessor processor = new NSHM23_InvConfigFactory.NSHM23SolProcessor(); |
| 101 | +////// File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only"); |
| 102 | +////// File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only-no_classic"); |
| 103 | +//// File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only-nshm23_gridded"); |
| 104 | +////// File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only-nshm23_gridded-classic_only"); |
| 105 | +// |
| 106 | +// LogicTreeLevel<? extends LogicTreeNode> level = NSHM23_U3_HybridLogicTreeBranch.U3_FM; |
| 107 | +// nodes.add(FaultModels.FM3_1); |
| 108 | +// nodeSols.add(FaultSystemSolution.load(new File(inputDir, "results_FM3_1_CoulombRupSet_branch_averaged.zip"))); |
| 109 | +// nodes.add(FaultModels.FM3_2); |
| 110 | +// nodeSols.add(FaultSystemSolution.load(new File(inputDir, "results_FM3_2_CoulombRupSet_branch_averaged.zip"))); |
| 111 | +// SolutionProcessor processor = null; |
| 112 | +// |
| 113 | +// GridSourceProvider gridProv = FaultSystemSolution.load(new File("/data/kevin/nshm23/batch_inversions/" |
90 | 114 | // + "2023_09_01-nshm23_branches-mod_pitas_ddw-NSHM23_v2-CoulombRupSet-DsrUni-TotNuclRate-NoRed-ThreshAvgIterRelGR/"
|
91 |
| -// + "results_NSHM23_v2_CoulombRupSet_branch_averaged_gridded.zip")).getGridSourceProvider()); |
92 |
| -// nodeSols.add(tmpSol); |
93 |
| -//// |
94 |
| -//// SolutionProcessor processor = null; |
95 |
| -// SolutionProcessor processor = new NSHM23_InvConfigFactory.NSHM23SolProcessor(); |
96 |
| -//// File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only"); |
97 |
| -//// File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only-no_classic"); |
| 115 | +// + "results_NSHM23_v2_CoulombRupSet_branch_averaged_gridded.zip")).getGridSourceProvider(); |
| 116 | +// for (FaultSystemSolution sol : nodeSols) |
| 117 | +// sol.setGridSourceProvider(gridProv); |
98 | 118 | // File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only-nshm23_gridded");
|
99 |
| -//// File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only-nshm23_gridded-classic_only"); |
100 |
| - |
101 |
| - LogicTreeLevel<? extends LogicTreeNode> level = NSHM23_U3_HybridLogicTreeBranch.U3_FM; |
102 |
| - nodes.add(FaultModels.FM3_1); |
103 |
| - nodeSols.add(FaultSystemSolution.load(new File(inputDir, "results_FM3_1_CoulombRupSet_branch_averaged.zip"))); |
104 |
| - nodes.add(FaultModels.FM3_2); |
105 |
| - nodeSols.add(FaultSystemSolution.load(new File(inputDir, "results_FM3_2_CoulombRupSet_branch_averaged.zip"))); |
106 |
| - SolutionProcessor processor = null; |
107 |
| - |
108 |
| - GridSourceProvider gridProv = FaultSystemSolution.load(new File("/data/kevin/nshm23/batch_inversions/" |
109 |
| - + "2023_09_01-nshm23_branches-mod_pitas_ddw-NSHM23_v2-CoulombRupSet-DsrUni-TotNuclRate-NoRed-ThreshAvgIterRelGR/" |
110 |
| - + "results_NSHM23_v2_CoulombRupSet_branch_averaged_gridded.zip")).getGridSourceProvider(); |
111 |
| - for (FaultSystemSolution sol : nodeSols) |
112 |
| - sol.setGridSourceProvider(gridProv); |
113 |
| - File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only-nshm23_gridded"); |
114 |
| - |
115 |
| -// nodeSols.get(0).setGridSourceProvider(FaultSystemSolution.load( |
116 |
| -// new File("/home/kevin/OpenSHA/UCERF3/rup_sets/modular/FM3_1_branch_averaged.zip")).getGridSourceProvider()); |
117 |
| -// nodeSols.get(1).setGridSourceProvider(FaultSystemSolution.load( |
118 |
| -// new File("/home/kevin/OpenSHA/UCERF3/rup_sets/modular/FM3_2_branch_averaged.zip")).getGridSourceProvider()); |
119 |
| -// File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only-u3_gridded"); |
120 |
| - |
121 |
| - Preconditions.checkState(outputDir.exists() || outputDir.mkdir()); |
122 |
| - FileBuilder builder = new SolutionLogicTree.FileBuilder(processor, new File(outputDir, "results.zip")); |
| 119 | +// |
| 120 | +//// nodeSols.get(0).setGridSourceProvider(FaultSystemSolution.load( |
| 121 | +//// new File("/home/kevin/OpenSHA/UCERF3/rup_sets/modular/FM3_1_branch_averaged.zip")).getGridSourceProvider()); |
| 122 | +//// nodeSols.get(1).setGridSourceProvider(FaultSystemSolution.load( |
| 123 | +//// new File("/home/kevin/OpenSHA/UCERF3/rup_sets/modular/FM3_2_branch_averaged.zip")).getGridSourceProvider()); |
| 124 | +//// File outputDir = new File(inputDir.getParentFile(), inputDir.getName()+"-ba_only-u3_gridded"); |
| 125 | +// |
| 126 | +// Preconditions.checkState(outputDir.exists() || outputDir.mkdir()); |
| 127 | +// FileBuilder builder = new SolutionLogicTree.FileBuilder(processor, new File(outputDir, "results.zip")); |
123 | 128 |
|
124 | 129 | /*
|
125 | 130 | * simple branch averaged
|
@@ -160,6 +165,32 @@ public static void main(String[] args) throws IOException {
|
160 | 165 | // Preconditions.checkState(outputDir.exists() || outputDir.mkdir());
|
161 | 166 | // FileBuilder builder = new SolutionLogicTree.FileBuilder(processor, new File(outputDir, "results.zip"));
|
162 | 167 |
|
| 168 | + /* |
| 169 | + * CEUS FSS tests |
| 170 | + */ |
| 171 | + File invsDir = new File("/home/kevin/OpenSHA/UCERF4/batch_inversions/"); |
| 172 | + File inputDir = new File("/data/kevin/nshm23/ceus_converted_fss"); |
| 173 | + LogicTreeLevel<? extends LogicTreeNode> level = NSHM23_LogicTreeBranch.FM; |
| 174 | + nodes.add(NSHM23_FaultModels.NSHM23_v2); |
| 175 | + SolutionProcessor processor = null; |
| 176 | + |
| 177 | +// FaultModelEnum fm = FaultModelEnum.BOTH; |
| 178 | +// FaultModelEnum fm = FaultModelEnum.ALTERNATE; |
| 179 | + FaultModelEnum fm = FaultModelEnum.PREFERRED; |
| 180 | + |
| 181 | +// String dirName = new SimpleDateFormat("yyyy_MM_dd").format(new Date()); |
| 182 | + String dirName = "2023_11_15"; |
| 183 | + dirName += "-ceus_fss-"+fm.name(); |
| 184 | + |
| 185 | + nodeSols.add(FaultSystemSolution.load(new File(inputDir, "sol_"+fm.name()+"_merged.zip"))); |
| 186 | + File outputDir = new File(invsDir, dirName); |
| 187 | + |
| 188 | + Feature.write(NSHM23_RegionLoader.AnalysisRegions.CONUS_EAST.load().toFeature(), |
| 189 | + new File(outputDir, "ceus_region.geojson")); |
| 190 | + |
| 191 | + Preconditions.checkState(outputDir.exists() || outputDir.mkdir()); |
| 192 | + FileBuilder builder = new SolutionLogicTree.FileBuilder(processor, new File(outputDir, "results.zip")); |
| 193 | + |
163 | 194 | for (int i=0; i<nodes.size(); i++) {
|
164 | 195 | LogicTreeNode node = nodes.get(i);
|
165 | 196 | FaultSystemSolution sol = nodeSols.get(i);
|
|
0 commit comments