pyrocko.io.stationxml

FDSN StationXML input, output and data model.

Classes

Angle([value])

Undocumented.

Approximation(...)

Any str out of ['MACLAURIN'].

Azimuth([value])

Instrument azimuth, degrees clockwise from North.

BaseFilter(**kwargs)

The BaseFilter is derived by all filters.

BaseNode(**kwargs)

A base node type for derivation from: Network, Station and Channel types.

CfTransferFunction(...)

Any str out of ['ANALOG (RADIANS/SECOND)', 'ANALOG (HERTZ)', 'DIGITAL'].

Channel(**kwargs)

Equivalent to SEED blockette 52 and parent element for the related the response blockettes.

ClockDrift([value])

Undocumented.

Coefficient([value])

Undocumented.

Coefficients(**kwargs)

Response: coefficients for FIR filter.

Comment(**kwargs)

Container for a comment or log entry.

Counter(...)

Undocumented.

Decimation(**kwargs)

Corresponds to SEED blockette 57.

Delivery([payload, log, errors, error])

Undocumented.

Dip([value])

Instrument dip in degrees down from horizontal.

Distance([value])

Extension of FloatWithUnit for distances, elevations, and depths.

DummyAwareOptionalTimestamp(...)

Optional timestamp with support for some common placeholder values.

Email(...)

Any str matching pattern '[\\w\\.\\-_]+@[\\w\\.\\-_]+'.

Equipment(**kwargs)

Undocumented.

ExternalReference(**kwargs)

This type contains a URI and description for external data that users may want to reference in StationXML.

FDSNStationXML(*args, **kwargs)

Top-level type for Station XML.

FIR(**kwargs)

Response: FIR filter.

FloatNoUnit([value])

Undocumented.

FloatWithUnit([value])

Undocumented.

Frequency([value])

Undocumented.

Gain([value])

Complex type for sensitivity and frequency ranges.

Latitude([value])

Type for latitude coordinate.

Log(**kwargs)

Container for log entries.

Longitude([value])

Type for longitude coordinate.

Network(**kwargs)

This type represents the Network layer, all station metadata is contained within this element.

Nominal(...)

Any str out of ['NOMINAL', 'CALCULATED'].

NumeratorCoefficient(**kwargs)

Undocumented.

Operator(**kwargs)

Undocumented.

Person(**kwargs)

Representation of a person's contact information.

PhoneNumber(**kwargs)

Undocumented.

PoleZero(**kwargs)

Complex numbers used as poles or zeros in channel response.

PolesZeros(**kwargs)

Response: complex poles and zeros.

Polynomial(**kwargs)

Response: expressed as a polynomial (allows non-linear sensors to be described).

PzTransferFunction(...)

Any str out of ['LAPLACE (RADIANS/SECOND)', 'LAPLACE (HERTZ)', 'DIGITAL (Z-TRANSFORM)'].

Response(**kwargs)

Undocumented.

ResponseList(**kwargs)

Response: list of frequency, amplitude and phase values.

ResponseListElement(**kwargs)

Undocumented.

ResponseStage(**kwargs)

This complex type represents channel response and covers SEED blockettes 53 to 56.

RestrictedStatus(...)

Any str out of ['open', 'closed', 'partial'].

SampleRate([value])

Sample rate in samples per second.

SampleRateRatio(**kwargs)

Sample rate expressed as number of samples in a number of seconds.

Second([value])

A time value in seconds.

Sensitivity([value])

Sensitivity and frequency ranges.

Site(**kwargs)

Description of a site location using name and optional geopolitical boundaries (country, city, etc.).

Station(**kwargs)

This type represents a Station epoch.

Symmetry(...)

Any str out of ['NONE', 'EVEN', 'ODD'].

Type(...)

Any str out of ['TRIGGERED', 'CONTINUOUS', 'HEALTH', 'GEOPHYSICAL', 'WEATHER', 'FLAG', 'SYNTHESIZED', 'INPUT', 'EXPERIMENTAL', 'MAINTENANCE', 'BEAM'].

