pyrocko.gui.snuffler.marker

Functions

associate_phases_to_events(markers)

Reassociate phases to events after import from markers file.

load_markers(filename)

Load markers from file.

save_markers(markers, filename[, fdigits])

Save markers to file.

Classes

EventMarker(event[, kind, event_hash])

GUI element representing a seismological event.

Marker(nslc_ids, tmin, tmax[, kind])

General purpose marker GUI element and base class for EventMarker and PhaseMarker.

PhaseMarker(nslc_ids, tmin, tmax[, kind, ...])

A PhaseMarker is a GUI-element representing a seismological phase arrival

Exceptions

MarkerOneNSLCRequired

Raised when a marker with exactly one NSLC entry is required but there are zero or more than one.

exception MarkerOneNSLCRequired[source]

Bases: Exception

Raised when a marker with exactly one NSLC entry is required but there are zero or more than one.

class Marker(nslc_ids, tmin, tmax, kind=0)[source]

Bases: object

General purpose marker GUI element and base class for EventMarker and PhaseMarker.

Parameters:
  • nslc_ids – list of (network, station, location, channel) tuples (may contain wildcards)

  • tmin – start time

  • tmax – end time

  • kind – (optional) integer to distinguish groups of markers (color-coded)

static save_markers(markers, fn, fdigits=3)[source]

Static method to write marker objects to file.

Parameters:
  • markers – list of Marker objects

  • fn – filename as string

  • fdigits – number of decimal digits to use for sub-second time strings (default 3)

static load_markers(fn)[source]

Static method to load markers from file.

Parameters:

filename – filename as string

Returns:

list of Marker, EventMarker or PhaseMarker objects

set(nslc_ids, tmin, tmax)[source]

Set nslc_ids, start time and end time of Marker.

Parameters:
  • nslc_ids – list or set of (network, station, location, channel) tuples

  • tmin – start time

  • tmax – end time

set_kind(kind)[source]

Set kind of Marker.

Parameters:

kind – (optional) integer to distinguish groups of markers (color-coded)

get_tmin()[source]

Get start time of Marker.

get_tmax()[source]

Get end time of Marker.

get_nslc_ids()[source]

Get marker’s network-station-location-channel pattern.

Returns:

list or set of (network, station, location, channel) tuples

The network, station, location, or channel strings may contain wildcard expressions.

match_nsl(nsl)[source]

See documentation of pyrocko.util.match_nslc().

match_nslc(nslc)[source]

See documentation of pyrocko.util.match_nslc().

one_nslc()[source]

Get single NSLC pattern or raise an exception if there is not exactly one.

If nslc_ids contains a single entry, return it. If more than one is available, raise MarkerOneNSLCRequired.

copy()[source]

Get a copy of this marker.

class EventMarker(event, kind=0, event_hash=None)[source]

Bases: Marker

GUI element representing a seismological event.

Parameters:
  • event – A Event object containing meta information of a seismological event

  • kind – (optional) integer to distinguish groups of markers

  • event_hash – (optional) hash code of event (see: get_hash())

get_event()[source]

Return an instance of the Event associated to this EventMarker

class PhaseMarker(nslc_ids, tmin, tmax, kind=0, event=None, event_hash=None, event_time=None, phasename=None, polarity=None, automatic=None, incidence_angle=None, takeoff_angle=None)[source]

Bases: Marker

A PhaseMarker is a GUI-element representing a seismological phase arrival

Parameters:
  • nslc_ids – list of (network, station, location, channel) tuples (may contain wildcards)

  • tmin – start time

  • tmax – end time

  • kind – (optional) integer to distinguish groups of markers (color-coded)

  • event – a Event object containing meta information of a seismological event

  • event_hash – (optional) hash code of event (see: get_hash())

  • event_time – (optional) time of the associated event

  • phasename – (optional) name of the phase associated with the marker

  • polarity – (optional) polarity of arriving phase

  • automatic – (optional)

  • incident_angle – (optional) incident angle of phase

  • takeoff_angle – (optional) take off angle of phase

get_event()[source]

Return an instance of the Event associated to this EventMarker

load_markers(filename)[source]

Load markers from file.

Parameters:

filename – filename as string

Returns:

list of Marker Objects

save_markers(markers, filename, fdigits=3)[source]

Save markers to file.

Parameters:
  • markers – list of Marker Objects

  • filename – filename as string

  • fdigits – number of decimal digits to use for sub-second time strings

associate_phases_to_events(markers)[source]

Reassociate phases to events after import from markers file.