From 36a8f338f0bd4b0367785d128ce91ae3fff9a767 Mon Sep 17 00:00:00 2001 From: Kevin Milner Date: Thu, 12 Dec 2024 14:39:36 -0800 Subject: [PATCH] new prvi runs and plot updates --- .../BranchAveragedHazardScriptWriter.java | 44 +++++++++---------- .../prvi25/figures/CombinedMFDsPlot.java | 4 +- .../MultiTectonicParticipationMap.java | 32 ++++++++++++-- .../ProxyFaultRepresentationFigures.java | 6 ++- .../prvi25/figures/SeismicityPDFFigures.java | 8 ++-- 5 files changed, 59 insertions(+), 35 deletions(-) diff --git a/src/main/java/scratch/kevin/nshm23/BranchAveragedHazardScriptWriter.java b/src/main/java/scratch/kevin/nshm23/BranchAveragedHazardScriptWriter.java index a2b69f1..989be64 100644 --- a/src/main/java/scratch/kevin/nshm23/BranchAveragedHazardScriptWriter.java +++ b/src/main/java/scratch/kevin/nshm23/BranchAveragedHazardScriptWriter.java @@ -32,6 +32,7 @@ public static void main(String[] args) throws IOException { boolean linkFromBase = true; Double vs30 = null; + Double sigmaTrunc = null; double gridSpacing = 0.1; boolean supersample = false; @@ -62,9 +63,6 @@ public static void main(String[] args) throws IOException { /* * PRVI */ -// String baseDirName = "2024_07_31-prvi25_subduction_branches"; -// String baseDirName = "2024_10_24-prvi25_crustal_subduction_combined_branches"; - // region = PRVI25_RegionLoader.loadPRVI_ModelBroad(); region = PRVI25_RegionLoader.loadPRVI_MapExtents(); gridSpacing = 0.01; @@ -72,32 +70,30 @@ public static void main(String[] args) throws IOException { gmms = new AttenRelRef[] { AttenRelRef.USGS_PRVI_ACTIVE, AttenRelRef.USGS_PRVI_INTERFACE, AttenRelRef.USGS_PRVI_SLAB }; periods = new double[] { 0d, 0.2d, 1d, 5d }; supersample = true; + sigmaTrunc = 3d; -// String suffix = "ba_only-LARGE"; -// String solFileName = "results_PRVI_SUB_FM_LARGE_branch_averaged_gridded.zip"; - -// String suffix = "ba_only-LARGE-true_pt_src"; -// String solFileName = "results_PRVI_SUB_FM_LARGE_branch_averaged_gridded.zip"; - -// String baseDirName = "2024_12_12-prvi25_crustal_subduction_combined_branches"; -// String suffix = "ba_only"; -// String solFileName = "combined_branch_averaged_solution.zip"; + String baseDirName = "2024_12_12-prvi25_crustal_subduction_combined_branches"; + String suffix = "ba_only"; + String solFileName = "combined_branch_averaged_solution.zip"; // String baseDirName = "2024_12_12-prvi25_crustal_branches-dmSample5x"; // String suffix = "ba_only"; // String solFileName = "results_PRVI_CRUSTAL_FM_V1p1_branch_averaged_gridded.zip"; - String baseDirName = "2024_12_12-prvi25_subduction_branches"; - String suffix = "ba_only-SLAB_only"; - String solFileName = "results_PRVI_SLAB_ONLY_branch_averaged_gridded.zip"; - bgOps = new IncludeBackgroundOption[] { IncludeBackgroundOption.ONLY }; -// String suffix = "ba_only-INTERFACE_only"; -// String solFileName = "results_PRVI_INTERFACE_ONLY_branch_averaged_gridded.zip"; -// String suffix = "ba_only-both_fms"; -// String solFileName = "results_PRVI_SUB_FMs_combined_branch_averaged_gridded.zip"; - -// vs30 = 760d; suffix += "-vs760"; - vs30 = 260d; suffix += "-vs260"; +// String baseDirName = "2024_12_12-prvi25_subduction_branches"; +// // slab (gridded only) +// String suffix = "ba_only-SLAB_only"; +// String solFileName = "results_PRVI_SLAB_ONLY_branch_averaged_gridded.zip"; +// bgOps = new IncludeBackgroundOption[] { IncludeBackgroundOption.ONLY }; +// // interface (will do fault + gridded) +//// String suffix = "ba_only-INTERFACE_only"; +//// String solFileName = "results_PRVI_INTERFACE_ONLY_branch_averaged_gridded.zip"; +// // both +//// String suffix = "ba_only-both_fms"; +//// String solFileName = "results_PRVI_SUB_FMs_combined_branch_averaged_gridded.zip"; + + vs30 = 760d; suffix += "-vs760"; +// vs30 = 260d; suffix += "-vs260"; /* * RSQSim @@ -250,6 +246,8 @@ else if (gridReg.getNodeCount() > 5000) } if (supersample) argz += " --supersample"; + if (sigmaTrunc != null) + argz += " --gmm-sigma-trunc-one-sided "+sigmaTrunc.floatValue(); argz += " "+dispatchArgs; File jobFile = new File(localDir, "batch_hazard_"+bgOp.name()+".slurm"); diff --git a/src/main/java/scratch/kevin/prvi25/figures/CombinedMFDsPlot.java b/src/main/java/scratch/kevin/prvi25/figures/CombinedMFDsPlot.java index 5c66b44..da3cd2e 100644 --- a/src/main/java/scratch/kevin/prvi25/figures/CombinedMFDsPlot.java +++ b/src/main/java/scratch/kevin/prvi25/figures/CombinedMFDsPlot.java @@ -125,9 +125,9 @@ public static void main(String[] args) throws IOException { Range xRange = new Range(5d, 9.5d); gp.drawGraphPanel(incrSpec, false, true, xRange, yRange); - PlotUtils.writePlots(outputDir, "combined_mfds", gp, 800, 750, true, false, false); + PlotUtils.writePlots(outputDir, "combined_mfds", gp, 800, 750, true, true, false); gp.drawGraphPanel(cmlSpec, false, true, xRange, yRange); - PlotUtils.writePlots(outputDir, "combined_mfds_cml", gp, 800, 750, true, false, false); + PlotUtils.writePlots(outputDir, "combined_mfds_cml", gp, 800, 750, true, true, false); } static IncrementalMagFreqDist calcFaultMFD(Region region, FaultSystemSolution sol, EvenlyDiscretizedFunc refMFD) { diff --git a/src/main/java/scratch/kevin/prvi25/figures/MultiTectonicParticipationMap.java b/src/main/java/scratch/kevin/prvi25/figures/MultiTectonicParticipationMap.java index 3f06e88..c9f30e8 100644 --- a/src/main/java/scratch/kevin/prvi25/figures/MultiTectonicParticipationMap.java +++ b/src/main/java/scratch/kevin/prvi25/figures/MultiTectonicParticipationMap.java @@ -6,7 +6,9 @@ import java.text.DecimalFormat; import java.util.ArrayList; import java.util.BitSet; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Random; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; @@ -34,6 +36,7 @@ import org.opensha.sha.earthquake.faultSysSolution.modules.GridSourceList.GriddedRuptureProperties; import org.opensha.sha.earthquake.faultSysSolution.util.FaultSectionUtils; import org.opensha.sha.earthquake.faultSysSolution.util.FaultSysTools; +import org.opensha.sha.earthquake.rupForecastImpl.prvi25.logicTree.PRVI25_CrustalFaultModels; import org.opensha.sha.earthquake.rupForecastImpl.prvi25.logicTree.PRVI25_SubductionFaultModels; import org.opensha.sha.earthquake.rupForecastImpl.prvi25.util.PRVI25_RegionLoader; import org.opensha.sha.faultSurface.EvenlyGriddedSurface; @@ -65,8 +68,8 @@ public static void main(String[] args) throws IOException { double cptMin = -6d; double cptMax = -2d; - CPT cpt = GMT_CPT_Files.RAINBOW_UNIFORM.instance().rescale(cptMin, cptMax); -// CPT cpt = GMT_CPT_Files.SEQUENTIAL_BATLOW_UNIFORM.instance().rescale(cptMin, cptMax); +// CPT cpt = GMT_CPT_Files.RAINBOW_UNIFORM.instance().rescale(cptMin, cptMax); + CPT cpt = GMT_CPT_Files.SEQUENTIAL_BATLOW_UNIFORM.instance().rescale(cptMin, cptMax); // CPT cpt = GMT_CPT_Files.SEQUENTIAL_NAVIA_UNIFORM.instance().rescale(cptMin, cptMax); // CPT cpt = GMT_CPT_Files.SEQUENTIAL_LAJOLLA_UNIFORM.instance().rescale(cptMin, cptMax); // CPT cpt = GMT_CPT_Files.SEQUENTIAL_OSLO_UNIFORM.instance().rescale(cptMin, cptMax); @@ -238,13 +241,16 @@ public static void main(String[] args) throws IOException { for (int r=0; r parentPolys = new HashMap<>(); + for (FaultSection sect : PRVI25_CrustalFaultModels.PRVI_CRUSTAL_FM_V1p1.getFaultSections()) + if (sect.isProxyFault() && sect.getZonePolygon() != null) + parentPolys.put(sect.getSectionId(), sect.getZonePolygon()); + for (FaultSection sect : combSects) { + if (sect.isProxyFault() && sect.getZonePolygon() != null) { + int parentID = sect.getParentSectionId(); + if (parentPolys.containsKey(parentID)) { + sect.setZonePolygon(parentPolys.get(parentID)); + parentPolys.remove(parentID); // only do this once per parent + } else { + sect.setZonePolygon(null); + } + } + } + // write generic cpt only first PlotUtils.writeScaleLegendOnly(outputDir, "participation_cpt", GeographicMapMaker.buildCPTLegend(cpt, "Log10 Participation Rate (/yr)"), @@ -299,6 +322,7 @@ public static void main(String[] args) throws IOException { TectonicRegionType.SUBDUCTION_SLAB }; + mapMaker.setRegion(gridMapReg); mapMaker.clearSectScalars(); mapMaker.setSectTraceChar(new PlotCurveCharacterstics(PlotLineType.SOLID, 1f, Color.DARK_GRAY)); GridSourceList gridProv = combSol.requireModule(GridSourceList.class); diff --git a/src/main/java/scratch/kevin/prvi25/figures/ProxyFaultRepresentationFigures.java b/src/main/java/scratch/kevin/prvi25/figures/ProxyFaultRepresentationFigures.java index 24c0538..eb83c91 100644 --- a/src/main/java/scratch/kevin/prvi25/figures/ProxyFaultRepresentationFigures.java +++ b/src/main/java/scratch/kevin/prvi25/figures/ProxyFaultRepresentationFigures.java @@ -73,10 +73,12 @@ public static void main(String[] args) throws IOException { double lengthLimit = 75d; // RupType[] types = RupType.values(); +// double lenFractBuffer = 1.05; RupType[] types = { RupType.PROXY, RupType.SPLIT_PROXIES }; + double lenFractBuffer = 0.5; CPT colors = GMT_CPT_Files.CATEGORICAL_BATLOW_UNIFORM.instance(); @@ -134,7 +136,7 @@ public static void main(String[] args) throws IOException { int rupID = -1; double maxRupMag = 0d; List allRups = new ArrayList<>(rupSet.getRupturesForParentSection(parentID)); - Collections.reverse(allRups); +// Collections.reverse(allRups); // this makes it the left side of Anegada zones for (int rupIndex : allRups) { double mag = rupSet.getMagForRup(rupIndex); if ((float)mag < (float)maxRupMag) @@ -164,7 +166,7 @@ public static void main(String[] args) throws IOException { System.out.println("Using an M"+(float)maxRupMag+" rupture, len="+(float)rupSet.getLengthForRup(rupID)*1e-3); double rupLen = rupSet.getLengthForRup(rupID)*1e-3; - double regBuffer = Math.min(60d, Double.max(30d, rupLen+5d)); + double regBuffer = Math.min(60d, Double.max(30d, rupLen*lenFractBuffer)); lowerLeft = LocationUtils.location(lowerLeft, 5d*Math.PI/4d, regBuffer); upperRight = LocationUtils.location(upperRight, Math.PI/4d, regBuffer); diff --git a/src/main/java/scratch/kevin/prvi25/figures/SeismicityPDFFigures.java b/src/main/java/scratch/kevin/prvi25/figures/SeismicityPDFFigures.java index 89a88ba..ab9e757 100644 --- a/src/main/java/scratch/kevin/prvi25/figures/SeismicityPDFFigures.java +++ b/src/main/java/scratch/kevin/prvi25/figures/SeismicityPDFFigures.java @@ -51,13 +51,13 @@ public static void main(String[] args) throws IOException { "Crustal", PRVI25_SeismicityRegions.CRUSTAL); // plotPDFs(crustalOutputDir, "crustal_m5", 5d, avgDecluster, avgSmooth, fullGrid, // "Crustal", PRVI25_SeismicityRegions.CRUSTAL); - plotNucleationRates(crustalOutputDir, "crustal_m5", crustalGridProv, 5d, TectonicRegionType.ACTIVE_SHALLOW, fullGrid, "Crustal", null); - plotNucleationRates(crustalOutputDir, "crustal_m7", crustalGridProv, 7d, TectonicRegionType.ACTIVE_SHALLOW, fullGrid, "Crustal", null); + plotNucleationRates(crustalOutputDir, "crustal_m5", crustalGridProv, 5d, TectonicRegionType.ACTIVE_SHALLOW, fullGrid, "Crustal Gridded", null); + plotNucleationRates(crustalOutputDir, "crustal_m7", crustalGridProv, 7d, TectonicRegionType.ACTIVE_SHALLOW, fullGrid, "Crustal Gridded", null); plotPDFs(subOutputDir, "sub_interface_pdf", 0, avgDecluster, avgSmooth, fullGrid, - "Interface", PRVI25_SeismicityRegions.CAR_INTERFACE, PRVI25_SeismicityRegions.MUE_INTERFACE); + "Interface Gridded", PRVI25_SeismicityRegions.CAR_INTERFACE, PRVI25_SeismicityRegions.MUE_INTERFACE); plotPDFs(subOutputDir, "sub_interface_m5", 5, avgDecluster, avgSmooth, fullGrid, - "Interface", PRVI25_SeismicityRegions.CAR_INTERFACE, PRVI25_SeismicityRegions.MUE_INTERFACE); + "Interface Gridded", PRVI25_SeismicityRegions.CAR_INTERFACE, PRVI25_SeismicityRegions.MUE_INTERFACE); plotPDFs(subOutputDir, "sub_slab_pdf", 0, avgDecluster, avgSmooth, fullGrid, "Intraslab", PRVI25_SeismicityRegions.CAR_INTRASLAB, PRVI25_SeismicityRegions.MUE_INTRASLAB); plotPDFs(subOutputDir, "sub_slab_m5", 5, avgDecluster, avgSmooth, fullGrid,