Units([name])

A type to document units.

Voltage([value])

Undocumented.

class Delivery(payload=None, log=None, errors=None, error=None)[source]

Bases: Object

Undocumented.

payload

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

log

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

errors

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

class DummyAwareOptionalTimestamp(...) pyrocko.util.get_time_float[source]

Bases: Object

Optional timestamp with support for some common placeholder values.

Some StationXML files contain arbitrary placeholder values for open end intervals, like “2100-01-01”. Depending on the time range supported by the system, these dates are translated into None to prevent crashes with this type.

class Nominal(...) str[source]

Bases: StringChoice

Any str out of ['NOMINAL', 'CALCULATED'].

Variables:
  • choices – Allowed choices (list of str).

  • ignore_case – Whether to behave case-insensitive (bool, default: False).

class Email(...) str[source]

Bases: UnicodePattern

Any str matching pattern '[\\w\\.\\-_]+@[\\w\\.\\-_]+'.

class RestrictedStatus(...) str[source]

Bases: StringChoice

Any str out of ['open', 'closed', 'partial'].

Variables:
  • choices – Allowed choices (list of str).

  • ignore_case – Whether to behave case-insensitive (bool, default: False).

class Type(...) str[source]

Bases: StringChoice

Any str out of ['TRIGGERED', 'CONTINUOUS', 'HEALTH', 'GEOPHYSICAL', 'WEATHER', 'FLAG', 'SYNTHESIZED', 'INPUT', 'EXPERIMENTAL', 'MAINTENANCE', 'BEAM'].

Variables:
  • choices – Allowed choices (list of str).

  • ignore_case – Whether to behave case-insensitive (bool, default: False).

class PzTransferFunction(...) str[source]

Bases: StringChoice

Any str out of ['LAPLACE (RADIANS/SECOND)', 'LAPLACE (HERTZ)', 'DIGITAL (Z-TRANSFORM)'].

Variables:
  • choices – Allowed choices (list of str).

  • ignore_case – Whether to behave case-insensitive (bool, default: False).

class Symmetry(...) str[source]

Bases: StringChoice

Any str out of ['NONE', 'EVEN', 'ODD'].

Variables:
  • choices – Allowed choices (list of str).

  • ignore_case – Whether to behave case-insensitive (bool, default: False).

class CfTransferFunction(...) str[source]

Bases: StringChoice

Any str out of ['ANALOG (RADIANS/SECOND)', 'ANALOG (HERTZ)', 'DIGITAL'].

Variables:
  • choices – Allowed choices (list of str).

  • ignore_case – Whether to behave case-insensitive (bool, default: False).

class Approximation(...) str[source]

Bases: StringChoice

Any str out of ['MACLAURIN'].

Variables:
  • choices – Allowed choices (list of str).

  • ignore_case – Whether to behave case-insensitive (bool, default: False).

class Site(**kwargs)[source]

Bases: Object

Description of a site location using name and optional geopolitical boundaries (country, city, etc.).

name

str, default: ''

description

str, optional

town

str, optional

county

str, optional

region

str, optional

country

str, optional

class ExternalReference(**kwargs)[source]

Bases: Object

This type contains a URI and description for external data that users may want to reference in StationXML.

uri

str

description

str

class Units(name=None, **kwargs)[source]

Bases: Object

A type to document units. Corresponds to SEED blockette 34.

name

str

description

str, optional

class Counter(...) int[source]

Bases: Int

Undocumented.

class SampleRateRatio(**kwargs)[source]

Bases: Object

Sample rate expressed as number of samples in a number of seconds.

number_samples

int

number_seconds

int

class Gain(value=None, **kwargs)[source]

Bases: Object

Complex type for sensitivity and frequency ranges. This complex type can be used to represent both overall sensitivities and individual stage gains. The FrequencyRangeGroup is an optional construct that defines a pass band in Hertz ( FrequencyStart and FrequencyEnd) in which the SensitivityValue is valid within the number of decibels specified in FrequencyDBVariation.

