Getting Help
In addition to the Juypter notebooks and online tutorial guide, other sources of help are available:
Examples
Several worked examples exist throughout these documents, in addition to examples.jl and the interactive tutorial.
Invoke the command-prompt examples with the following command sequence:
p = pathof(SeisBase)
d = dirname(realpath(p))
cd(d)
include("../test/examples.jl")
Tests
The commands in tests/ can be used as templates; to install test data and run all tests, execute these commands:
using Pkg
Pkg.test("SeisBase") # lunch break recommended. Tests can take 20 minutes.
# 99.5% code coverage wasn't an accident...
p = pathof(SeisBase)
cd(realpath(dirname(p) * "/../test/"))
Command-Line Help
A great deal of additional help functions are available at the Julia command prompt. All SeisBase functions and structures have their own docstrings. For example, typing ?SeisData
at the Julia prompt produces the following:
SeisBase.SeisData
— TypeSeisData
A custom structure designed to contain the minimum necessary information for processing univariate geophysical data.
SeisChannel
A single channel designed to contain the minimum necessary information for processing univariate geophysical data.
Fields
Field | Description |
---|---|
:n | Number of channels [1] |
:c | TCP connections feeding data to this object [1] |
:id | Channel id. Uses NET.STA.LOC.CHA format when possible |
:name | Freeform channel name |
:loc | Location (position) vector; any subtype of InstrumentPosition |
:fs | Sampling frequency in Hz; fs=0.0 for irregularly-sampled data. |
:gain | Scalar gain |
:resp | Instrument response; any subtype of InstrumentResponse |
:units | String describing data units. UCUM standards are assumed. |
:src | Freeform string describing data source. |
:misc | Dictionary for non-critical information. |
:notes | Timestamped notes; includes automatically-logged information. |
:t | Matrix of time gaps in integer μs, formatted [Sample# Length] |
:x | Time-series data |
- Not present in SeisChannel objects.
See also: InstrumentPosition
, PZResp
Dedicated Help Functions
These functions take no arguments and dump information to stdout.
Submodule SEED
SeisBase.SEED.dataless_support
— Functiondataless_support()
Output lists of supported blockettes in dataless SEED to stdout.
SeisBase.SEED.mseed_support
— Functionmseed_support()
Output lists of supported blockettes in mini-SEED to stdout.
SeisBase.SEED.resp_wont_read
— Functionresp_wont_read()
Output "hall of shame" of known examples of broken RESP to stdout.
SeisBase.SEED.seed_support
— Functionseed_support()
Output full information on SEED support to stdout.
Submodule SUDS
SeisBase.SUDS.suds_support
— Functionsuds_support()
Dump info to STDOUT on support for each SUDS structure type.
- Green structures are fully supported and read into memory.
- Yellow structures can be dumped to stdout by invoking read_data("suds", ...) with high verbosity (v=2).
- Red structures are unsupported and have not been seen in available test data.
Formats Guide
formats is a constant static dictionary with descriptive entries of each data format. Access the list of formats with sort(keys(formats))
. Then try a command like formats["slist"]
for detailed info. on the slist format.
Help-Only Functions
These functions contain help docstrings but execute nothing. They exist to answer common questions.
SeisBase.web_chanspec
— Functionweb_chanspec
Specifying Channel IDs in Web Requests
Str | L | Meaning | Example |
---|---|---|---|
NET | 2 | Network code | "IU" |
STA | 5 | Station code | "ANMO" |
LOC | 2 | Location identifier | "00" |
CHA | 3 | Channel code | "BHZ" |
A channel is uniquely specified by four substrings (NET, STA, LOC, CHA), which can be formatted as a String or a String array. Each substring has a maximum safe length of L
characters (column 2 in the table).
Acceptable Channel ID Formats
Type | Example |
---|---|
String | "PB.B004.01.BS1, PB.B004.01.BS2" |
Array{String, 1} | ["PB.B004.01.BS1","PB.B004.01.BS2"] |
Array{String, 2} | ["PB" "B004" "01" "BS?"; "PB" "B001" "01" "BS?"] |
The LOC
field can be blank in FDSN requests with getdata; for example, `chans="UW.ELK..EHZ"; getdata("FDSN", chans)`.
SeedLink only
For SeedLink functions (seedlink!
, has_stream
, etc.), channel IDs can include a fifth field (i.e. NET.STA.LOC.CHA.T) to set the "type" flag (one of DECOTL, for Data, Event, Calibration, blOckette, Timing, or Logs). Note that SeedLink calibration, timing, and logs are not in the scope of SeisBase.
See also: get_data
, seedlink
Answers: how do I specify channels in a web request? Outputs channel id syntax to stdout.
SeisBase.seis_www
— ConstantString | Source |
---|---|
BGR | http://eida.bgr.de |
EMSC | http://www.seismicportal.eu |
ETH | http://eida.ethz.ch |
GEONET | http://service.geonet.org.nz |
GFZ | http://geofon.gfz-potsdam.de |
ICGC | http://ws.icgc.cat |
INGV | http://webservices.ingv.it |
IPGP | http://eida.ipgp.fr |
IRIS | http://service.iris.edu |
IRISPH5 | http://service.iris.edu/ph5ws/ |
ISC | http://isc-mirror.iris.washington.edu |
KOERI | http://eida.koeri.boun.edu.tr |
LMU | http://erde.geophysik.uni-muenchen.de |
NCEDC | http://service.ncedc.org |
NIEP | http://eida-sc3.infp.ro |
NOA | http://eida.gein.noa.gr |
ORFEUS | http://www.orfeus-eu.org |
RESIF | http://ws.resif.fr |
SCEDC | http://service.scedc.caltech.edu |
TEXNET | http://rtserve.beg.utexas.edu |
USGS | http://earthquake.usgs.gov |
USP | http://sismo.iag.usp.br |
Answers: which servers are available for FDSN queries? Outputs the FDSN server list to stdout.
SeisBase.TimeSpec
— TypeTimeSpec = Union{Real, DateTime, String}
Time Specification
Most functions that allow time specification use two reserved keywords to track time: s
(start/begin) time and t
(termination/end) time. Exact behavior of each is given in the table below.
- Real numbers are interpreted as seconds
- DateTime values are as in the Dates package
- Strings should use ISO 8601 without time zone (
YYYY-MM-DDThh:mm:ss.s
); UTC is assumed. Equivalent Unixstrftime
format codes are%Y-%m-%dT%H:%M:%S
or%FT%T
.
parsetimewin Behavior
In all cases, parsetimewin outputs a pair of strings, sorted so that the first string corresponds to the earlier start time.
typeof(s) | typeof(t) | Behavior |
---|---|---|
DateTime | DateTime | sort |
DateTime | Real | add t seconds to s, then sort |
DateTime | String | convert t => DateTime, then sort |
DateTime | String | convert t => DateTime, then sort |
Real | DateTime | add s seconds to t, then sort |
Real | Real | treat s, t as seconds from current time; sort |
String | DateTime | convert s => DateTime, then sort |
String | Real | convert s => DateTime, then sort |
Special behavior with (Real, Real): s and t are converted to seconds from the start of the current minute. Thus, for s=0
(the default), the data request begins (or ends) at the start of the minute in which the request is submitted.
See also: Dates.DateTime
All About Keywords
Invoke keywords help with ?SeisBase.KW for complete information on SeisBase shared keywords and meanings.