Appendices
Time Syntax
Functions that allow time specification use two reserved keywords or arguments to track time:
- s: Start (begin) time
- t: Termination (end) time
Specify each as a DateTime, Real, or String.
Real numbers are interpreted as seconds. Special behavior is invoked when both s and t are of Type Real.
DateTime values should follow
Julia documentation\ <https://docs.julialang.org/en/v1/stdlib/Dates/>
_Strings have the expected format spec
YYYY-MM-DDThh:mm:ss.ssssss
Fractional second is optional and accepts up to 6 decimal places (μs)
Incomplete time Strings treat missing fields as 0.
Example:
s="2016-03-23T11:17:00.333"
It isn't necessary to choose values so that s ≤ t. The two values are always sorted, so that t < s doesn't error.
Time Types and Behavior
typeof(s) | typeof(t) | Behavior |
---|---|---|
DateTime | DateTime | convert to String, then sort |
DateTime | Real | add t seconds to s, convert to String, then sort |
DateTime | String | convert s to String, then sort |
Real | DateTime | add s seconds to t, convert to String, then sort |
Real | Real | treat as relative (see below), convert to String, sort |
Real | String | add s seconds to t, convert to String, then sort |
String | DateTime | convert t to String, then sort |
String | Real | add t seconds to s, convert to String, then sort |
String | String | sort |
Special Behavior with two Real arguments
If s and t are both Real numbers, they're treated as seconds measured relative to the start of the current minute. This convention may seem unusual, but it greatly simplifies web requests; for example, specifying s=-1200.0, t=0.0 is a convenient shorthand for "the last 20 minutes of data".
Data Requests Syntax
Channel ID Syntax
NN.SSSSS.LL.CC
(net.sta.loc.cha, separated by periods) is the expected syntax for all web functions. The maximum field width in characters corresponds to the length of each field (e.g. 2 for network). Fields can't contain whitespace.
NN.SSSSS.LL.CC.T
(net.sta.loc.cha.tflag) is allowed in SeedLink. T
is a single-character data type flag and must be one of DECOTL
: Data, Event, Calibration, blOckette, Timing, or Logs. Calibration, timing, and logs are not in the scope of SeisBase and may crash SeedLink sessions.
The table below specifies valid types and expected syntax for channel lists.
Type | Description | Example |
---|---|---|
String | Comma-delineated list of IDs | \"PB.B004.01.BS1, PB.B002.01.BS1\" |
Array{String,1} | String array, one ID string per entry | [\"PB.B004.01.BS1\", \"PB.B002.01.BS1\"] |
Array{String,2} | String array, one set of IDs per row | [\"PB\" \"B004\" \"01\" \"BS1\"; |
\"PB\" \"B002\" \"01\" \"BS1\"] |
The expected component order is always network, station, location, channel; thus, "UW.TDH..EHZ" is OK, but "UW.TDH.EHZ" fails.
chanspec()
I can't find chanspec() anywhere ... maybe it's web_chanspec()?
Type ?chanspec
in Julia to print the above info. to stdout.
Wildcards and Blanks
Allowed wildcards are client-specific.
- The LOC field can be left blank in any client:
"UW.ELK..EHZ"
and["UW" "ELK" "" "EHZ"]
are all valid. Blank LOC fields are set to--
in IRIS,*
in FDSN, and??
in SeedLink. ?
acts as a single-character wildcard in FDSN & SeedLink. Thus,CC.VALT..???
is valid.*
acts as a multi-character wildcard in FDSN. Thus,CC.VALT..*
andCC.VALT..???
behave identically in FDSN.- Partial specifiers are OK, but a network and station are always required:
"UW.EL?"
is OK,".ELK.."
fails.
Channel Configuration Files
One entry per line, ASCII text, format NN.SSSSS.LL.CCC.D. Due to client-specific wildcard rules, the most versatile configuration files are those that specify each channel most completely:
# This only works with SeedLink
GE.ISP..BH?.D
NL.HGN
MN.AQU..BH?
MN.AQU..HH?
UW.KMO
CC.VALT..BH?.D
# This works with FDSN and SeedLink, but not IRIS
GE.ISP..BH?
NL.HGN
MN.AQU..BH?
MN.AQU..HH?
UW.KMO
CC.VALT..BH?
# This works with all three:
GE.ISP..BHZ
GE.ISP..BHN
GE.ISP..BHE
MN.AQU..BHZ
MN.AQU..BHN
MN.AQU..BHE
MN.AQU..HHZ
MN.AQU..HHN
MN.AQU..HHE
UW.KMO..EHZ
CC.VALT..BHZ
CC.VALT..BHN
CC.VALT..BHE
Server List
String | 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 |
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 |
SeisBase Standard Keywords
SeisBase.KW is a memory-resident structure of default values for common keywords used by package functions. KW has one substructure, SL, with keywords specific to SeedLink. These defaults can be modified, e.g., SeisBase.KW.nev=2 changes the default for nev to 2.
KW | Default | T [1 ]_ | Meaning |
---|---|---|---|
comp | 0x00 | U8 | compress data on write? [2 ] |
fmt | "miniseed" | S | request data format [3 ] |
mag | [6.0, 9.9] | A{F,1} | magnitude range for queries |
n_zip | 100000 | I | compress if length(:x) > n_zip |
nd | 1 | I | number of days per subrequest |
nev | 1 | I | number of events returned per query |
nx_add | 360000 | I | length increase of undersized data array |
nx_new | 8640000 | I | number of samples for a new channel |
opts | "" | S | user-specified options [4 ] |
prune | true | B | call prune! after get_data? |
rad | [] | A{F,1} | radial search region [5 ] |
reg | [] | A{F,1} | rectangular search region [6 ] |
si | true | B | autofill station info on data req? [7 ] |
src | "IRIS" | S | data source; type ?seis_www for list |
to | 30 | I | read timeout for web requests (s) |
v | 0 | I | verbosity |
w | false | B | write requests to disk? [8 ] |
y | false | B | sync data after web request? |
.. rubric:: Table Footnotes .. [1
] Types: A = Array, B = Boolean, C = Char, DT = DateTime, F = Float, I = Integer, S = String, U8 = Unsigned 8-bit integer (UInt8) .. [2
] If KW.comp == 0x00, never compress data; if KW.comp == 0x01, only compress channel i if length(S.x[i]) > KW.n_zip; if comp == 0x02, always compress data. .. [3
] Strings have the same names and spellings as file formats in read_data
. Note that "sac" in a web request is aliased to "sacbl", i.e., binary little-endian SAC, to match the native endianness of the Julia language. .. [4
] String is passed as-is, e.g. "szsrecs=true&repo=realtime" for FDSN. String should not begin with an ampersand. .. [5
] Specify region [centerlat, centerlon, minradius, maxradius, depmin, depmax], with lat, lon, and radius in decimal degrees (°) and depth in km with + = down. Depths are only used for earthquake searches. .. [6
] Specify region [latmin, latmax, lonmin, lonmax, depmin, depmax], with lat, lon in decimal degrees (°) and depth in km with + = down. Depths are only used for earthquake searches. .. [7
] FDSNWS timeseries only. .. [8
] If w=true, a file name is automatically generated from the request parameters, in addition to parsing data to a SeisData structure. Files are created from the raw download even if data processing fails, in contrast to getdata(... wsac=true). .. _functionlist:
Utility Functions
This appendix covers utility functions that belong in no other category.
SeisBase.d2u
— FunctionAlias to Dates.datetime2unix
SeisBase.u2d
— FunctionAlias to Dates.unix2datetime
SeisBase.fctoresp
— Functionfctoresp(f)
fctoresp(f, c)
Create PZResp or PZResp64 instrument response from lower corner frequency f
and damping constant c
. If no damping constant is supplies, assumes c = 1/sqrt(2)
.
See also: PZResp
, PZResp64
SeisBase.regex_find
— Functionregex_find(path::String, r::Regex)
OS-agnostic equivalent to Linux find
. First argument is a path string, second is a Regex.
File strings are postprocessed using Julia's native PCRE Regex engine. By design, find_regex
only returns file names.
SeisBase.getbandcode
— Functiongetbandcode(fs, fc=FC)
Get SEED-compliant one-character band code corresponding to instrument sample rate fs
and corner frequency FC
. If unset, FC
is assumed to be 1 Hz.
SeisBase.get_seis_channels
— Functionget_seis_channels(S::GphysData)
Get an array with the channel numbers of all seismic data channels in S
.
Assumes each ID in S ends with an alphanumeric three-digit channel code and that ID fields are separated by periods: for example, two channels with IDs "XX.YYY.00.EHZ" and "_.YHY" both have an instrument code of 'H'.
Channel codes less than two characters long (e.g. "Z" in "AA.BBB.CC.Z") are ignored.
SEED channel codes of seismic and seismoacoustic data (for which operations like detrend! and taper! are sane) include D, G, H, J, L, M, N, P, Z.
See also: inst_codes
SeisBase.guess
— Functionfunction guess(fname[, v=V])
Try to guess the file type of file fname
. Keyword v
controls verbosity. Only recognizes file formats supported by SeisBase.read_data.
Returns a tuple: (ftype::String, swap::Bool)
ftype
is the file type string to pass toread_data
, except in these cases:- if ftype == "unknown", guess couldn't identify the file type.
- if ftype contains a comma-separated list, the file type couldn't be
swap
determines whether or not file should be byte-swapped byread_data
.
Generally swap=true
for big-Endian files, with two exceptions:
- in SAC and mini-SEED, tests for endianness are built into the file format,
so the value of swap
is irrelevant.
- if ftype = "unknown", swap=nothing is possible.
Warnings
- false positives are possible for file formats outside the scope of SeisBase.
- SEGY endianness isn't reliable. In theory, SEGY headers are bigendian; in
practice, SEGY headers are whatever the manufacturer imagines them to be, and endianness can be little, or mixed (e.g., a common situation is little-endian file header and big-endian trace header).
SeisBase.inst_codes
— Functioninst_codes(S::GphysData)
Get the instrument code of each channel in S
.
inst_code(S::GphysData, i::Integer)
Get the instrument code of channel i
.
inst_code(C::GphysChannel)
Get the instrument code from C.id
.
Assumes each ID ends with an alphanumeric three-digit channel code and that ID fields are separated by periods: for example, two channels with IDs "XX.YYY.00.EHZ" and "_.YHY" each have an instrument code of 'H'.
Channel codes less than two characters long (e.g. "Z" in "AA.BBB.CC.Z") are ignored.
SEED channel codes of seismic and seismoacoustic data (for which operations like detrend!
and taper!
are sane) include D, G, H, J, L, M, N, P, Z.
SEED channel codes of seismometers (for which translate_resp!
and remove_resp!
are sane) are H, J, L, M, N, P, Z.
SeisBase.inst_code
— Functioninst_codes(S::GphysData)
Get the instrument code of each channel in S
.
inst_code(S::GphysData, i::Integer)
Get the instrument code of channel i
.
inst_code(C::GphysChannel)
Get the instrument code from C.id
.
Assumes each ID ends with an alphanumeric three-digit channel code and that ID fields are separated by periods: for example, two channels with IDs "XX.YYY.00.EHZ" and "_.YHY" each have an instrument code of 'H'.
Channel codes less than two characters long (e.g. "Z" in "AA.BBB.CC.Z") are ignored.
SEED channel codes of seismic and seismoacoustic data (for which operations like detrend!
and taper!
are sane) include D, G, H, J, L, M, N, P, Z.
SEED channel codes of seismometers (for which translate_resp!
and remove_resp!
are sane) are H, J, L, M, N, P, Z.
SeisBase.ls
— Functionls(str::String)
Similar functionality to Bash ls with OS-agnostic output. Accepts wildcards in paths and file names.
Always returns the full path and file name.
Partial file name wildcards (e.g. "
ls(data/2006*.sac)
) invokeglob
.Path wildcards (e.g.
ls(/data/*/*.sac)
) invokefind_regex
to circumvent glob limitations.Passing ony "" as a filename (e.g. "`ls(/home/)
) invokes
find_regex` to recursively search subdirectories, as in the Bash shell.ls()
Return full path and file name of files in current working directory.
SeisBase.j2md
— Functionm,d = j2md(y,j)
Convert Julian day j of year y to month m, day d
SeisBase.md2j
— Functionj = md2j(y, m, d)
Convert month m
, day d
of year y
to Julian day (day of year)
SeisBase.namestrip
— Functionnamestrip(s::String, convention::String="File")
Remove bad characters from the :name fields of S. Specify convention as a string (default is "File"):
- "File" => ['<', '>', ':', '"', '/', '\', '|', '?', '*', '^', '$', '@', '~', '']
- "HTML" => ['"', '', '&', ';', '<', '>' , '©', '']
- "Julia" => ['$', '\', '']
- "Markdown" => ['!', '#', '(', ')', '*', '+', '-', '.', '[', '\', ']', '_', '`', '{', '}']
- "SEED" => ['.', '']
- "Strict" => [' ', '!', '"', '#', '$', '%', '&', ''', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '\', '^', '{', '|', '}', '~', '']
SeisBase.parsetimewin
— Function(str0, str1) = parsetimewin(ts1::TimeSpec, ts2::TimeSpec)
Convert times s
and t
to strings and sorts s.t. d0 < d1.
s
and t
can be real numbers, DateTime objects, or ASCII strings. Expected string format is "yyyy-mm-ddTHH:MM:SS.nnn", e.g. 2016-03-23T11:17:00.333.
See also: TimeSpec
SeisBase.resp_a0!
— Functionresp_a0!(R::Union{PZResp, PZResp64})
Update normalization factor R.a0
from R.z
, R.p
, and R.f0
.
resp_a0!(S::GphysData)
Call resp_a0!
on each response in S with typeof(S.resp[i]) ∈ [PZResp, PZResp64].
See also: PZResp
, PZResp64
SeisBase.resptofc
— Functionresptofc(R::Union{PZResp, PZResp64}))
Attempt to guess critical frequency of seismic instrument response R. Assumes broadband sensors behave roughly like geophones (i.e., as harmonic oscillators with a single lower corner frequency) at low frequencies.
See also: fctoresp
, PZResp
SeisBase.set_file_ver
— Functionset_file_ver(fname, ver)
Sets the SeisBase file version of file fname.
SeisBase.validate_units
— Functionvalidate_units(S::GphysData)
Test whether unit strings in S.units are valid under the UCUM standard.
validate_units(C::GphysChannel)
Test whether C.units is valid under the UCUM standard.
SeisBase.vucum
— Functionvucum(str::String)
Test whether str
is a valid UCUM unit string.
SeisBase Native Format
Invoking the command wseis writes SeisBase structures to a native data format in little-endian byte order. This page documents the low-level file format. Abbreviations used:
Type | Meaning | C | Fortran 77 |
---|---|---|---|
Char | Unicode character | wchar | CHARACTER*4 |
Float32 | 32-bit float | float | REAL |
Float64 | 64-bit float | double | REAL*8 |
Int8 | signed 8-bit int | short | INTEGER |
Int16 | signed 16-bit int | int | INTEGER*2 |
Int32 | signed 32-bit int | long | INTEGER*4 |
Int64 | signed 64-bit integer | long long | INTEGER*8 |
UInt8 | unsigned 8-bit int | unsigned short | CHARACTER |
UInt16 | unsigned 16-bit int | unsigned | |
UInt32 | unsigned 32-bit int | unsigned long | |
UInt64 | unsigned 64-bit int | unsigned long long |
Special instructions:
- Parentheses, "()", denote a custom object Type.
- "{ (condition)" denotes the start of a loop; (condition) is the control flow.
- "}" denotes the end of a loop.
Note that String in Julia has no exact C equivalence. SeisBase writes each String in two parts: an Int64 (String length in bytes) followed by the String contents (as bytes, equivalent to UInt8). Unlike C/Fortran, there are no issues with strings that contain the null character (0x00 or $'\x0'$).
SeisBase File
Var | Meaning | T | N |
---|---|---|---|
"SeisBase" | UInt8 | 6 | |
V | SeisBase file format version | Float32 | 1 |
J | # of SeisBase objects in file | UInt32 | 1 |
C | SeisBase object codes for each object | UInt32 | J |
B | Byte indices for each object | UInt64 | J |
{ | for i = 1:J | ||
(Objects) | variable | J | |
} | |||
ID | ID hashes | UInt64 | variable |
TS | Start times | Int64 | variable |
TE | End times | Int64 | variable |
P | Parent object index in C and B | variable | |
bID | Byte offset of ID array | Int64 | 1 |
bTS | Byte offset of TS array | Int64 | 1 |
bTE | Byte offset of TE array | Int64 | 1 |
bP | Byte offset of P array | Int64 | 1 |
ID, TS, and TE are the ID, data start time, and data end time of each channel in each object. P is the index of the parent object in C and B. TS and TE are measured from Unix epoch time (1970-01-01T00:00:00Z) in integer microseconds.
Intent: when seeking data from channel i
between times s
and t
, if hash(i)
matches ID[j]
and the time windows overlap, retrieve index k = P[j]
from NP, seek to byte offset B[k]
, and read an object of type C[k]
from file.
If an archive contains no data objects, ID, TS, TE, and P are empty; equivalently, bID == bTS
.
Simple Object Types
Fields of these objects are written in one of three ways: as "plain data" types, such as UInt8 or Float64; as arrays; or as strings.
In a simple object, each array is stored as follows:
- Int64 number of dimensions (e.g. 2)
- Int64 array of dimensions themselves (e.g. 2, 2)
- Array values (e.g. 0.08250153, 0.023121119, 0.6299772, 0.79595184)
EQLoc
Var | Type | N | Meaning |
---|---|---|---|
lat | Float64 | 1 | latitude |
lon | Float64 | 1 | longitude |
dep | Float64 | 1 | depth |
dx | Float64 | 1 | x-error |
dy | Float64 | 1 | y-error |
dz | Float64 | 1 | z-error |
dt | Float64 | 1 | t-error (error in origin time) |
se | Float64 | 1 | standard error |
rms | Float64 | 1 | rms pick error |
gap | Float64 | 1 | azimuthal gap |
dmin | Float64 | 1 | minimum source-receiver distance in location |
dmax | Float64 | 1 | maximum source-receiver distance in location |
nst | Int64 | 1 | number of stations used to locate earthquake |
flags | UInt8 | 1 | one-bit flags for special location properties |
Ld | Int64 | 1 | length of "datum" string in bytes |
datum | UInt8 | Ld | Datum string |
Lt | Int64 | 1 | length of "typ" (event type) string in bytes |
typ | UInt8 | Lt | earthquake type string |
Li | Int64 | 1 | length of "sig" (error significance) string in bytes |
sig | UInt8 | Li | earthquake location error significance string |
Lr | Int64 | 1 | length of "src" (data source) string in bytes |
src | UInt8 | Lr | data source string |
flag meanings: (0x01 = true, 0x00 = false)
- x fixed?
- y fixed?
- z fixed?
- t fixed?
In Julia, get the value of flag[n] with $>>(<<(flags, n-1), 7)$.
EQMag
Var | Type | N | Meaning |
---|---|---|---|
val | Float32 | 1 | magnitude value |
gap | Float64 | 1 | largest azimuthal gap between stations in magnitude |
nst | Int64 | 1 | number of stations used in magnitude computation |
Lsc | Int64 | 1 | length of magnitude scale string |
msc | UInt8 | Lsc | magnitude scale string |
Lr | Int64 | 1 | length of data source string |
src | UInt8 | Lr | data source string |
SeisPha
Var | Type | N | Meaning |
---|---|---|---|
F | Float64 | 8 | amplitude, distance, incidence angle, residual, |
ray parameter, takeoff angle, travel time, uncertainty | |||
C | Char | 2 | polarity, quality |
SourceTime
Var | Type | N | Meaning |
---|---|---|---|
Ld | Int64 | 1 | size of descriptive string in bytes |
desc | UInt8 | 1 | descriptive string |
F | Float64 | 3 | duration, rise time, decay time |
StringVec
A vector of variable-length strings; its exact Type in Julia is Array{String,1}.
.. csv-table:: StringVec :header: Var, Type, N, Meaning :widths: 1, 1, 1, 8
Var | Type | N | Meaning |
---|---|---|---|
ee | UInt8 | 1 | is this string vector empty? [1 ] |
L | Int64 | 1 | number of strings to read |
{ | i = 1:L | ||
nb | Int64 | 1 | length of string in bytes |
str | UInt8 | nb | string |
} |
- [
1
] Ifee == 0x00
, then no values are stored for L, nb, or str.
Location Types
GenLoc
Var | Type | N | Meaning |
---|---|---|---|
Ld | Int64 | 1 | length of datum string in bytes |
datum | UInt8 | Ld | datum string |
Ll | Int64 | 1 | length of location vector in bytes |
loc | Float64 | Ll | location vector |
GeoLoc
Var | Type | N | Meaning |
---|---|---|---|
Ld | Int64 | 1 | length of datum string in bytes |
datum | UInt8 | Ld | datum string |
F | Float64 | 6 | latitude, longitude, elevation, |
depth, azimuth, incidence |
UTMLoc
Var | Type | N | Meaning |
---|---|---|---|
Ld | Int64 | 1 | length of datum string in bytes |
datum | UInt8 | N | datum string |
zone | Int8 | 1 | UTM zone number |
hemi | Char | 1 | hemisphere |
E | UInt64 | 1 | Easting |
N | UInt64 | 1 | Northing |
F | Float64 | 4 | elevation, depth, azimuth, incidence |
XYLoc
Var | Type | N | Meaning |
---|---|---|---|
Ld | Int64 | 1 | Length of datum string in bytes |
datum | UInt8 | Ld | datum string |
F | Float64 | 8 | x, y, z, azimuth, incidence, origin x, origin y, origin z |
Response Types
GenResp
Var | Type | N | Meaning |
---|---|---|---|
Ld | Int64 | 1 | length of descriptive string in bytes |
desc | UInt8 | Ld | descriptive string |
nr | Int64 | 1 | Number of rows in complex response matrix |
nc | Int64 | 1 | Number of columns in complex response matrix |
resp | Complex{Float64,2} | nr*nc | complex response matrix |
PZResp
Var | Type | N | Meaning |
---|---|---|---|
c | Float32 | 1 | damping constant |
np | Int64 | 1 | number of complex poles |
p | Complex{Float32,1} | np | complex poles vector |
nz | Int64 | 1 | number of complex zeros |
z | Complex{Float32,1} | nz | complex zeros vector |
PZResp64 is identical to PZResp with Float64 values for c, p, z, rather than Float32.
The Misc Dictionary
Most compound objects below contain a dictionary (Dict{String,Any}) for non-essential information in a field named $:misc$. The tables below describe how this field is written to disk.
Misc
.. csv-table:: :header: Var, Type, N, Meaning :widths: 1, 2, 1, 8
Var | Type | N | Meaning |
---|---|---|---|
N | Int64 | 1 | number of items in dictionary [1 ] |
K | (StringVec) | 1 | dictionary keys |
{ | for i = 1:N | ||
c | UInt8 | 1 | Type code of object i |
o | variable | 1 | object i |
} |
- [
1
] If $N == 0$, then N is the only value present.
Dictionary Contents
These subtables describe how to read the possible data types in a Misc dictionary.
String Array (c == 0x81)
Var | Type | N | Meaning |
---|---|---|---|
A | (StringVec) | 1 | string vector |
Other Array (c == 0x80 or c > 0x81)
Var | Type | N | Meaning |
---|---|---|---|
nd | Int64 | 1 | number of dimensions in array |
dims | Int64 | nd | array dimensions |
arr | varies | prod(nd) | array |
String (c == 0x01)
Var | Type | N | Meaning |
---|---|---|---|
L | Int64 | 1 | size of string in bytes |
str | UInt8 | 1 | string |
Bits Type (c == 0x00 or 0x01 < c < 0x7f)
Read a single value whose Type corresponds to the UInt8 Type code.
Compound Object Types
Each of these objects contains at least one of the above simple object types.
PhaseCat
Var | Type | N | Meaning |
---|---|---|---|
N | Int64 | 1 | number of SeisPha objects to read [1 ] |
K | (StringVec) | 1 | dictionary keys |
pha | (SeisPha) | N | seismic phases |
- [
1
] If $N == 0$, then N is the only value present.
EventChannel
A single channel of data related to a seismic event
Var | Type | N | Meaning |
---|---|---|---|
Ni | Int64 | 1 | size of id string in bytes |
id | UInt8 | Ni | id string |
Nn | Int64 | 1 | size of name string in bytes |
name | UInt8 | Nn | name string |
Lt | UInt8 | 1 | location Type codes |
loc | (Loc Type) | 1 | instrument position |
fs | Float64 | 1 | sampling frequency in Hz |
gain | Float64 | 1 | scalar gain |
Rt | UInt8 | 1 | response Type codes |
resp | (Resp Type) | 1 | instrument response |
Nu | Int64 | 1 | size of units string in bytes |
units | UInt8 | Nu | units string |
az | Float64 | 1 | azimuth |
baz | Float64 | 1 | backazimuth |
dist | Float64 | 1 | source-receiver distance |
pha | (PhaseCat) | 1 | phase catalog |
Nr | Int64 | 1 | size of data source string in bytes |
src | UInt8 | Nr | data source string |
misc | (Misc) | 1 | dictionary for non-essential information |
notes | (StringVec) | 1 | notes and automated logging |
Nt | Int64 | 1 | length of time gaps matrix |
T | Int64 | 2Nt | time gaps matrix |
Xc | UInt8 | 1 | Type code of data vector |
Nx | Int64 | 1 | number of samples in data vector |
X | variable | NX | data vector |
SeisChannel
A single channel of univariate geophysical data
Var | Type | N | Meaning |
---|---|---|---|
Ni | Int64 | 1 | size of id string in bytes |
id | UInt8 | Ni | id string |
Nn | Int64 | 1 | size of name string in bytes |
name | UInt8 | Nn | name string |
Lt | UInt8 | 1 | location Type codes |
loc | (Loc Type) | 1 | instrument position |
fs | Float64 | 1 | sampling frequency in Hz |
gain | Float64 | 1 | scalar gain |
Rt | UInt8 | 1 | response Type codes |
resp | (Resp Type) | 1 | instrument response |
Nu | Int64 | 1 | size of units string in bytes |
units | UInt8 | Nu | units string |
Nr | Int64 | 1 | size of data source string in bytes |
src | UInt8 | Nr | data source string |
misc | (Misc) | 1 | dictionary for non-essential information |
notes | (StringVec) | 1 | notes and automated logging |
Nt | Int64 | 1 | length of time gaps matrix |
T | Int64 | 2Nt | time gaps matrix |
Xc | UInt8 | 1 | Type code of data vector |
Nx | Int64 | 1 | number of samples in data vector |
X | variable | NX | data vector |
EventTraceData
A multichannel record of time-series data related to a seismic event.
Var | Type | N | Meaning |
---|---|---|---|
N | Int64 | 1 | number of data channels |
Lc | UInt8 | N | location Type codes for each data channel |
Rc | UInt8 | N | response Type codes for each data channel |
Xc | UInt8 | N | data Type code for each data channel |
cmp | UInt8 | 1 | are data compressed? (0x01 = yes) |
Nt | Int64 | N | number of rows in time gaps matrix for each channel |
Nx | Int64 | N | length of data vector for each channel [1 ] |
id | (StringVec) | 1 | channel ids |
name | (StringVec) | 1 | channel names |
loc | (Loc Type) | N | instrument positions |
fs | Float64 | N | sampling frequencies of each channel in Hz |
gain | Float64 | N | scalar gains of each channel |
resp | (Resp Type) | N | instrument responses |
units | (StringVec) | 1 | units of each channel's data |
az | Float64 | N | event azimuth |
baz | Float64 | N | backazimuths to event |
dist | Float64 | N | source-receiver distances |
pha | (PhaseCat) | N | phase catalogs for each channel |
src | (StringVec) | 1 | data source strings for each channel |
misc | (Misc) | N | dictionaries of non-essential information for each channel |
notes | (StringVec) | N | notes and automated logging for each channel |
{ | for i = 1:N | ||
T | Int64 | 2Nt[i] | Matrix of time gaps for channel i |
} | |||
{ | for i = 1:N | ||
X | Xc[i] | Nx[i] | Data vector i [2 ] |
} |
- [
1
] If cmp == 0x01, each value in Nx is the number of bytes of compressed data to read; otherwise, this is the number of samples in each channel. - [
2
] If cmp == 0x01, read Nx[i] samples of type UInt8 and pass through lz4 decompression to generate data vector i; else read Nx[i] samples of the type corresponding to code Xc[i].
SeisData
A record containing multiple channels of univariate geophysical data.
Var | Type | N | Meaning |
---|---|---|---|
N | Int64 | 1 | number of data channels |
Lc | UInt8 | N | location Type codes for each data channel |
Rc | UInt8 | N | response Type codes for each data channel |
Xc | UInt8 | N | data Type code for each data channel |
cmp | UInt8 | 1 | are data compressed? (0x01 = yes) |
Nt | Int64 | N | number of rows in time gaps matrix for each channel |
Nx | Int64 | N | length of data vector for each channel [1 ] |
id | (StringVec) | 1 | channel ids |
name | (StringVec) | 1 | channel names |
loc | (Loc Type) | N | instrument positions |
fs | Float64 | N | sampling frequencies of each channel in Hz |
gain | Float64 | N | scalar gains of each channel |
resp | (Resp Type) | N | instrument responses |
units | (StringVec) | 1 | units of each channel's data |
src | (StringVec) | 1 | data source strings for each channel |
misc | (Misc) | N | dictionaries of non-essential information for each channel |
notes | (StringVec) | N | notes and automated logging for each channel |
{ | for i = 1:N | ||
T | Int64 | 2Nt[i] | Matrix of time gaps for channel i |
} | |||
{ | for i = 1:N | ||
X | Xc[i] | Nx[i] | Data vector i [2 ] |
} |
- [
1
] If cmp == 0x01, each value in Nx is the number of bytes of compressed data to read; otherwise, this is the number of samples in each channel. - [
2
] If cmp == 0x01, read Nx[i] samples of type UInt8 and pass through lz4 decompression to generate data vector i; else read Nx[i] samples of the type corresponding to code Xc[i].
SeisHdr
Var | Type | N | Meaning |
---|---|---|---|
Li | Int64 | 1 | length of event ID string |
id | UInt8 | Li | event ID string |
iv | UInt8 | 1 | intensity value |
Ls | Int64 | 1 | length of intensity scale string |
isc | UInt8 | Ls | intensity scale string |
loc | (EQLoc) | 1 | earthquake location |
mag | (EQMag) | 1 | earthquake magnitude |
misc | (Misc) | 1 | dictionary containing non-essential information |
notes | (StringVec) | 1 | notes and automated logging |
ot | Int64 | 1 | origin time [1 ] |
Lr | Int64 | 1 | length of data source string |
src | UInt8 | Lr | data source string |
Lt | Int64 | 1 | length of event type string |
typ | UInt8 | Lt | event type string |
- [
1
] Measured from Unix epoch time (1970-01-01T00:00:00Z) in integer microseconds
SeisSrc
Var | Type | N | Meaning |
---|---|---|---|
Li | Int64 | 1 | length of source id string |
id | UInt8 | Li | id string |
Le | Int64 | 1 | length of event id string |
eid | UInt8 | Le | event id string |
m0 | Float64 | 1 | scalar moment |
Lm | Int64 | 1 | length of moment tensor vector |
mt | Float64 | Lm | moment tensor vector |
Ld | Int64 | 1 | length of moment tensor misfit vector |
dm | Float64 | Ld | moment tensor misfit vector |
np | Int64 | 1 | number of polarities |
gap | Float64 | 1 | max. azimuthal gap |
pad | Int64 | 2 | dimensions of principal axes matrix |
pax | Float64 | pad[1]*pad[2] | principal axes matrix |
pld | Int64 | 2 | dimensions of nodal planes matrix |
planes | Float64 | pld[1]*pld[2] | nodal planes matrix |
Lr | Int64 | 1 | length of data source string |
src | UInt8 | 1 | data source string |
st | (SourceTime) | 1 | source-time description |
misc | (Misc) | 1 | Dictionary containing non-essential information |
notes | (StringVec) | 1 | Notes and automated logging |
SeisEvent
Var | Type | N | Meaning |
---|---|---|---|
hdr | (SeisHdr) | 1 | event header |
source | (SeisSrc) | 1 | event source process |
data | (EventTraceData) | 1 | event trace data |
Data Type Codes
Each Type code is written to disk as a UInt8, with the important exception of SeisBase custom object Type codes (which use UInt32).
Loc Type Codes
UInt8 | Type |
---|---|
0x00 | GenLoc |
0x01 | GeoLoc |
0x02 | UTMLoc |
0x03 | XYLoc |
Resp Type Codes
UInt8 | Type |
---|---|
0x00 | GenResp |
0x01 | PZResp |
0x02 | PZResp64 |
Other Type Codes
Only the Types below are faithfully preserved in write/read of a :misc field dictionary; other Types are not written to file and can cause $wseis$ to throw errors.
Type | UInt8 | Type | UInt8 |
---|---|---|---|
Char | 0x00 | Array{Char,N} | 0x80 |
String | 0x01 | Array{String,N} | 0x81 |
UInt8 | 0x10 | Array{UInt8,N} | 0x90 |
UInt16 | 0x11 | Array{UInt16,N} | 0x91 |
UInt32 | 0x12 | Array{UInt32,N} | 0x92 |
UInt64 | 0x13 | Array{UInt64,N} | 0x93 |
UInt128 | 0x14 | Array{UInt128,N} | 0x94 |
Int8 | 0x20 | Array{Int8,N} | 0xa0 |
Int16 | 0x21 | Array{Int16,N} | 0xa1 |
Int32 | 0x22 | Array{Int32,N} | 0xa2 |
Int64 | 0x23 | Array{Int64,N} | 0xa3 |
Int128 | 0x24 | Array{Int128,N} | 0xa4 |
Float16 | 0x30 | Array{Float16,N} | 0xb0 |
Float32 | 0x31 | Array{Float32,N} | 0xb1 |
Float64 | 0x32 | Array{Float64,N} | 0xb2 |
Complex{UInt8} | 0x50 | Array{Complex{UInt8},N} | 0xd0 |
Complex{UInt16} | 0x51 | Array{Complex{UInt16},N} | 0xd1 |
Complex{UInt32} | 0x52 | Array{Complex{UInt32},N} | 0xd2 |
Complex{UInt64} | 0x53 | Array{Complex{UInt64},N} | 0xd3 |
Complex{UInt128} | 0x54 | Array{Complex{UInt128},N} | 0xd4 |
Complex{Int8} | 0x60 | Array{Complex{Int8},N} | 0xe0 |
Complex{Int16} | 0x61 | Array{Complex{Int16},N} | 0xe1 |
Complex{Int32} | 0x62 | Array{Complex{Int32},N} | 0xe2 |
Complex{Int64} | 0x63 | Array{Complex{Int64},N} | 0xe3 |
Complex{Int128} | 0x64 | Array{Complex{Int128},N} | 0xe4 |
Complex{Float16} | 0x70 | Array{Complex{Float16},N} | 0xf0 |
Complex{Float32} | 0x71 | Array{Complex{Float32},N} | 0xf1 |
Complex{Float64} | 0x72 | Array{Complex{Float64},N} | 0xf2 |
SeisBase Object Type codes
UInt32 Code | Object Type |
---|---|
0x20474330 | EventChannel |
0x20474331 | SeisChannel |
0x20474430 | EventTraceData |
0x20474431 | SeisData |
0x20495030 | GenLoc |
0x20495031 | GeoLoc |
0x20495032 | UTMLoc |
0x20495033 | XYLoc |
0x20495230 | GenResp |
0x20495231 | PZResp64 |
0x20495232 | PZResp |
0x20504330 | PhaseCat |
0x20534530 | SeisEvent |
0x20534830 | SeisHdr |
0x20535030 | SeisPha |
0x20535330 | SeisSrc |
0x20535430 | SourceTime |
0x45514c30 | EQLoc |
0x45514d30 | EQMag |
File Format Version History
File format versions <0.50 are no longer supported; please email us if you need to read in very old data.
Version | Date | Change |
---|---|---|
0.53 | 2019-09-11 | removed :i, :o from CoeffResp |
added :i, :o to MultiStageResp | ||
0.52 | 2019-09-03 | added CoeffResp, MultiStageResp |
0.51 | 2019-08-01 | added :f0 to PZResp, PZResp64 |
0.50 | 2019-06-05 | all custom Types can now use write() directly |
rewrote how :misc is stored | ||
Type codes for :misc changed | ||
deprecated BigFloat/BigInt support in :misc | ||
:n is no longer stored as a UInt32 | ||
:x compression no longer automatic | ||
:x compression changed from Blosc to lz4 |