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 st. The two values are always sorted, so that t < s doesn't error.

Time Types and Behavior

typeof(s)typeof(t)Behavior
DateTimeDateTimeconvert to String, then sort
DateTimeRealadd t seconds to s, convert to String, then sort
DateTimeStringconvert s to String, then sort
RealDateTimeadd s seconds to t, convert to String, then sort
RealRealtreat as relative (see below), convert to String, sort
RealStringadd s seconds to t, convert to String, then sort
StringDateTimeconvert t to String, then sort
StringRealadd t seconds to s, convert to String, then sort
StringStringsort

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.

TypeDescriptionExample
StringComma-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()
Note

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..* and CC.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

StringSource
BGRhttp://eida.bgr.de
EMSChttp://www.seismicportal.eu
ETHhttp://eida.ethz.ch
GEONEThttp://service.geonet.org.nz
GFZhttp://geofon.gfz-potsdam.de
ICGChttp://ws.icgc.cat
INGVhttp://webservices.ingv.it
IPGPhttp://eida.ipgp.fr
IRIShttp://service.iris.edu
ISChttp://isc-mirror.iris.washington.edu
KOERIhttp://eida.koeri.boun.edu.tr
LMUhttp://erde.geophysik.uni-muenchen.de
NCEDChttp://service.ncedc.org
NIEPhttp://eida-sc3.infp.ro
NOAhttp://eida.gein.noa.gr
ORFEUShttp://www.orfeus-eu.org
RESIFhttp://ws.resif.fr
SCEDChttp://service.scedc.caltech.edu
TEXNEThttp://rtserve.beg.utexas.edu
USGShttp://earthquake.usgs.gov
USPhttp://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.

