Utils¶
- copyright
Lion Krischer (lion.krischer@gmail.com), 2013-2021
- license
BSD 3-Clause (“BSD New” or “BSD Simplified”)
-
class
pyasdf.utils.
AuxiliaryDataAccessor
(auxiliary_data_type, asdf_data_set)[source]¶ Helper class to access auxiliary data items.
-
class
pyasdf.utils.
AuxiliaryDataGroupAccessor
(asdf_data_set)[source]¶ Helper class to facilitate access to the auxiliary data types.
-
class
pyasdf.utils.
FilteredWaveformAccessor
(station_name, asdf_data_set, filtered_items)[source]¶ A version of the waveform accessor returning a limited number of waveforms.
-
class
pyasdf.utils.
JobQueueHelper
(jobs, worker_names)[source]¶ A simple helper class managing job distribution to workers.
Init with a list of jobs and a list of workers.
- Parameters
jobs (List of arguments distributed to the jobs.) – A list of jobs that will be distributed to the workers.
workers – A list of usually integers, each denoting a worker.
- Type
list of integers
-
class
pyasdf.utils.
ProvenanceAccessor
(asdf_data_set)[source]¶ Accessor helper for the provenance records.
-
class
pyasdf.utils.
ReceivedMessage
(data)¶ Create new instance of ReceivedMessage(data,)
-
property
data
¶ Alias for field number 0
-
property
-
class
pyasdf.utils.
SimpleBuffer
(limit=10)[source]¶ Object that can be used as a cache.
Will never contain more then the specified number of items. If more then then that are used, it will remove the item with the oldest last access time.
-
class
pyasdf.utils.
StationAccessor
(asdf_data_set)[source]¶ Helper class to facilitate access to the waveforms and stations.
-
class
pyasdf.utils.
StreamBuffer
[source]¶ Very simple key value store for obspy stream object with the additional ability to approximate the size of all stored stream objects.
-
class
pyasdf.utils.
WaveformAccessor
(station_name, asdf_data_set)[source]¶ Helper class facilitating access to the actual waveforms and stations.
-
property
channel_coordinates
¶ Get coordinates of the station at the channel level if any.
-
property
coordinates
¶ Get coordinates of the station if any.
-
get_waveform_attributes
()[source]¶ Get a dictionary of the attributes of all waveform data sets.
This works purely on the meta data level and is thus fast. Event, origin, arrival, and focmec ids will be returned as lists as they can be set multiple times per data-set.
Get all available waveform tags for this station.
-
property
-
class
pyasdf.utils.
Worker
(active_jobs, completed_jobs_count)¶ Create new instance of Worker(active_jobs, completed_jobs_count)
-
property
active_jobs
¶ Alias for field number 0
-
property
completed_jobs_count
¶ Alias for field number 1
-
property
-
pyasdf.utils.
get_all_ids_for_prov_document
(document)[source]¶ Gets a all ids from a prov document as qualified names in the lxml style.
-
pyasdf.utils.
is_list
(obj)[source]¶ True if the returned object is an iterable but not a string.
- Parameters
obj – The object to test.
-
pyasdf.utils.
is_multiprocessing_problematic
()[source]¶ Return True if multiprocessing is known to have issues on the given platform.
Mainly results from the fact that some BLAS/LAPACK implementations cannot deal with forked processing.
-
pyasdf.utils.
split_qualified_name
(name)[source]¶ Takes a qualified name and returns a tuple of namespace, localpart.
If namespace is not a valid URL, an error will be raised.
- Parameters
name – The qualified name.