Developer documentation

This page lists internal functions and types which may change between minor releases of Seis, and hence are not part of the public API.

Private function index

Private types

Seis.PickType
Pick{T}

A named arrival time which can be associated with a Trace.

If p is a Pick, then p.time gives the arrival time, and p.name gives its description.

Picks can be iterated to retrieve the time and name in that order. Collections of Picks (such as those stored in the picks field of Traces) can have their elements assigned by automatic conversion from real numbers, tuples, or named tuples with fields time and name.

Arrays of Picks, which are stored in Traces, can be accessed using getproperty (.-access) and this returns arrays of times or names.

Examples

Getting and setting values

julia> t = Trace(0, 1, 1)
Seis.Trace{Float64,Array{Float64,1},Seis.Geographic{Float64}}:
            b: 0.0
        delta: 1.0
 Station{Float64,Seis.Geographic{Float64}}:
     sta.meta: Seis.SeisDict{Symbol,Any}()
 Event{Float64,Seis.Geographic{Float64}}:
     evt.meta: Seis.SeisDict{Symbol,Any}()
 Trace:
        picks: 0
         meta: 

julia> t.picks.P = 1.2
1.2

julia> t.picks.S = 2.1, "Sn"
(2.1, "Sn")

julia> t.picks.S.time
2.1

julia> t.picks
Seis.SeisDict{Union{Int64, Symbol},Seis.Pick{Float64}} with 2 entries:
  :P => Seis.Pick{Float64}(time=1.2, name=missing)
  :S => Seis.Pick{Float64}(time=2.1, name="Sn")

Iteration

julia> time, name = Seis.Pick(1, "X")
Seis.Pick{Float64}(time=1.0, name="X")

julia> time, name
(1.0, "X")
source

Dictionaries

Seis.SeisDictType
SeisDict

Wrapper around Base.Dict which allows one to get or set values using the {get|set}property[!] syntax, i.e., .-access like dict.key. SeisDicts also differ in that missing is returned instead of throwing a KeyError when accessing a nonexistent key. A key is removed if it is set to missing.

Examples

julia> dict = Seis.SeisDict(:a=>1)
Seis.SeisDict{Any,Any} with 1 entry:
  :a => 1

julia> dict.a
1

julia> dict.b
missing

julia> dict.a = missing
missing

julia> dict
Seis.SeisDict{Any,Any} with 0 entries

Access via getindex and setindex! (using []s) is still possible:

julia> dict[:c] = 3
3

julia> dict[:c]
3

julia> dict[:c] = missing
missing

julia> dict[:d] # No key with this value
missing

julia> dict
Seis.SeisDict{Any,Any} with 0 entries

Arrays of SeisDicts also define .-access and setting via broadcasting, so one may do:

julia> d1 = Seis.SeisDict(:a=>1)
Seis.SeisDict{Any,Any} with 1 entry:
  :a => 1

julia> d2 = deepcopy(d1); d2.a = 2;

julia> d = [d1, d2]
2-element Array{Seis.SeisDict{Any,Any},1}:
 Seis.SeisDict(:a => 1)
 Seis.SeisDict(:a => 2)

julia> d.a
2-element Array{Int64,1}:
 1
 2
source

Position in space

Seis.PositionType
Position

Abstract type of which other position types are subtypes. A Position specifies where in space an object is located.

The coordinates of a Position can be accessed via getproperty (e.g., p.x) or index (e.g., p[1]):

Examples

julia> p = Seis.Cartesian(x=1, y=2, z=3)
Seis.Cartesian{Float64}(1.0, 2.0, 3.0)

julia> p.x === p[1]
true
source
Seis.GeographicType
Geographic{T} <: Position

A geographic position in spherical coordinates. Accessible fields are:

  • lon: Longitude (°)
  • lat: Latitude (°)
  • dep: Depth below the reference level (e.g., ellipsoid) (km)

It is recommended that for Stations, the dep field describes the depth of the sensor relative to sea level in km, so a station at 150 m elevation has a depth of –0.15 km. Information about sensor burial depth should be held in the Event's meta field.

source
Seis.CartesianType
Cartesian{T} <: Position{T}

A position in Cartesian coordinates. Accessible fields are:

  • x: X coordinate (m)
  • y: Y coordinate (m)
  • z: Z coordinate (m)

Seis.jl's convention is that x and y are horizontal (usually with x being the local easting and y the local northing), and z is upwards (giving a right-handed system). The units are m.

source