KWDefaultT [1]_Meaning
comp0x00U8compress data on write? [2]
fmt"miniseed"Srequest data format [3]
mag[6.0, 9.9]A{F,1}magnitude range for queries
n_zip100000Icompress if length(:x) > n_zip
nd1Inumber of days per subrequest
nev1Inumber of events returned per query
nx_add360000Ilength increase of undersized data array
nx_new8640000Inumber of samples for a new channel
opts""Suser-specified options [4]
prunetrueBcall prune! after get_data?
rad[]A{F,1}radial search region [5]
reg[]A{F,1}rectangular search region [6]
sitrueBautofill station info on data req? [7]
src"IRIS"Sdata source; type ?seis_www for list
to30Iread timeout for web requests (s)
v0Iverbosity
wfalseBwrite requests to disk? [8]
yfalseBsync 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.fctorespFunction
fctoresp(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

source
SeisBase.regex_findFunction
regex_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.

source
SeisBase.getbandcodeFunction
getbandcode(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.

source
SeisBase.get_seis_channelsFunction
get_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

source
SeisBase.guessFunction
function 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 to read_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
    uniquely determined.
  • swap determines whether or not file should be byte-swapped by read_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

  1. false positives are possible for file formats outside the scope of SeisBase.
  2. 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).

source
SeisBase.inst_codesFunction
inst_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.

source
SeisBase.inst_codeFunction
inst_code(S::GphysData, i::Integer)
inst_code(C::GphysChannel)

Get instrument codes.

See inst_codes.

source
inst_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.

source
SeisBase.lsFunction
ls(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)) invoke glob.

  • Path wildcards (e.g. ls(/data/*/*.sac)) invoke find_regex to circumvent glob limitations.

  • Passing ony "" as a filename (e.g. "`ls(/home/)) invokesfind_regex` to recursively search subdirectories, as in the Bash shell.

    ls()

Return full path and file name of files in current working directory.

source
SeisBase.j2mdFunction
m,d = j2md(y,j)

Convert Julian day j of year y to month m, day d

source
SeisBase.md2jFunction
j = md2j(y, m, d)

Convert month m, day d of year y to Julian day (day of year)

source
SeisBase.namestripFunction
namestrip(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" => [' ', '!', '"', '#', '$', '%', '&', ''', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '\', '^', '{', '|', '}', '~', '']
source
SeisBase.parsetimewinFunction
(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

source
SeisBase.resp_a0!Function
resp_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

source
SeisBase.resptofcFunction
resptofc(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

source
SeisBase.validate_unitsFunction
validate_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.

source

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:

TypeMeaningCFortran 77
CharUnicode characterwcharCHARACTER*4
Float3232-bit floatfloatREAL
Float6464-bit floatdoubleREAL*8
Int8signed 8-bit intshortINTEGER
Int16signed 16-bit intintINTEGER*2
Int32signed 32-bit intlongINTEGER*4
Int64signed 64-bit integerlong longINTEGER*8
UInt8unsigned 8-bit intunsigned shortCHARACTER
UInt16unsigned 16-bit intunsigned
UInt32unsigned 32-bit intunsigned long
UInt64unsigned 64-bit intunsigned 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

VarMeaningTN
"SeisBase"UInt86
VSeisBase file format versionFloat321
J# of SeisBase objects in fileUInt321
CSeisBase object codes for each objectUInt32J
BByte indices for each objectUInt64J
{for i = 1:J
(Objects)variableJ
}
IDID hashesUInt64variable
TSStart timesInt64variable
TEEnd timesInt64variable
PParent object index in C and Bvariable
bIDByte offset of ID arrayInt641
bTSByte offset of TS arrayInt641
bTEByte offset of TE arrayInt641
bPByte offset of P arrayInt641

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:

  1. Int64 number of dimensions (e.g. 2)
  2. Int64 array of dimensions themselves (e.g. 2, 2)
  3. Array values (e.g. 0.08250153, 0.023121119, 0.6299772, 0.79595184)

EQLoc

VarTypeNMeaning
latFloat641latitude
lonFloat641longitude
depFloat641depth
dxFloat641x-error
dyFloat641y-error
dzFloat641z-error
dtFloat641t-error (error in origin time)
seFloat641standard error
rmsFloat641rms pick error
gapFloat641azimuthal gap
dminFloat641minimum source-receiver distance in location
dmaxFloat641maximum source-receiver distance in location
nstInt641number of stations used to locate earthquake
flagsUInt81one-bit flags for special location properties
LdInt641length of "datum" string in bytes
datumUInt8LdDatum string
LtInt641length of "typ" (event type) string in bytes
typUInt8Ltearthquake type string
LiInt641length of "sig" (error significance) string in bytes
sigUInt8Liearthquake location error significance string
LrInt641length of "src" (data source) string in bytes
srcUInt8Lrdata source string

flag meanings: (0x01 = true, 0x00 = false)

  1. x fixed?
  2. y fixed?
  3. z fixed?
  4. t fixed?

In Julia, get the value of flag[n] with $>>(<<(flags, n-1), 7)$.

EQMag

VarTypeNMeaning
valFloat321magnitude value
gapFloat641largest azimuthal gap between stations in magnitude
nstInt641number of stations used in magnitude computation
LscInt641length of magnitude scale string
mscUInt8Lscmagnitude scale string
LrInt641length of data source string
srcUInt8Lrdata source string

SeisPha

VarTypeNMeaning
FFloat648amplitude, distance, incidence angle, residual,
ray parameter, takeoff angle, travel time, uncertainty
CChar2polarity, quality

SourceTime

VarTypeNMeaning
LdInt641size of descriptive string in bytes
descUInt81descriptive string
FFloat643duration, 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

VarTypeNMeaning
eeUInt81is this string vector empty? [1]
LInt641number of strings to read
{i = 1:L
nbInt641length of string in bytes
strUInt8nbstring
}
  • [1] If ee == 0x00, then no values are stored for L, nb, or str.

Location Types

GenLoc

VarTypeNMeaning
LdInt641length of datum string in bytes
datumUInt8Lddatum string
LlInt641length of location vector in bytes
locFloat64Lllocation vector

GeoLoc

VarTypeNMeaning
LdInt641length of datum string in bytes
datumUInt8Lddatum string
FFloat646latitude, longitude, elevation,
depth, azimuth, incidence

UTMLoc

VarTypeNMeaning
LdInt641length of datum string in bytes
datumUInt8Ndatum string
zoneInt81UTM zone number
hemiChar1hemisphere
EUInt641Easting
NUInt641Northing
FFloat644elevation, depth, azimuth, incidence

XYLoc

VarTypeNMeaning
LdInt641Length of datum string in bytes
datumUInt8Lddatum string
FFloat648x, y, z, azimuth, incidence, origin x, origin y, origin z

Response Types

GenResp

VarTypeNMeaning
LdInt641length of descriptive string in bytes
descUInt8Lddescriptive string
nrInt641Number of rows in complex response matrix
ncInt641Number of columns in complex response matrix
respComplex{Float64,2}nr*nccomplex response matrix

PZResp

VarTypeNMeaning
cFloat321damping constant
npInt641number of complex poles
pComplex{Float32,1}npcomplex poles vector
nzInt641number of complex zeros
zComplex{Float32,1}nzcomplex 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

VarTypeNMeaning
NInt641number of items in dictionary [1]
K(StringVec)1dictionary keys
{for i = 1:N
cUInt81Type code of object i
ovariable1object 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)

VarTypeNMeaning
A(StringVec)1string vector

Other Array (c == 0x80 or c > 0x81)

VarTypeNMeaning
ndInt641number of dimensions in array
dimsInt64ndarray dimensions
arrvariesprod(nd)array

String (c == 0x01)

VarTypeNMeaning
LInt641size of string in bytes
strUInt81string

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

VarTypeNMeaning
NInt641number of SeisPha objects to read [1]
K(StringVec)1dictionary keys
pha(SeisPha)Nseismic phases
  • [1] If $N == 0$, then N is the only value present.

EventChannel

A single channel of data related to a seismic event

VarTypeNMeaning
NiInt641size of id string in bytes
idUInt8Niid string
NnInt641size of name string in bytes
nameUInt8Nnname string
LtUInt81location Type codes
loc(Loc Type)1instrument position
fsFloat641sampling frequency in Hz
gainFloat641scalar gain
RtUInt81response Type codes
resp(Resp Type)1instrument response
NuInt641size of units string in bytes
unitsUInt8Nuunits string
azFloat641azimuth
bazFloat641backazimuth
distFloat641source-receiver distance
pha(PhaseCat)1phase catalog
NrInt641size of data source string in bytes
srcUInt8Nrdata source string
misc(Misc)1dictionary for non-essential information
notes(StringVec)1notes and automated logging
NtInt641length of time gaps matrix
TInt642Nttime gaps matrix
XcUInt81Type code of data vector
NxInt641number of samples in data vector
XvariableNXdata vector

SeisChannel

A single channel of univariate geophysical data

VarTypeNMeaning
NiInt641size of id string in bytes
idUInt8Niid string
NnInt641size of name string in bytes
nameUInt8Nnname string
LtUInt81location Type codes
loc(Loc Type)1instrument position
fsFloat641sampling frequency in Hz
gainFloat641scalar gain
RtUInt81response Type codes
resp(Resp Type)1instrument response
NuInt641size of units string in bytes
unitsUInt8Nuunits string
NrInt641size of data source string in bytes
srcUInt8Nrdata source string
misc(Misc)1dictionary for non-essential information
notes(StringVec)1notes and automated logging
NtInt641length of time gaps matrix
TInt642Nttime gaps matrix
XcUInt81Type code of data vector
NxInt641number of samples in data vector
XvariableNXdata vector

EventTraceData

A multichannel record of time-series data related to a seismic event.

VarTypeNMeaning
NInt641number of data channels
LcUInt8Nlocation Type codes for each data channel
RcUInt8Nresponse Type codes for each data channel
XcUInt8Ndata Type code for each data channel
cmpUInt81are data compressed? (0x01 = yes)
NtInt64Nnumber of rows in time gaps matrix for each channel
NxInt64Nlength of data vector for each channel [1]
id(StringVec)1channel ids
name(StringVec)1channel names
loc(Loc Type)Ninstrument positions
fsFloat64Nsampling frequencies of each channel in Hz
gainFloat64Nscalar gains of each channel
resp(Resp Type)Ninstrument responses
units(StringVec)1units of each channel's data
azFloat64Nevent azimuth
bazFloat64Nbackazimuths to event
distFloat64Nsource-receiver distances
pha(PhaseCat)Nphase catalogs for each channel
src(StringVec)1data source strings for each channel
misc(Misc)Ndictionaries of non-essential information for each channel
notes(StringVec)Nnotes and automated logging for each channel
{for i = 1:N
TInt642Nt[i]Matrix of time gaps for channel i
}
{for i = 1:N
XXc[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.

VarTypeNMeaning
NInt641number of data channels
LcUInt8Nlocation Type codes for each data channel
RcUInt8Nresponse Type codes for each data channel
XcUInt8Ndata Type code for each data channel
cmpUInt81are data compressed? (0x01 = yes)
NtInt64Nnumber of rows in time gaps matrix for each channel
NxInt64Nlength of data vector for each channel [1]
id(StringVec)1channel ids
name(StringVec)1channel names
loc(Loc Type)Ninstrument positions
fsFloat64Nsampling frequencies of each channel in Hz
gainFloat64Nscalar gains of each channel
resp(Resp Type)Ninstrument responses
units(StringVec)1units of each channel's data
src(StringVec)1data source strings for each channel
misc(Misc)Ndictionaries of non-essential information for each channel
notes(StringVec)Nnotes and automated logging for each channel
{for i = 1:N
TInt642Nt[i]Matrix of time gaps for channel i
}
{for i = 1:N
XXc[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

VarTypeNMeaning
LiInt641length of event ID string
idUInt8Lievent ID string
ivUInt81intensity value
LsInt641length of intensity scale string
iscUInt8Lsintensity scale string
loc(EQLoc)1earthquake location
mag(EQMag)1earthquake magnitude
misc(Misc)1dictionary containing non-essential information
notes(StringVec)1notes and automated logging
otInt641origin time [1]
LrInt641length of data source string
srcUInt8Lrdata source string
LtInt641length of event type string
typUInt8Ltevent type string
  • [1] Measured from Unix epoch time (1970-01-01T00:00:00Z) in integer microseconds

SeisSrc

VarTypeNMeaning
LiInt641length of source id string
idUInt8Liid string
LeInt641length of event id string
eidUInt8Leevent id string
m0Float641scalar moment
LmInt641length of moment tensor vector
mtFloat64Lmmoment tensor vector
LdInt641length of moment tensor misfit vector
dmFloat64Ldmoment tensor misfit vector
npInt641number of polarities
gapFloat641max. azimuthal gap
padInt642dimensions of principal axes matrix
paxFloat64pad[1]*pad[2]principal axes matrix
pldInt642dimensions of nodal planes matrix
planesFloat64pld[1]*pld[2]nodal planes matrix
LrInt641length of data source string
srcUInt81data source string
st(SourceTime)1source-time description
misc(Misc)1Dictionary containing non-essential information
notes(StringVec)1Notes and automated logging

SeisEvent

VarTypeNMeaning
hdr(SeisHdr)1event header
source(SeisSrc)1event source process
data(EventTraceData)1event 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

UInt8Type
0x00GenLoc
0x01GeoLoc
0x02UTMLoc
0x03XYLoc

Resp Type Codes

UInt8Type
0x00GenResp
0x01PZResp
0x02PZResp64

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.

TypeUInt8TypeUInt8
Char0x00Array{Char,N}0x80
String0x01Array{String,N}0x81
UInt80x10Array{UInt8,N}0x90
UInt160x11Array{UInt16,N}0x91
UInt320x12Array{UInt32,N}0x92
UInt640x13Array{UInt64,N}0x93
UInt1280x14Array{UInt128,N}0x94
Int80x20Array{Int8,N}0xa0
Int160x21Array{Int16,N}0xa1
Int320x22Array{Int32,N}0xa2
Int640x23Array{Int64,N}0xa3
Int1280x24Array{Int128,N}0xa4
Float160x30Array{Float16,N}0xb0
Float320x31Array{Float32,N}0xb1
Float640x32Array{Float64,N}0xb2
Complex{UInt8}0x50Array{Complex{UInt8},N}0xd0
Complex{UInt16}0x51Array{Complex{UInt16},N}0xd1
Complex{UInt32}0x52Array{Complex{UInt32},N}0xd2
Complex{UInt64}0x53Array{Complex{UInt64},N}0xd3
Complex{UInt128}0x54Array{Complex{UInt128},N}0xd4
Complex{Int8}0x60Array{Complex{Int8},N}0xe0
Complex{Int16}0x61Array{Complex{Int16},N}0xe1
Complex{Int32}0x62Array{Complex{Int32},N}0xe2
Complex{Int64}0x63Array{Complex{Int64},N}0xe3
Complex{Int128}0x64Array{Complex{Int128},N}0xe4
Complex{Float16}0x70Array{Complex{Float16},N}0xf0
Complex{Float32}0x71Array{Complex{Float32},N}0xf1
Complex{Float64}0x72Array{Complex{Float64},N}0xf2

SeisBase Object Type codes

UInt32 CodeObject Type
0x20474330EventChannel
0x20474331SeisChannel
0x20474430EventTraceData
0x20474431SeisData
0x20495030GenLoc
0x20495031GeoLoc
0x20495032UTMLoc
0x20495033XYLoc
0x20495230GenResp
0x20495231PZResp64
0x20495232PZResp
0x20504330PhaseCat
0x20534530SeisEvent
0x20534830SeisHdr
0x20535030SeisPha
0x20535330SeisSrc
0x20535430SourceTime
0x45514c30EQLoc
0x45514d30EQMag

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.

VersionDateChange
0.532019-09-11removed :i, :o from CoeffResp
added :i, :o to MultiStageResp
0.522019-09-03added CoeffResp, MultiStageResp
0.512019-08-01added :f0 to PZResp, PZResp64
0.502019-06-05all 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