Lion Krischer (lion.krischer@gmail.com), 2013-2021


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.


Get a list of all data sets for this station.

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.

  • 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.


list of integers


Get a job for a worker.


worker_name – The name of the worker requesting work.


Increment the point pills received counter.

received_job_from_worker(arguments, result, worker_name)[source]

Call when a worker returned a job.

  • arguments – The arguments the jobs was called with.

  • result – The result of the job

  • worker_name – The name of the worker.

class pyasdf.utils.ProvenanceAccessor(asdf_data_set)[source]

Accessor helper for the provenance records.


Get the provenance document containing a record with a certain id.


provenance_id – The id of the provenance record whose containing document is searched. Must be given as a qualified name, e.g. '{namespace_uri}id'.


Return a list of available provenance documents.

class pyasdf.utils.ReceivedMessage(data)

Create new instance of ReceivedMessage(data,)

property data

Alias for field number 0

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.


Try to approximate the size of all stores Stream object.

keys()a set-like object providing a view on D’s keys[source]
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 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.


Get a list of all data sets for this station.

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


Gets a all ids from a prov document as qualified names in the lxml style.


True if the returned object is an iterable but not a string.


obj – The object to test.


Returns True if the current environment is an MPI environment.


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.


List of labels to a comma-saperated string.


String to a list of labels.


Handy formatting for human readable filesize.

From http://stackoverflow.com/a/1094933/1657047


Takes a qualified name and returns a tuple of namespace, localpart.

If namespace is not a valid URL, an error will be raised.


name – The qualified name.


Converts an ASDF waveform name to the corresponding SEED identifiers.

>>> wf_name2seed_codes("BW.ALTM.00.EHE__2012-01-..__2012_01-...__synth")
("BW", "ALTM", "00", "EHE")

Extract the path from an ASDF waveform name.

>>> wf_name2seed_codes("BW.ALTM.00.EHE__2012-01-..__2012_01-...__synth")