value

float, optional

frequency

float, optional

class NumeratorCoefficient(**kwargs)[source]

Bases: Object

Undocumented.

i

int, optional

value

float

class FloatNoUnit(value=None, **kwargs)[source]

Bases: Object

Undocumented.

plus_error

float, optional

minus_error

float, optional

value

float

class FloatWithUnit(value=None, **kwargs)[source]

Bases: FloatNoUnit

Undocumented.

unit

str, optional

class Equipment(**kwargs)[source]

Bases: Object

Undocumented.

resource_id

str, optional

type

str, optional

description

str, optional

manufacturer

str, optional

vendor

str, optional

model

str, optional

serial_number

str, optional

installation_date

pyrocko.util.get_time_float (DummyAwareOptionalTimestamp), optional

removal_date

pyrocko.util.get_time_float (DummyAwareOptionalTimestamp), optional

calibration_date_list

list of pyrocko.util.get_time_float (pyrocko.guts.Timestamp) objects, default: []

class PhoneNumber(**kwargs)[source]

Bases: Object

Undocumented.

description

str, optional

country_code

int, optional

area_code

int

phone_number

str (PhoneNumber)

class BaseFilter(**kwargs)[source]

Bases: Object

The BaseFilter is derived by all filters.

resource_id

str, optional

name

str, optional

description

str, optional

input_units

Units, optional

output_units

Units, optional

class Sensitivity(value=None, **kwargs)[source]

Bases: Gain

Sensitivity and frequency ranges. The FrequencyRangeGroup is an optional construct that defines a pass band in Hertz (FrequencyStart and FrequencyEnd) in which the SensitivityValue is valid within the number of decibels specified in FrequencyDBVariation.

input_units

Units, optional

output_units

Units, optional

frequency_start

float, optional

frequency_end

float, optional

frequency_db_variation

float, optional

class Coefficient(value=None, **kwargs)[source]

Bases: FloatNoUnit

Undocumented.

number

int (Counter), optional

class PoleZero(**kwargs)[source]

Bases: Object

Complex numbers used as poles or zeros in channel response.

number

int, optional

real

FloatNoUnit

imaginary

FloatNoUnit

class ClockDrift(value=None, **kwargs)[source]

Bases: FloatWithUnit

Undocumented.

unit

str, optional, default: 'SECONDS/SAMPLE'

class Second(value=None, **kwargs)[source]

Bases: FloatWithUnit

A time value in seconds.

unit

str, optional, default: 'SECONDS'

class Voltage(value=None, **kwargs)[source]

Bases: FloatWithUnit

Undocumented.

unit

str, optional, default: 'VOLTS'

class Angle(value=None, **kwargs)[source]

Bases: FloatWithUnit

Undocumented.

unit

str, optional, default: 'DEGREES'

class Azimuth(value=None, **kwargs)[source]

Bases: FloatWithUnit

Instrument azimuth, degrees clockwise from North.

unit

str, optional, default: 'DEGREES'

class Dip(value=None, **kwargs)[source]

Bases: FloatWithUnit

Instrument dip in degrees down from horizontal. Together azimuth and dip describe the direction of the sensitive axis of the instrument.

unit

str, optional, default: 'DEGREES'

class Distance(value=None, **kwargs)[source]

Bases: FloatWithUnit

Extension of FloatWithUnit for distances, elevations, and depths.

unit

str, optional, default: 'METERS'

class Frequency(value=None, **kwargs)[source]

Bases: FloatWithUnit

Undocumented.

unit

str, optional, default: 'HERTZ'

class SampleRate(value=None, **kwargs)[source]

Bases: FloatWithUnit

Sample rate in samples per second.

unit

str, optional, default: 'SAMPLES/S'

class Person(**kwargs)[source]

Bases: Object

Representation of a person’s contact information. A person can belong to multiple agencies and have multiple email addresses and phone numbers.

