Skip to content

Commit

Permalink
fix --help output, add --help to tests, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
crotwell committed Mar 10, 2017
1 parent 4ad775c commit 6c3bf74
Show file tree
Hide file tree
Showing 11 changed files with 251 additions and 2 deletions.
Binary file modified doc/taup.pdf
Binary file not shown.
4 changes: 4 additions & 0 deletions latex/tools.tex
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ \subsection{TauP\_Time}
--time -- only output travel time
--rel phasename -- also output relative travel time
--json -- output travel times as json
-o [stdout|outfile] -- output is redirected to stdout or to the "outfile" file
--debug -- enable debugging output
--verbose -- enable verbose output
Expand Down Expand Up @@ -690,6 +692,8 @@ \subsection{TauP\_Console}
TauP\_Console is an instance of the Jython, http://www.jython.org, interpreter with the TauP classes
preloaded along with some helper functionality. This allows python scripting with TauP.

Note, to make the distribution smaller, TauP\_Console is no longer compiled as the Jython jar was large. It is included in the source in the src/extras directory and also requires the jython jar.

The usage is:
\begin{verbatim}
taup_console [scriptfile]
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/edu/sc/seis/TauP/TauP_Time.java
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,8 @@ public void printUsage() {
printStdUsage();
Alert.info("--rayp -- only output the ray parameter\n"
+ "--time -- only output travel time\n"
+ "--rel phasename -- also output relative travel time");
+ "--rel phasename -- also output relative travel time\n\n"
+ "--json -- output travel times as json\n");
printStdUsageTail();
}

Expand Down
11 changes: 10 additions & 1 deletion src/test/java/edu/sc/seis/TauP/CmdLineOutputTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ public class CmdLineOutputTest {
"taup_curve -o stdout -h 10 -ph P",
"taup_curve -o stdout -h 10 -ph P -mod ak135"};

String[] helpTestCmds = new String[] {"taup_time --help",
"taup_pierce --help",
"taup_path --help",
"taup_curve --help",
"taup_wavefront --help",
"taup_table --help",
"taup_create --help"};


/** disable unless regenerating the cmd line output test resources.
* new text files will be in cmdLineTest in cwd
Expand All @@ -55,6 +63,7 @@ public class CmdLineOutputTest {
// @Test
public void testSaveOutput() throws Exception {
List<String> allList = new ArrayList<String>();
allList.addAll(Arrays.asList(helpTestCmds));
allList.addAll(Arrays.asList(timeTestCmds));
allList.addAll(Arrays.asList(pierceTestCmds));
allList.addAll(Arrays.asList(pathTestCmds));
Expand All @@ -73,7 +82,7 @@ public void testSaveOutput() throws Exception {
*/
// @Test
public void testSaveOutputSingle() throws Exception {
saveOutputToFile(timeTestCmds[6]);
saveOutputToFile(helpTestCmds[0]);
}

@Test
Expand Down
18 changes: 18 additions & 0 deletions src/test/resources/edu/sc/seis/TauP/cmdLineTest/taup_create_--help
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
TauP_Create starting...
Usage: taup_create [arguments]
or, for purists, java edu.sc.seis.TauP.TauP_Create [arguments]

Arguments are:

To specify the velocity model:
-nd modelfile -- "named discontinuities" velocity file
-tvel modelfile -- ".tvel" velocity file, ala ttimes

--vplot file.gmt -- plot velocity as a GMT script

-debug -- enable debugging output
-verbose -- enable verbose output
-version -- print the version
-help -- print this out, but you already know that!


26 changes: 26 additions & 0 deletions src/test/resources/edu/sc/seis/TauP/cmdLineTest/taup_curve_--help
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Usage: taup_curve [arguments]
or, for purists, java edu.sc.seis.TauP.TauP_Curve [arguments]

Arguments are:
-ph phase list -- comma separated phase list
-pf phasefile -- file containing phases

-mod[el] modelname -- use velocity model "modelname" for calculations
Default is iasp91.

-h depth -- source depth in km


--gmt -- outputs curves as a complete GMT script.
-reddeg velocity -- outputs curves with a reducing velocity (deg/sec).
-redkm velocity -- outputs curves with a reducing velocity (km/sec).
-rel phasename -- outputs relative travel time
--mapwidth width -- sets map width for GMT script.

-o outfile -- output is redirected to "outfile" instead of taup_curve.gmt
--debug -- enable debugging output
--verbose -- enable verbose output
--version -- print the version
--help -- print this out, but you already know that!


37 changes: 37 additions & 0 deletions src/test/resources/edu/sc/seis/TauP/cmdLineTest/taup_path_--help
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Usage: taup_path [arguments]
or, for purists, java edu.sc.seis.TauP.TauP_Path [arguments]

Arguments are:
-ph phase list -- comma separated phase list
-pf phasefile -- file containing phases

-mod[el] modelname -- use velocity model "modelname" for calculations
Default is iasp91.

-h depth -- source depth in km

--stadepth depth -- receiver depth in km

Distance is given by:

-deg degrees -- distance in degrees,
-km kilometers -- distance in kilometers,
assumes radius of earth is 6371km,

or by giving the station and event latitude and lonitude,
assumes a spherical earth,

-sta[tion] lat lon -- sets the station latitude and longitude
-evt lat lon -- sets the event latitude and longitude


