pyrocko.squirrel.client.base

Base class for Squirrel remote data clients.

Classes

Constraint(**kwargs)

Used by some data-sources to grow or join locally mirrored data selections.

Source(**kwargs)

Base class for Squirrel data-sources.

class Constraint(**kwargs)[source]

Bases: Object

Used by some data-sources to grow or join locally mirrored data selections.

Squirrel data-sources typically try to mirror only a subset of the remotely available data. This subset may need to be grown or updated when data from other time intervals or from locations outside the initially requested region is requested. This class helps in the involved bookeeping.

The current implementation only supports a time interval selection with a single time span but more sophisticated constraints, including e.g. location boxes could be thought of.

tmin

pyrocko.util.get_time_float (pyrocko.guts.Timestamp), optional

tmax

pyrocko.util.get_time_float (pyrocko.guts.Timestamp), optional

codes

list of pyrocko.squirrel.model.CodesNSLCE objects, optional

contains(constraint)[source]

Check if the constraint completely includes a more restrictive one.

Parameters:

constraint (Constraint) – Other constraint.

expand(constraint)[source]

Widen constraint to include another given constraint.

Parameters:

constraint (Constraint) – Other constraint.

Update is done in-place.

class Source(**kwargs)[source]

Bases: Object

Base class for Squirrel data-sources.

Data-sources can be attached to a Squirrel instance to allow transparent access to remote (or otherwise generated) resources, e.g. through FDSN web services (FDSNSource) or online event catalogs (CatalogSource).

Derived classes implement the details of querying, caching, updating and bookkeeping of the accessed data.

update_channel_inventory(squirrel, constraint)[source]

Let local inventory be up-to-date with remote for a given constraint.

update_event_inventory(squirrel, constraint)[source]

Let local inventory be up-to-date with remote for a given constraint.

update_waveform_promises(squirrel, constraint)[source]

Let local inventory be up-to-date with remote for a given constraint.

remove_waveform_promises(squirrel, from_database='selection')[source]

Remove waveform promises from live selection or global database.

Parameters:

from_database – Remove from live selection 'selection' or global database 'global'.

update_response_inventory(squirrel, constraint)[source]

Let local inventory be up-to-date with remote for a given constraint.