name_list

list of str objects, default: []

agency_list

list of str objects, default: []

email_list

list of str (Email) objects, default: []

phone_list

list of PhoneNumber objects, default: []

class FIR(**kwargs)[source]

Bases: BaseFilter

Response: FIR filter. Corresponds to SEED blockette 61. FIR filters are also commonly documented using the Coefficients element.

symmetry

str (Symmetry)

numerator_coefficient_list

list of NumeratorCoefficient objects, default: []

class Coefficients(**kwargs)[source]

Bases: BaseFilter

Response: coefficients for FIR filter. Laplace transforms or IIR filters can be expressed using type as well but the PolesAndZeros should be used instead. Corresponds to SEED blockette 54.

cf_transfer_function_type

str (CfTransferFunction)

numerator_list

list of FloatWithUnit objects, default: []

denominator_list

list of FloatWithUnit objects, default: []

class Latitude(value=None, **kwargs)[source]

Bases: FloatWithUnit

Type for latitude coordinate.

unit

str, optional, default: 'DEGREES'

datum

str, optional, default: 'WGS84'

class Longitude(value=None, **kwargs)[source]

Bases: FloatWithUnit

Type for longitude coordinate.

unit

str, optional, default: 'DEGREES'

datum

str, optional, default: 'WGS84'

class PolesZeros(**kwargs)[source]

Bases: BaseFilter

Response: complex poles and zeros. Corresponds to SEED blockette 53.

pz_transfer_function_type

str (PzTransferFunction)

normalization_factor

float, default: 1.0

normalization_frequency

Frequency, optional

zero_list

list of PoleZero objects, default: []

pole_list

list of PoleZero objects, default: []

class ResponseListElement(**kwargs)[source]

Bases: Object

Undocumented.

frequency

Frequency

amplitude

FloatWithUnit

phase

Angle

class Polynomial(**kwargs)[source]

Bases: BaseFilter

Response: expressed as a polynomial (allows non-linear sensors to be described). Corresponds to SEED blockette 62. Can be used to describe a stage of acquisition or a complete system.

approximation_type

str (Approximation), default: 'MACLAURIN'

frequency_lower_bound

Frequency

frequency_upper_bound

Frequency

approximation_lower_bound

float

approximation_upper_bound

float

maximum_error

float

coefficient_list

list of Coefficient objects, default: []

class Decimation(**kwargs)[source]

Bases: Object

Corresponds to SEED blockette 57.

input_sample_rate

Frequency

factor

int

offset

int

delay

FloatWithUnit

correction

FloatWithUnit

class Operator(**kwargs)[source]

Bases: Object

Undocumented.

agency_list

list of str objects, default: []

contact_list

list of Person objects, default: []

web_site

str, optional

class Comment(**kwargs)[source]

Bases: Object

Container for a comment or log entry. Corresponds to SEED blockettes 31, 51 and 59.

id

int (Counter), optional

value

str

begin_effective_time

pyrocko.util.get_time_float (DummyAwareOptionalTimestamp), optional

end_effective_time

pyrocko.util.get_time_float (DummyAwareOptionalTimestamp), optional

author_list

list of Person objects, default: []

class ResponseList(**kwargs)[source]

Bases: BaseFilter

Response: list of frequency, amplitude and phase values. Corresponds to SEED blockette 55.

response_list_element_list

list of ResponseListElement objects, default: []

class Log(**kwargs)[source]

Bases: Object

Container for log entries.

entry_list

list of Comment objects, default: []

class ResponseStage(**kwargs)[source]

Bases: Object

This complex type represents channel response and covers SEED blockettes 53 to 56.

number

int (Counter)

resource_id

str, optional

poles_zeros_list

list of PolesZeros objects, default: []

coefficients_list

list of Coefficients objects, default: []

response_list

ResponseList, optional

fir

FIR, optional

polynomial

Polynomial, optional

decimation

Decimation, optional

