From ace03209ad88c30f8fde1e0ca3c293800cd34ceb Mon Sep 17 00:00:00 2001 From: John Patton Date: Fri, 1 Mar 2019 13:23:33 -0700 Subject: [PATCH] removed property files --- src/gov/usgs/traveltime/AuxTtRef.java | 10 +- src/gov/usgs/traveltime/CWBProperties.java | 200 ------------------ src/gov/usgs/traveltime/TTSessionLocal.java | 6 +- src/gov/usgs/traveltime/TauUtil.java | 18 +- src/gov/usgs/traveltime/TtMain.java | 4 +- .../usgs/traveltime/session/TTSession.java | 4 +- .../usgs/traveltime/tables/EarthModel.java | 5 - src/gov/usgs/traveltime/tables/ReModel.java | 4 +- 8 files changed, 21 insertions(+), 230 deletions(-) delete mode 100644 src/gov/usgs/traveltime/CWBProperties.java diff --git a/src/gov/usgs/traveltime/AuxTtRef.java b/src/gov/usgs/traveltime/AuxTtRef.java index f51ef81..ab79375 100644 --- a/src/gov/usgs/traveltime/AuxTtRef.java +++ b/src/gov/usgs/traveltime/AuxTtRef.java @@ -68,11 +68,13 @@ public class AuxTtRef { * @param readStats If true, read the phase statistics * @param readEllip If true, read the ellipticity corrections * @param readTopo If true, read the topography file + * @param modelPath If not null, path to model files * @throws IOException If opens fail * @throws ClassNotFoundException Serialization input fails */ @SuppressWarnings("unchecked") - public AuxTtRef(boolean readStats, boolean readEllip, boolean readTopo) + public AuxTtRef(boolean readStats, boolean readEllip, boolean readTopo, + String modelPath) throws IOException, ClassNotFoundException { String[] absNames; BufferedInputStream inGroup, inStats, inEllip; @@ -83,10 +85,10 @@ public AuxTtRef(boolean readStats, boolean readEllip, boolean readTopo) FileLock lock; EllipDeps eDepth; - // Set up the properties. - if(TauUtil.modelPath == null) { - TauUtil.getProperties(); + if (modelPath != null) { + TauUtil.modelPath = modelPath; } + // Create absolute path names. absNames = new String[fileNames.length]; for(int j=0; j unique; /** - * Path of the travel time/locator properties file. + * Paths for model files. */ - private static String propFile = "Properties"+CWBProperties.FS+"traveltime.prop"; - /** - * Paths for model and event files set in getProperties. - */ - public static String modelPath; - - /** - * Read the travel time properties file and set up paths to the model - * and event files. - */ - public static void getProperties() { - CWBProperties.loadProperties(propFile); - modelPath = CWBProperties.getProperty("modelPath"); -// CWBProperties.prtProperties(); - } + public static String modelPath = "./models/"; /** * Build a path to a model file. diff --git a/src/gov/usgs/traveltime/TtMain.java b/src/gov/usgs/traveltime/TtMain.java index d104d09..8522926 100644 --- a/src/gov/usgs/traveltime/TtMain.java +++ b/src/gov/usgs/traveltime/TtMain.java @@ -49,7 +49,9 @@ public static void main(String[] args) throws Exception { if(local) { // Initialize the local travel-time manager. - ttLocal = new TTSessionLocal(true, true, true); + // NOTE assumes default model path for now, need to figure out + // where to get this path. Cmd line arg? + ttLocal = new TTSessionLocal(true, true, true, null); // Generate a list of available Earth models. String[] models = TauUtil.availableModels(); if(models.length > 0) { diff --git a/src/gov/usgs/traveltime/session/TTSession.java b/src/gov/usgs/traveltime/session/TTSession.java index b06858b..6f4336d 100644 --- a/src/gov/usgs/traveltime/session/TTSession.java +++ b/src/gov/usgs/traveltime/session/TTSession.java @@ -182,7 +182,9 @@ private void makeTTSession(String earthModel, double sourceDepth, String[] phase // Read in data common to all models. if (auxtt == null) { prta(ttag+" create AuxTtRef "); - auxtt = new AuxTtRef(true, true, true); + // NOTE assumes default model path for now, need to figure out + // where to get this path. Cmd line arg? + auxtt = new AuxTtRef(true, true, true, null); } // See if we know this model. diff --git a/src/gov/usgs/traveltime/tables/EarthModel.java b/src/gov/usgs/traveltime/tables/EarthModel.java index 72f39df..7af5af9 100644 --- a/src/gov/usgs/traveltime/tables/EarthModel.java +++ b/src/gov/usgs/traveltime/tables/EarthModel.java @@ -49,11 +49,6 @@ public EarthModel(String earthModel, boolean isCubic) { model = new ArrayList(); shells = new ArrayList(); interp = new ModelInterp(model, shells, isCubic); - // Set up the properties. - if(TauUtil.modelPath == null) { - TauUtil.getProperties(); - - } } /** diff --git a/src/gov/usgs/traveltime/tables/ReModel.java b/src/gov/usgs/traveltime/tables/ReModel.java index 0e289f2..d81bda3 100644 --- a/src/gov/usgs/traveltime/tables/ReModel.java +++ b/src/gov/usgs/traveltime/tables/ReModel.java @@ -38,7 +38,9 @@ public static void main(String[] args) throws Exception { TauUtil.model("phases.txt")); if(status == TtStatus.SUCCESS) { // Build the branch reference classes. - auxTT = new AuxTtRef(true, false, false); + // NOTE assumes default model path for now, need to figure out + // where to get this path. Cmd line arg? + auxTT = new AuxTtRef(true, false, false, null); allRef = make.fillAllBrnRef(null, auxTT); System.out.format("\n***** Table generation time: %5.3f *****\n", 0.001*(System.currentTimeMillis()-sysTime));