/** * Reads source model logic tree data and returns a {@link LogicTree} object representing * epistemic uncertainties in the source model. Logic Tree data are expected in nrml format and * read using a {@link LogicTreeReader} object. Logic Tree data can be read from file or kvs. The * method assumes that only one source model logic tree is defined and therefore only the first * logic tree read is returned. */ public LogicTree createErfLogicTreeData() throws IOException { // Distinguish between reading from file or from kvs. Use a // LogicTreeReader object to read logic tree data and returns the first // logic tree read (this because currently epistemic uncertainties in // the source model are assumed to be described by only one logic tree). if (hasPath == true) { LogicTreeReader logicTreeReader = new LogicTreeReader(getRelativePath(ConfigItems.SOURCE_MODEL_LOGIC_TREE_FILE.name())); return logicTreeReader.read().get("1"); } else { LogicTreeReader logicTreeReader = new LogicTreeReader( kvs, config.getString(ConfigItems.SOURCE_MODEL_LOGIC_TREE_FILE.name())); return logicTreeReader.read().get("1"); } }
/** * Reads logic tree data and instantiates {@link LogicTree} objects for each {@link * TectonicRegionType}. Each {@link LogicTree} contains {@link AttenuationRelationship} objects * with the given parameters set up. */ public void parse_tree( String component, String intensityMeasureType, double period, double damping, String truncType, double truncLevel, String stdType, double vs30) { LogicTreeReader logicTreeReader = new LogicTreeReader(bufferedReader); Map<String, LogicTree> logicTreeMap = logicTreeReader.read(); if (logicTreeMap.get(TectonicRegionType.ACTIVE_SHALLOW.toString()) != null) { setGMPELogicTree( TectonicRegionType.ACTIVE_SHALLOW.toString(), component, intensityMeasureType, period, damping, truncType, truncLevel, stdType, vs30, logicTreeMap); } if (logicTreeMap.get(TectonicRegionType.STABLE_SHALLOW.toString()) != null) { setGMPELogicTree( TectonicRegionType.STABLE_SHALLOW.toString(), component, intensityMeasureType, period, damping, truncType, truncLevel, stdType, vs30, logicTreeMap); } if (logicTreeMap.get(TectonicRegionType.SUBDUCTION_INTERFACE.toString()) != null) { setGMPELogicTree( TectonicRegionType.SUBDUCTION_INTERFACE.toString(), component, intensityMeasureType, period, damping, truncType, truncLevel, stdType, vs30, logicTreeMap); } if (logicTreeMap.get(TectonicRegionType.SUBDUCTION_SLAB.toString()) != null) { setGMPELogicTree( TectonicRegionType.SUBDUCTION_SLAB.toString(), component, intensityMeasureType, period, damping, truncType, truncLevel, stdType, vs30, logicTreeMap); } }