stage_gain

Gain, optional

class Response(**kwargs)[source]

Bases: Object

Undocumented.

resource_id

str, optional

instrument_sensitivity

Sensitivity, optional

instrument_polynomial

Polynomial, optional

stage_list

list of ResponseStage objects, default: []

classmethod from_pyrocko_pz_response(presponse, input_unit, output_unit, normalization_frequency=1.0)[source]

Convert Pyrocko pole-zero response to StationXML response.

Parameters:
  • presponse (PoleZeroResponse) – Pyrocko pole-zero response

  • input_unit (str) – Input unit to be reported in the StationXML response.

  • output_unit (str) – Output unit to be reported in the StationXML response.

  • normalization_frequency (float) – Frequency where the normalization factor for the StationXML response should be computed.

class BaseNode(**kwargs)[source]

Bases: Object

A base node type for derivation from: Network, Station and Channel types.

code

str

start_date

pyrocko.util.get_time_float (DummyAwareOptionalTimestamp), optional

end_date

pyrocko.util.get_time_float (DummyAwareOptionalTimestamp), optional

restricted_status

str (RestrictedStatus), optional

alternate_code

str, optional

historical_code

str, optional

description

str, optional

comment_list

list of Comment objects, default: []

class Channel(**kwargs)[source]

Bases: BaseNode

Equivalent to SEED blockette 52 and parent element for the related the response blockettes.

location_code

str

external_reference_list

list of ExternalReference objects, default: []

latitude

Latitude

longitude

Longitude

elevation

Distance

depth

Distance

azimuth

Azimuth, optional

dip

Dip, optional

type_list

list of str (Type) objects, default: []

sample_rate

SampleRate, optional

sample_rate_ratio

SampleRateRatio, optional

storage_format

str, optional

clock_drift

ClockDrift, optional

calibration_units

Units, optional

sensor

Equipment, optional

pre_amplifier

Equipment, optional

data_logger

Equipment, optional

equipment_list

list of Equipment objects, default: []

response

Response, optional

class Station(**kwargs)[source]

Bases: BaseNode

This type represents a Station epoch. It is common to only have a single station epoch with the station’s creation and termination dates as the epoch start and end dates.

latitude

Latitude

longitude

Longitude

elevation

Distance

site

Site, default: Site(name='')

vault

str, optional

geology

str, optional

equipment_list

list of Equipment objects, default: []

operator_list

list of Operator objects, default: []

creation_date

pyrocko.util.get_time_float (DummyAwareOptionalTimestamp), optional

termination_date

pyrocko.util.get_time_float (DummyAwareOptionalTimestamp), optional

total_number_channels

int (Counter), optional

selected_number_channels

int (Counter), optional

external_reference_list

list of ExternalReference objects, default: []

channel_list

list of Channel objects, default: []

class Network(**kwargs)[source]

Bases: BaseNode

This type represents the Network layer, all station metadata is contained within this element. The official name of the network or other descriptive information can be included in the Description element. The Network can contain 0 or more Stations.

total_number_stations

int (Counter), optional

selected_number_stations

int (Counter), optional

station_list

list of Station objects, default: []

class FDSNStationXML(*args, **kwargs)[source]

Bases: Object

Top-level type for Station XML. Required field are Source (network ID of the institution sending the message) and one or more Network containers or one or more Station containers.

schema_version

float, default: 1.0

source

str

sender

str, optional

module

str, optional

module_uri

str, optional

created

pyrocko.util.get_time_float (pyrocko.guts.Timestamp), optional

network_list

list of Network objects, default: []

classmethod from_pyrocko_stations(pyrocko_stations, add_flat_responses_from=None)[source]

Generate FDSNStationXML from list of :py:class;`pyrocko.model.Station` instances.

Parameters:
  • pyrocko_stations – list of :py:class;`pyrocko.model.Station` instances.

  • add_flat_responses_from – unit, ‘M’, ‘M/S’ or ‘M/S**2’