Module utils

Module containing the main utility functions used in the SplitPy scripts that accompany this package.

splitpy.utils.get_options()

Get Options from OptionParser objects.

This function is used for data processing on-the-fly (requires web connection)

splitpy.utils.get_options_prep()

Get Options from OptionParser objects.

This function is used for preparation of SKS data for offline processing

splitpy.utils.get_options_offline()

Get Options from OptionParser objects.

This function is used for processing SKS data offline

splitpy.utils.parse_localdata_for_comp(comp='Z', stdata=<class 'list'>, sta=None, start=<class 'obspy.core.utcdatetime.UTCDateTime'>, end=<class 'obspy.core.utcdatetime.UTCDateTime'>, ndval=nan)

Function to determine the path to data for a given component and alternate network

Parameters
  • comp (str) – Channel for seismogram (one letter only)

  • stdata (List) – Station list

  • sta (Dict) – Station metadata from StDb data base

  • start (UTCDateTime) – Start time for request

  • end (UTCDateTime) – End time for request

  • ndval (float or nan) – Default value for missing data

Returns

  • err (bool) – Boolean for error handling (False is associated with success)

  • st (Stream) – Stream containing North, East and Vertical components of motion

splitpy.utils.get_data_NEZ(client=None, sta=None, start=<class 'obspy.core.utcdatetime.UTCDateTime'>, end=<class 'obspy.core.utcdatetime.UTCDateTime'>, stdata=<class 'list'>, ndval=nan)

Function to build a stream object for a seismogram in a given time window either by downloading data from the client object or alternatively first checking if the given data is already available locally.

Note

Currently only supports NEZ Components!

Parameters
  • client (Client) – Client object

  • sta (Dict) – Station metadata from StDb data base

  • start (UTCDateTime) – Start time for request

  • end (UTCDateTime) – End time for request

  • stdata (List) – Station list

  • ndval (float or nan) – Default value for missing data

Returns

  • err (bool) – Boolean for error handling (False is associated with success)

  • trN (Trace) – Trace of North component of motion

  • trE (Trace) – Trace of East component of motion

  • trZ (Trace) – Trace of Vertical component of motion