BPMF.data_reader_examples

BPMF.data_reader_examples.data_reader_mseed(where, network='*', stations=['*'], channels=['*'], location='*', starttime=None, endtime=None, attach_response=False, data_folder='', data_files=None, channel_template_str='[A-Z][A-Z]', **kwargs)[source]

Data reader for BPMF.

This data reader is specifically designed for the folder tree convention that we use in the tutorial. We will use the same data reader at later stages of the workflow.

Note: This is the data reader introduced in BPMF’s tutorial.

Parameters:
  • where (str) – Path to data file or root data folder.

  • network (str or list, optional) – Code(s) of the target network(s).

  • stations (str or list, optional) – Code(s) of the target station(s).

  • channels (str or list, optional) – Code(s) of the target channel(s).

  • location (str or list, optional) – Code(s) of the target location(s).

  • starttime (str or obspy.UTCDateTime, optional) – Target start time.

  • endtime (str or obspy.UTCDateTime, optional) – Target end time.

  • attach_response (bool, optional) – If True, find the instrument response from the xml files and attach it to the obspy.Stream output instance.

  • data_folder (str, optional) – If given, is the child folder in where containing the mseed files to read.

  • data_files (list, optional) – If not None, is the list of full paths (str) to the data files to read.

  • channel_template_str (str, optional) – Data files are searched assuming the following naming convention: full_channel_name = channel_template_str + channels[i] By default, channel_template_str=’[A-Z][A-Z]’, meaning that it is assumed that channel names start with two letters.

Returns:

traces – The seismic data.

Return type:

obspy.Stream

BPMF.data_reader_examples.data_reader_pyasdf(where, network='*', station='*', channel='*', location='*', starttime='*', endtime='*', tag='raw', **kwargs)[source]

Data reader for BPMF based on the ASDF format.

Parameters:
  • where (string) – Path to data file or root data folder.

  • network (string or list, optional) – Code(s) of the target network(s).

  • station (string or list, optional) – Code(s) of the target station(s).

  • channel (string or list, optional) – Code(s) of the target channel(s).

  • location (string or list, optional) – Code(s) of the target location(s).

  • starttime (string or obspy.UTCDateTime, optional) – Target start time.

  • endtime (string or obspy.UTCDateTime, optional) – Target end time.

  • tag (string, default to 'raw') – Tag name in the ASDF file.

Returns:

traces – The seismic data.

Return type:

obspy.Stream

BPMF.data_reader_examples.data_reader_template(where, network='*', station='*', channel='*', location='*', starttime='*', endtime='*', **kwargs)[source]

Data reader for BPMF.

Any data reader must have the present signature.

Parameters:
  • where (string) – Path to data file or root data folder.

  • network (string or list, optional) – Code(s) of the target network(s).

  • station (string or list, optional) – Code(s) of the target station(s).

  • channel (string or list, optional) – Code(s) of the target channel(s).

  • location (string or list, optional) – Code(s) of the target location(s).

  • starttime (string or obspy.UTCDateTime, optional) – Target start time.

  • endtime (string or obspy.UTCDateTime, optional) – Target end time.

Returns:

traces – The seismic data.

Return type:

obspy.Stream