Skip to content
Snippets Groups Projects
Commit e270ecfa authored by Powers, Peter M.'s avatar Powers, Peter M.
Browse files

minor build update

parent 524d9d8e
No related branches found
No related tags found
1 merge request!103Misc edits
......@@ -6,4 +6,5 @@
/tmp
curves*/
Scratch*.java
nshmp-haz-log*
/src/META-INF
......@@ -11,8 +11,8 @@
<property name="dist.dir" value="dist/" />
<property name="javadoc.dir" value="../nshmp-haz.gh-pages/javadoc" />
<defaultexcludes add="**/Scratch*.java"/>
<defaultexcludes add="**/Scratch*.java" />
<path id="library.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
......@@ -42,7 +42,7 @@
destdir="${classes.dir}"
classpathref="library.classpath"
nowarn="true"
fork="true"
fork="true"
source="1.7"
target="1.7"
encoding="UTF-8"
......@@ -57,15 +57,14 @@
</copy>
</target>
<target name="compile-tests">
</target>
<target name="javadoc">
<defaultexcludes echo="true"/>
<!-- Clean the docs directory; .git data preserved by defaultexcludes -->
<delete includeEmptyDirs="true" failonerror="yes" verbose="no">
<fileset dir="${javadoc.dir}" />
......@@ -82,25 +81,36 @@
verbose="false"
encoding="UTF-8"
docencoding="UTF-8"
charset="UTF-8">
charset="UTF-8"
additionalparam="-notimestamp">
<fileset dir="${src.dir}">
<include name="**/*.java" />
</fileset>
<link href="http://docs.oracle.com/javase/7/docs/api/" />
<link href="http://commons.apache.org/proper/commons-math/apidocs/" />
<link href="http://google.github.io/guava/releases/19.0/api/docs/" />
<link href="http://google.github.io/gson/apidocs/" />
</javadoc>
<!-- Copy images -->
<copy todir="${javadoc.dir}/resources">
<fileset dir="etc/resources/docs" includes="*.jpg" />
</copy>
</target>
<bottom>
<![CDATA[
<div style="float: right; font-size: 14px; padding: 4px;">
<span style="font-weight: bold;">U.S. Geological Survey</span>
– National Seicmic Hazard Mapping Project
(<a href="https://github.com/usgs/nshmp-haz" target="_top">NSHMP</a>)
</div>
]]>
</bottom>
<link href="http://docs.oracle.com/javase/7/docs/api/" />
<link href="http://commons.apache.org/proper/commons-math/apidocs/" />
<link href="http://google.github.io/guava/releases/19.0/api/docs/" />
<link href="http://google.github.io/gson/apidocs/" />
</javadoc>
<!-- Copy images -->
<copy todir="${javadoc.dir}/resources">
<fileset dir="etc/resources/docs" includes="*.jpg" />
</copy>
</target>
</project>
......@@ -6,7 +6,7 @@ __Working directory:__ `/path/to/nshmp-haz/etc/examples/2-custom-config`
Navigate to the directory above and execute the following:
```Shell
hazard ../../peer/models/Set1-Case1 "San Francisco,-122.40,37.75" config.json
hazard ../../peer/models/Set1-Case1 "San Francisco, -122.40, 37.75" config.json
```
In this example we've overridden the configuration supplied by the model. Specifically:
......
......@@ -107,8 +107,9 @@ public class HazardCalc {
}
log.info(config.toString());
Iterable<Site> sites = readSites(args[1]);
log.info("");
Iterable<Site> sites = readSites(args[1], log);
log.info("Sites: " + sites);
Path out = calc(model, config, sites, log);
......@@ -132,13 +133,17 @@ public class HazardCalc {
}
}
static Iterable<Site> readSites(String arg) {
private static Iterable<Site> readSites(String arg, Logger log) {
try {
if (arg.toLowerCase().endsWith(".csv")) {
return Sites.fromCsv(Paths.get(arg));
Path path = Paths.get(arg);
log.info("Site file: " + path.toAbsolutePath().normalize());
return Sites.fromCsv(path);
}
if (arg.toLowerCase().endsWith(".geojson")) {
return Sites.fromJson(Paths.get(arg));
Path path = Paths.get(arg);
log.info("Site file: " + path.toAbsolutePath().normalize());
return Sites.fromJson(path);
}
return Sites.fromString(arg);
} catch (Exception e) {
......
......@@ -125,7 +125,7 @@ public class Site implements Named {
@Override
public String toString() {
return new StringBuilder(Strings.padEnd(name, 20, ' '))
return new StringBuilder(Strings.padEnd(name, 28, ' '))
.append(String.format("%.3f %.3f Vs30=%s ", location.lon(), location.lat(), vs30))
.append(vsInferred ? "inferred " : "measured ")
.append(String.format("Z1.0=%s Z2.5=%s", z1p0, z2p5))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment