gui.marker

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

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]

If one nslc_id defines this marker return this id. If more than one nslc_id is defined in the Marker`s *nslc_ids* raise :py:exc:`MarkerOneNSLCRequired.

copy()[source]

Get a copy of this marker.

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

An EventMarker is a GUI element representing a seismological event

Parameters
  • event – A pyrocko.model.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: pyrocko.model.Event.get_hash())

get_event()[source]

Return an instance of the pyrocko.model.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]

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 pyrocko.model.Event object containing meta information of a seismological event

  • event_hash – (optional) hash code of event (see: pyrocko.model.Event.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 pyrocko.model.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.