seisnn.core.Label

class seisnn.core.Label(metadata, phase, tag=None)[source]

Bases: object

Main class for label data.

__init__(metadata, phase, tag=None)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(metadata, phase[, tag])

Initialize self.

generate_label(database, tag, shape[, …])

Add generated label to stream.

get_picks([height, distance])

Extract pick from label and write into the database.

write_picks_to_database(tag, database)

Write picks into the database.

Attributes

picks

generate_label(database, tag, shape, half_width=20)[source]

Add generated label to stream.

Parameters
  • database (str) – SQL database.

  • tag (str) – Pick tag in SQL database.

  • shape (str) – Label shape, see scipy.signal.windows.get_window().

  • half_width (int) – Label half width in data point.

Return type

np.array

Returns

Label.

get_picks(height=0.5, distance=100)[source]

Extract pick from label and write into the database.

Parameters
  • height (float) – Height threshold, from 0 to 1, default is 0.5.

  • distance (int) – Distance threshold in data point.

write_picks_to_database(tag, database)[source]

Write picks into the database.

Parameters
  • tag (str) – Output pick tag name.

  • database – SQL database name.