pyrocko.squirrel.client.catalog¶
Squirrel online earthquake catalog client.
Functions
|
Get online catalog client by name. |
Classes
|
Squirrel data-source to transparently access online earthquake catalogs. |
|
Chain link representing a locally mirrored time span of a |
Exceptions
Raised when an unknown catalog name is requested, see |
- class Link(tmin, tmax, tmodified, nevents=-1, content_id=None)[source]¶
Bases:
objectChain link representing a locally mirrored time span of a
CatalogSource’s remote catalog (internal use).
- exception NoSuchCatalog[source]¶
Bases:
ExceptionRaised when an unknown catalog name is requested, see
get_catalog().
- get_catalog(name)[source]¶
Get online catalog client by name.
- Parameters:
name (str) – Catalog name, one of
'geofon','gcmt','isc'or'usgs'.- Raises:
NoSuchCatalog – If
nameis not one of the known catalogs.
- class CatalogSource(catalog, query_args=None, **kwargs)[source]¶
Bases:
SourceSquirrel data-source to transparently access online earthquake catalogs.
The catalog source maintains and synchronizes a partial copy of the online catalog, e.g. of all events above a certain magnitude. The time span for which the local copy of the catalog should be up-to date is maintained automatically be Squirrel. Data is loaded and updated in chunks as needed in a just-in-time fashion. Data validity can optionally expire after a given period of time and new data can be treated to be preliminary. In both cases information will be refreshed as needed.
- ♦ catalog¶
strCatalog name.
- ♦ query_args¶
dictofstrobjects, optionalCommon arguments, which are appended to all queries, e.g. to constrain location, depth or magnitude ranges.
- ♦ expires¶
float(pyrocko.guts.Duration), optionalExpiration time [s]. Information older than this will be refreshed, i.e. queried again.
- ♦ anxious¶
float(pyrocko.guts.Duration), optionalAnxiety period [s]. Information will be treated as preliminary if it was younger than this at the time of its retrieval. Preliminary information is refreshed on each query relevant to it.
- ♦ cache_path¶
str(pyrocko.has_paths.Path), optionalDirectory path where the partial local copy of the catalog is kept. By default the Squirrel environment’s cache directory is used.
- setup(squirrel, check=True, upgrade=False)[source]¶
Set up cache directory and add already-downloaded local events to the squirrel.
See
setup()for the parameters.
- make_hash()[source]¶
Compute hash identifying this source’s configuration.
Used to distinguish between differently-configured
CatalogSourceinstances pointing at the samecatalogwhen choosing on-disk cache locations.- Return type:
- get_hash()[source]¶
Get hash identifying this source’s configuration (see
make_hash()).- Return type:
- update_event_inventory(squirrel, constraint=None)[source]¶
Query and cache events for a given constraint, refreshing any locally mirrored time spans found outdated (see
expires/anxious).- Parameters:
squirrel (
Squirrel) – Squirrel instance the source is attached to.constraint (
Constraint) – Selection of times to be brought up to date. Required; if itstmin/tmaxare unset, the current data holdings’ time span is used instead.
- query_args_typed()[source]¶
Get
query_argswith known numeric keys (magnitude, latitude, longitude and depth ranges) converted fromstrtofloat.- Return type: