pyrocko.squirrel.client.base¶
Base class for Squirrel remote data clients.
Classes
|
Used by some data-sources to grow or join locally mirrored data selections. |
|
Base class for Squirrel data-sources. |
|
Summary information about a data source. |
- class Constraint(**kwargs)[source]¶
Bases:
ObjectUsed 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), optionalStart time of constrained interval, or
Nonefor an open start.
- ♦ tmax¶
pyrocko.util.get_time_float (
pyrocko.guts.Timestamp), optionalEnd time of constrained interval, or
Nonefor an open end.
- ♦ codes¶
listofpyrocko.model.codes.CodesNSLCEobjects, optionalCodes patterns of channels the constraint applies to, or
Nonefor no restriction.
- 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(*args, **kwargs)[source]¶
Bases:
HasPathsBase 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.
- get_cache_path()[source]¶
Get path to the source’s on-disk cache directory, if any.
- Return type:
str or
None
- setup(squirrel, check=True, upgrade=False)[source]¶
Set up the source so it is ready to be used with a squirrel instance (internal use, see
add_source()).- Parameters:
squirrel (
Squirrel) – Squirrel instance the source is being attached to.check (bool) – If
True, check file modification times of already indexed local files (slow). IfFalse, use Squirrel’s fast--optimisticmode instead.upgrade (bool) – If
True, automatically migrate any FDSN waveform archives found using an outdated on-disk storage layout.