diff --git a/src/main/java/scratch/kevin/simulators/RSQSimCatalog.java b/src/main/java/scratch/kevin/simulators/RSQSimCatalog.java index 1f68f346..b053d1e7 100644 --- a/src/main/java/scratch/kevin/simulators/RSQSimCatalog.java +++ b/src/main/java/scratch/kevin/simulators/RSQSimCatalog.java @@ -20,6 +20,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.zip.ZipFile; import org.dom4j.Attribute; import org.dom4j.Document; @@ -790,7 +791,16 @@ public enum Catalogs { 59, 'G'), BRUCE_5892("rundir5892", "Bruce 5892", "Bruce Shaw", cal(2024, 8, 25), "WUSav, delta=2.0km, sigma0=100, b=.008, alpha=0.25", - NSHM23_FaultModels.WUS_FM_v3, NSHM23_DeformationModels.AVERAGE); + NSHM23_FaultModels.WUS_FM_v3, NSHM23_DeformationModels.AVERAGE), + BRUCE_5895("rundir5895", "Bruce 5895", "Bruce Shaw", cal(2024, 9, 12), + "WUSav, delta=2.0km, sigma0=100, b=.008, alpha=0.25, dynamic", + NSHM23_FaultModels.WUS_FM_v3, NSHM23_DeformationModels.AVERAGE), + BRUCE_5932("rundir5932", "Bruce 5932", "Bruce Shaw", cal(2024, 9, 12), + "CA, delta=1.0km, sigma0=100, bdeep=.013 bshallow=.003, alpha=0.25, hload=hst=3, dynamic tcausalFactor=.60", + FaultModels.FM3_1, DeformationModels.GEOLOGIC), + BRUCE_5935("rundir5935", "Bruce 5935", "Bruce Shaw", cal(2024, 9, 12), + "CA, delta=1.0km, sigma0=100, bdeep=.013 bshallow=.003, alpha=0.25, hload=hst=3, dynamic tcausalFactor=.75", + FaultModels.FM3_1, DeformationModels.GEOLOGIC); private String dirName; private RSQSimCatalog catalog; @@ -2013,13 +2023,27 @@ public synchronized FaultSystemSolution getComparisonSolution() throws IOExcepti // download it String addr = "http://data.opensha.org/ftp/kmilner/ucerf3/2013_05_10-ucerf3p3-production-10runs_fm_dm_sub_plots/" + fm.getFilePrefix()+"_"+dm.getFilePrefix()+"/"+solFile.getName(); + boolean validate = false; try { FileUtils.downloadURL(addr, solFile); + validate = true; } catch (IOException e) { System.err.println("Failed to download comparison solution from: "+addr); e.printStackTrace(); solFile = null; } + if (validate) { + // make sure the file we just downloaded actually works + try { + ZipFile zip = new ZipFile(solFile); + zip.close(); + } catch (Exception e) { + // failed + System.err.println("Failed to download comparison solution from: "+addr+" (bad zip file)"); + solFile.delete(); + solFile = null; + } + } } } @@ -3409,7 +3433,7 @@ public static void main(String args[]) throws IOException, DocumentException { File gitDir = new File("/home/kevin/markdown/rsqsim-analysis/catalogs"); boolean overwriteIndividual = true; - boolean replot = true; + boolean replot = false; // File baseDir = new File("/data/kevin/simulators/catalogs"); diff --git a/src/main/java/scratch/kevin/simulators/ruptures/BBPStandaloneCheckerboardPlots.java b/src/main/java/scratch/kevin/simulators/ruptures/BBPStandaloneCheckerboardPlots.java index 1690bfd6..3c8dc098 100644 --- a/src/main/java/scratch/kevin/simulators/ruptures/BBPStandaloneCheckerboardPlots.java +++ b/src/main/java/scratch/kevin/simulators/ruptures/BBPStandaloneCheckerboardPlots.java @@ -272,10 +272,16 @@ public static void main(String[] args) throws IOException { // String prefix = "r5652"; // VelocityModel vm = VelocityModel.LA_BASIN_500; - RSQSimCatalog catalog = Catalogs.BRUCE_5672.instance(); - File bbpDir = new File("/data/kevin/bbp/parallel/2023_11_06-rundir5672-all-m6.5-skipYears2000-noHF-vmLA_BASIN_500-griddedSites"); +// RSQSimCatalog catalog = Catalogs.BRUCE_5672.instance(); +// File bbpDir = new File("/data/kevin/bbp/parallel/2023_11_06-rundir5672-all-m6.5-skipYears2000-noHF-vmLA_BASIN_500-griddedSites"); +// File bbpFile = new File(bbpDir, "results_rotD.zip"); +// String prefix = "r5672"; +// VelocityModel vm = VelocityModel.LA_BASIN_500; + + RSQSimCatalog catalog = Catalogs.BRUCE_5935.instance(); + File bbpDir = new File("/data/kevin/bbp/parallel/2024_10_04-rundir5935-all-m6.5-skipYears2000-maxDist300-noHF-vmLA_BASIN_500-griddedSites"); File bbpFile = new File(bbpDir, "results_rotD.zip"); - String prefix = "r5672"; + String prefix = "r5935"; VelocityModel vm = VelocityModel.LA_BASIN_500; PlotType[] types = PlotType.values(); @@ -291,10 +297,19 @@ public static void main(String[] args) throws IOException { // AttenRelRef gmmRef = AttenRelRef.ASK_2014; // prefix += "_ask2014"; - File outputDir = new File("/home/kevin/Documents/papers/2023_Bruce_GMM_Multifault/figures/checkerboards"); - Preconditions.checkState(outputDir.exists() || outputDir.mkdir()); - outputDir = new File(outputDir, prefix); +// File outputDir = new File("/home/kevin/Documents/papers/2023_Bruce_GMM_Multifault/figures/checkerboards"); +// Preconditions.checkState(outputDir.exists() || outputDir.mkdir()); +// outputDir = new File(outputDir, prefix); +// Preconditions.checkState(outputDir.exists() || outputDir.mkdir()); + + File markdownDir = new File("/home/kevin/markdown/rsqsim-analysis/catalogs"); + File mdCatalogDir = new File(markdownDir, catalog.getCatalogDir().getName()); + Preconditions.checkState(mdCatalogDir.exists()); + File mdBBPDir = new File(mdCatalogDir, "bbp_"+vm.name()); + Preconditions.checkState(mdCatalogDir.exists() || mdCatalogDir.mkdir()); + File outputDir = new File(mdBBPDir, "standalone_gmpe_checkerboards"); Preconditions.checkState(outputDir.exists() || outputDir.mkdir()); + File resourcesDir = new File(outputDir, "resources"); Preconditions.checkState(resourcesDir.exists() || resourcesDir.mkdir()); diff --git a/src/main/java/scratch/kevin/simulators/ruptures/CatalogGMPE_Compare.java b/src/main/java/scratch/kevin/simulators/ruptures/CatalogGMPE_Compare.java index 0350ecef..3b0ecc1d 100644 --- a/src/main/java/scratch/kevin/simulators/ruptures/CatalogGMPE_Compare.java +++ b/src/main/java/scratch/kevin/simulators/ruptures/CatalogGMPE_Compare.java @@ -573,14 +573,19 @@ public static void main(String[] args) throws ZipException, IOException { // RSQSimCatalog catalog = Catalogs.BRUCE_5413.instance(); // RSQSimCatalog catalog = Catalogs.BRUCE_5774.instance(); // RSQSimCatalog catalog = Catalogs.BRUCE_5775_CRUSTAL.instance(); - RSQSimCatalog catalog = Catalogs.BRUCE_5775_SUB.instance(); +// RSQSimCatalog catalog = Catalogs.BRUCE_5775_SUB.instance(); + RSQSimCatalog catalog = Catalogs.BRUCE_5935.instance(); boolean doGMPE = true; boolean doRotD = false; + boolean doNonErgodicMaps = false; + Region siteMapRegion = null; + Region sourceMapRegion = null; - Region siteMapRegion = new CaliforniaRegions.CYBERSHAKE_MAP_REGION(); - Region sourceMapRegion = bufferRegion(siteMapRegion, 200d); +// boolean doNonErgodicMaps = true; +// Region siteMapRegion = new CaliforniaRegions.CYBERSHAKE_MAP_REGION(); +// Region sourceMapRegion = bufferRegion(siteMapRegion, 200d); boolean doGridded = true; @@ -593,13 +598,13 @@ public static void main(String[] args) throws ZipException, IOException { // AttenRelSupplier[] gmpeRefs = { AttenRelRef.NGAWest_2014_AVG_NOIDRISS, AttenRelRef.ASK_2014, // AttenRelRef.BSSA_2014, AttenRelRef.CB_2014, AttenRelRef.CY_2014 }; -//// AttenRelRef[] gmpeRefs = { AttenRelRef.NGAWest_2014_AVG_NOIDRISS, AttenRelRef.ASK_2014 }; -//// AttenRelRef[] gmpeRefs = { AttenRelRef.NGAWest_2014_AVG_NOIDRISS }; -//// AttenRelRef[] gmpeRefs = { AttenRelRef.BSSA_2014, AttenRelRef.CB_2014, AttenRelRef.CY_2014 }; -//// IMT[] imts = { IMT.SA3P0 }; -//// AttenRelRef[] gmpeRefs = { AttenRelRef.ASK_2014 }; -// IMT[] imts = { IMT.PGV, IMT.SA2P0, IMT.SA3P0, IMT.SA5P0, IMT.SA10P0 }; -// AttenRelRef rotDGMPE = AttenRelRef.ASK_2014; + AttenRelRef[] gmpeRefs = { AttenRelRef.NGAWest_2014_AVG_NOIDRISS, AttenRelRef.ASK_2014 }; +// AttenRelRef[] gmpeRefs = { AttenRelRef.NGAWest_2014_AVG_NOIDRISS }; +// AttenRelRef[] gmpeRefs = { AttenRelRef.BSSA_2014, AttenRelRef.CB_2014, AttenRelRef.CY_2014 }; +// IMT[] imts = { IMT.SA3P0 }; +// AttenRelRef[] gmpeRefs = { AttenRelRef.ASK_2014 }; + IMT[] imts = { IMT.PGV, IMT.SA2P0, IMT.SA3P0, IMT.SA5P0, IMT.SA10P0 }; + AttenRelRef rotDGMPE = AttenRelRef.ASK_2014; // AttenRelRef[] gmpeRefs = { AttenRelRef.AFSHARI_STEWART_2016 }; // IMT[] imts = { IMT.DUR_5_75, IMT.DUR_5_95, IMT.DUR_20_80 }; @@ -609,11 +614,11 @@ public static void main(String[] args) throws ZipException, IOException { // IMT[] imts = { IMT.SA2P0, IMT.SA3P0, IMT.SA5P0 }; // AttenRelRef rotDGMPE = null; - AttenRelSupplier[] gmpeRefs = { - new NSHMP_AttenRelSupplier(Gmm.AG_20_GLOBAL_INTERFACE, "AG2020_Global", false) - }; - IMT[] imts = { IMT.SA2P0, IMT.SA3P0, IMT.SA5P0, IMT.SA10P0 }; - AttenRelRef rotDGMPE = null; +// AttenRelSupplier[] gmpeRefs = { +// new NSHMP_AttenRelSupplier(Gmm.AG_20_GLOBAL_INTERFACE, "AG2020_Global", false) +// }; +// IMT[] imts = { IMT.SA2P0, IMT.SA3P0, IMT.SA5P0, IMT.SA10P0 }; +// AttenRelRef rotDGMPE = null; String[] highlightNames; if (doGridded) diff --git a/src/main/java/scratch/kevin/simulators/ruptures/MPJ_BBP_CatalogSimScriptGen.java b/src/main/java/scratch/kevin/simulators/ruptures/MPJ_BBP_CatalogSimScriptGen.java index e11da105..fdfc6a75 100644 --- a/src/main/java/scratch/kevin/simulators/ruptures/MPJ_BBP_CatalogSimScriptGen.java +++ b/src/main/java/scratch/kevin/simulators/ruptures/MPJ_BBP_CatalogSimScriptGen.java @@ -40,11 +40,11 @@ public static void main(String[] args) throws IOException { // String catalogDirName = "rundir5597_crustal_corupture"; // String catalogDirName = "rundir5775_subduction"; // String catalogDirName = "rundir5775_crustal"; - String catalogDirName = "rundir5892"; + String catalogDirName = "rundir5932"; - int skipYears = 20000; +// int skipYears = 20000; // int skipYears = 5000; -// int skipYears = 2000; + int skipYears = 2000; // int skipYears = 0; // int skipYears = 65000; @@ -65,26 +65,19 @@ public static void main(String[] args) throws IOException { boolean nzStandardSites = false; // CA -// Integer utmZone = null; -// Character utmBand = null; -// boolean standardSites = false; -// boolean csInitialLASites = false; -// boolean cs500LASites = false; -// boolean csLAMapSites = false; -// boolean griddedCASites = true; -// boolean griddedSoCalSites = false; -// boolean griddedNZSites = false; -// boolean nzStandardSites = false; -//// VelocityModel vm = VelocityModel.LA_BASIN_863; // uncomment only if you need the old 863 -// VelocityModel vm = VelocityModel.LA_BASIN_500; - - // NSHM23-wUS Integer utmZone = null; Character utmBand = null; - griddedWUSSites = true; + griddedCASites = true; // VelocityModel vm = VelocityModel.LA_BASIN_863; // uncomment only if you need the old 863 VelocityModel vm = VelocityModel.LA_BASIN_500; + // NSHM23-wUS +// Integer utmZone = null; +// Character utmBand = null; +// griddedWUSSites = true; +//// VelocityModel vm = VelocityModel.LA_BASIN_863; // uncomment only if you need the old 863 +// VelocityModel vm = VelocityModel.LA_BASIN_500; + // NZ // Integer utmZone = 59; // Character utmBand = 'G'; diff --git a/src/main/java/scratch/kevin/simulators/slipRateVar/SingleLocSlipRateVarPlot.java b/src/main/java/scratch/kevin/simulators/slipRateVar/SingleLocSlipRateVarPlot.java index d5cc7813..bb4db5db 100644 --- a/src/main/java/scratch/kevin/simulators/slipRateVar/SingleLocSlipRateVarPlot.java +++ b/src/main/java/scratch/kevin/simulators/slipRateVar/SingleLocSlipRateVarPlot.java @@ -39,6 +39,9 @@ public class SingleLocSlipRateVarPlot { public static void main(String[] args) throws IOException { RSQSimCatalog catalog = Catalogs.BRUCE_5892.instance(); + int skipYears = 20000; +// RSQSimCatalog catalog = Catalogs.BRUCE_5895.instance(); +// int skipYears = 5000; List subSects = catalog.getSubSects(); int[] parentIDs = { @@ -68,7 +71,7 @@ public static void main(String[] args) throws IOException { DiscretizedFunc cumulativeSlipFunc = new ArbitrarilyDiscretizedFunc(); double cumulativeSlip = 0d; - List events = catalog.loader().skipYears(20000).forSections(false, middle.getSectionId()).minMag(5d).load(); + List events = catalog.loader().skipYears(skipYears).forSections(false, middle.getSectionId()).minMag(5d).load(); System.out.println("Loaded "+events.size()+" events for "+middle.getSectionName()); double firstEventTime = 0d; diff --git a/src/main/java/scratch/kevin/ucerf3/eal/UCERF3_LEC_TreeTrimmer.java b/src/main/java/scratch/kevin/ucerf3/eal/UCERF3_LEC_TreeTrimmer.java index 064a0083..27659d4e 100644 --- a/src/main/java/scratch/kevin/ucerf3/eal/UCERF3_LEC_TreeTrimmer.java +++ b/src/main/java/scratch/kevin/ucerf3/eal/UCERF3_LEC_TreeTrimmer.java @@ -40,10 +40,12 @@ public static void main(String[] args) throws IOException { File inputDir = new File("/home/kevin/OpenSHA/UCERF3/eal/" // + "2020_04_03-ucerf3-ngaw2-cea-100pct-consolidate-calcLEC"); // + "2020_07_08-ucerf3-ngaw2-cea-100pct-consolidate-calcLEC-gmVar"); - + "2020_09_03-ucerf3-ngaw2-cea-100pct-consolidate-calcLEC-covModel"); - List> fixedBranches = new ArrayList<>(); - fixedBranches.add(U3_EAL_GMMs.BSSA_2014); - fixedBranches.add(U3_EAL_GMM_Epistemic.NONE); +// + "2020_09_03-ucerf3-ngaw2-cea-100pct-consolidate-calcLEC-covModel"); + + "2024_09_05-ucerf3-ngaw2-cea-100pct-consolidate-calcLEC-covModel"); + List> fixedBranches = null; +// List> fixedBranches = new ArrayList<>(); +// fixedBranches.add(U3_EAL_GMMs.BSSA_2014); +// fixedBranches.add(U3_EAL_GMM_Epistemic.NONE); File outputDir = new File(inputDir, "tree_trimming"); if (fixedBranches != null && !fixedBranches.isEmpty()) {