--gmt -- outputs path as a complete GMT script.
--svg -- outputs path as a complete SVG file.
--mapwidth -- sets map width for GMT script.

-o [stdout|outfile] -- output is redirected to stdout or to the "outfile" file
--debug -- enable debugging output
--verbose -- enable verbose output
--version -- print the version
--help -- print this out, but you already know that!

52 changes: 52 additions & 0 deletions src/test/resources/edu/sc/seis/TauP/cmdLineTest/taup_pierce_--help
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Usage: taup_pierce [arguments]
or, for purists, java edu.sc.seis.TauP.TauP_Pierce [arguments]

Arguments are:
-ph phase list -- comma separated phase list
-pf phasefile -- file containing phases

-mod[el] modelname -- use velocity model "modelname" for calculations
Default is iasp91.

-h depth -- source depth in km

--stadepth depth -- receiver depth in km

Distance is given by:

-deg degrees -- distance in degrees,
-km kilometers -- distance in kilometers,
assumes radius of earth is 6371km,

or by giving the station and event latitude and lonitude,
assumes a spherical earth,

-sta[tion] lat lon -- sets the station latitude and longitude
-evt lat lon -- sets the event latitude and longitude


-az azimuth -- sets the azimuth (event to station)
used to output lat and lon of pierce points
if the event lat lon and distance are also
given. Calculated if station and event
lat and lon are given.
-baz backazimuth -- sets the back azimuth (station to event)
used to output lat and lon of pierce points
if the station lat lon and distance are also
given. Calculated if station and event
lat and lon are given.

-rev -- only prints underside and bottom turn points, e.g. ^ and v
-turn -- only prints bottom turning points, e.g. v
-under -- only prints underside reflection points, e.g. ^

-pierce depth -- adds depth for calculating pierce points
-nodiscon -- only prints pierce points for the depths added with -pierce


-o [stdout|outfile] -- output is redirected to stdout or to the "outfile" file
--debug -- enable debugging output
--verbose -- enable verbose output
--version -- print the version
--help -- print this out, but you already know that!

24 changes: 24 additions & 0 deletions src/test/resources/edu/sc/seis/TauP/cmdLineTest/taup_table_--help
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Usage: taup_table [arguments]
or, for purists, java edu.sc.seis.TauP.TauP_Table [arguments]

Arguments are:
-ph phase list -- comma separated phase list
-pf phasefile -- file containing phases

-mod[el] modelname -- use velocity model "modelname" for calculations
Default is iasp91.


-header filename -- reads depth and distance spacing data
from a LOCSAT style file.
-generic -- outputs a "generic" ascii table

-locsat -- outputs a "locsat" style ascii table


-o [stdout|outfile] -- output is redirected to stdout or to the "outfile" file
--debug -- enable debugging output
--verbose -- enable verbose output
--version -- print the version
--help -- print this out, but you already know that!

40 changes: 40 additions & 0 deletions src/test/resources/edu/sc/seis/TauP/cmdLineTest/taup_time_--help
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Usage: taup_time [arguments]
or, for purists, java edu.sc.seis.TauP.TauP_Time [arguments]

Arguments are:
-ph phase list -- comma separated phase list
-pf phasefile -- file containing phases

-mod[el] modelname -- use velocity model "modelname" for calculations
Default is iasp91.

-h depth -- source depth in km

--stadepth depth -- receiver depth in km

Distance is given by:

-deg degrees -- distance in degrees,
-km kilometers -- distance in kilometers,
assumes radius of earth is 6371km,

or by giving the station and event latitude and lonitude,
assumes a spherical earth,

-sta[tion] lat lon -- sets the station latitude and longitude
-evt lat lon -- sets the event latitude and longitude


--rayp -- only output the ray parameter
--time -- only output travel time
--rel phasename -- also output relative travel time

--json -- output travel times as json


-o [stdout|outfile] -- output is redirected to stdout or to the "outfile" file
--debug -- enable debugging output
--verbose -- enable verbose output
--version -- print the version
--help -- print this out, but you already know that!

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Usage: taup_wavefront [arguments]
or, for purists, java edu.sc.seis.TauP.TauP_Wavefront [arguments]

Arguments are:
-ph phase list -- comma separated phase list
-pf phasefile -- file containing phases

-mod[el] modelname -- use velocity model "modelname" for calculations
Default is iasp91.

-h depth -- source depth in km

--stadepth depth -- receiver depth in km

Distance is given by:

-deg degrees -- distance in degrees,
-km kilometers -- distance in kilometers,
assumes radius of earth is 6371km,

or by giving the station and event latitude and lonitude,
assumes a spherical earth,

-sta[tion] lat lon -- sets the station latitude and longitude
-evt lat lon -- sets the event latitude and longitude


--rays num -- number of raypaths/distances to sample.
--timestep num -- steps in time (seconds) for output.
--timefiles -- outputs each time into a separate .ps file within the gmt script.
--negdist -- outputs negative distance as well so wavefronts are in both halves.

-o [stdout|outfile] -- output is redirected to stdout or to the "outfile" file
--debug -- enable debugging output
--verbose -- enable verbose output
--version -- print the version
--help -- print this out, but you already know that!

0 comments on commit 6c3bf74

Please sign in to comment.