squirrel.model

Data model and content types handled by the Squirrel framework.

Squirrel uses flat content types to represent waveform, station, channel, response, event, and a few other objects. A common subset of the information in these objects is indexed in the database, currently: kind, codes, time interval and sampling rate. The Nut objects encapsulate this information together with information about where and how to get the associated bulk data.

Further content types are defined here to handle waveform orders, waveform promises, data coverage and sensor information.

class Station(**kwargs)[source]

Bases: pyrocko.model.content.Content

A seismic station.

agency

str, default: ''

Agency code (2-5)

network

str, default: ''

Deployment/network code (1-8)

station

str, default: ''

Station code (1-5)

location

str, optional, default: ''

Location code (0-2)

tmin

time_float, optional

tmax

time_float, optional

lat

float

lon

float

elevation

float, optional

depth

float, optional

description

str, optional

class Channel(**kwargs)[source]

Bases: pyrocko.model.content.Content

A channel of a seismic station.

agency

str, default: ''

Agency code (2-5)

network

str, default: ''

Deployment/network code (1-8)

station

str, default: ''

Station code (1-5)

location

str, default: ''

Location code (0-2)

channel

str, default: ''

Channel code (3)

extra

str, default: ''

Extra/custom code

tmin

time_float, optional

tmax

time_float, optional

lat

float

lon

float

elevation

float, optional

depth

float, optional

dip

float, optional

azimuth

float, optional

deltat

float, optional

class Sensor(**kwargs)[source]

Bases: pyrocko.squirrel.model.Channel

Representation of a channel group.

class Response(**kwargs)[source]

Bases: pyrocko.model.content.Content

The instrument response of a seismic station channel.

agency

str, default: ''

Agency code (2-5)

network

str, default: ''

Deployment/network code (1-8)

station

str, default: ''

Station code (1-5)

location

str, default: ''

Location code (0-2)

channel

str, default: ''

Channel code (3)

extra

str, default: ''

Extra/custom code

tmin

time_float, optional

tmax

time_float, optional

stages

list of ResponseStage objects, default: []

checkpoints

list of pyrocko.response.FrequencyResponseCheckpoint objects, default: []

deltat

float, optional

log

list of tuple of 3 str objects objects, default: []

class WaveformPromise(**kwargs)[source]

Bases: pyrocko.model.content.Content

Information about a waveform potentially downloadable from a remote site.

In the Squirrel framework, waveform promises are used to permit download of selected waveforms from a remote site. They are typically generated by calls to update_waveform_promises(). Waveform promises are inserted and indexed in the database similar to normal waveforms. When processing a waveform query, e.g. from get_waveform(), and no local waveform is available for the queried time span, a matching promise can be resolved, i.e. an attempt is made to download the waveform from the remote site. The promise is removed after the download attempt (except when a network error occurs). This prevents Squirrel from making unnecessary queries for waveforms missing at the remote site.

agency

str, default: ''

Agency code (2-5)

network

str, default: ''

Deployment/network code (1-8)

station

str, default: ''

Station code (1-5)

location

str, default: ''

Location code (0-2)

channel

str, default: ''

Channel code (3)

extra

str, default: ''

Extra/custom code

tmin

time_float

tmax

time_float

deltat

float, optional

source_hash

str

class Nut(file_path=None, file_format=None, file_mtime=None, file_size=None, file_segment=None, file_element=None, kind_id=0, codes='', tmin_seconds=None, tmin_offset=0, tmax_seconds=None, tmax_offset=0, deltat=None, content=None, tmin=None, tmax=None, values_nocheck=None)[source]

Bases: pyrocko.guts.Object

Index entry referencing an elementary piece of content.

So-called nuts are used in Pyrocko’s Squirrel framework to hold common meta-information about individual pieces of waveforms, stations, channels, etc. together with the information where it was found or generated.

file_path

str, optional

file_format

str, optional

file_mtime

time_float, optional

file_size

int, optional

file_segment

int, optional

file_element

int, optional

kind_id

int

codes

str

tmin_seconds

time_float

tmin_offset

int, optional, default: 0

tmax_seconds

time_float

tmax_offset

int, optional, default: 0

deltat

float, default: 0.0

content

pyrocko.model.content.Content, optional

class Coverage(**kwargs)[source]

Bases: pyrocko.guts.Object

Information about times covered by a waveform or other content type.

kind_id

int

pattern

str

codes

str

deltat

float, optional

tmin

time_float, optional

tmax

time_float, optional

changes

list of tuple of 2 pyrocko.guts.Any objects objects, default: []