pyrocko.squirrel.check

Functionality to check for common data/metadata problems.

Functions

do_check(squirrel[, codes, tmin, tmax, ...])

Check for common data/metadata problems.

get_matching(coverages, coverage)

Find coverages with matching codes, best sampling-rate match first.

Classes

KindChoiceWCR(...)

Choice of content kind, restricted to 'waveform', 'channel' or 'response' (the kinds inspected by do_check()).

SquirrelCheck(**kwargs)

Container for Squirrel check results.

SquirrelCheckEntry(**kwargs)

Squirrel check result for a given channel/response/waveform.

SquirrelCheckProblem(**kwargs)

Diagnostics about a potential problem reported by Squirrel check.

SquirrelCheckProblemType(...)

Potential dataset/metadata problem types.

get_matching(coverages, coverage)[source]

Find coverages with matching codes, best sampling-rate match first.

Parameters:
  • coverages (iterable of Coverage objects) – Coverages to search.

  • coverage (Coverage) – Coverage to match against, by codes and, as a tie-breaker for ordering, by deltat.

Returns:

Matching coverages, with any having the same sampling rate as coverage sorted first.

Return type:

list of Coverage

class SquirrelCheckProblemType(...) → str[source]

Bases: StringChoice

Potential dataset/metadata problem types.

Squirrel check problem types

Type

Description

p1

Waveform duplicates.

p2

Overlaps in channel/response epochs.

p3

No waveforms available for a channel/response listed in metadata.

p4

Channel/response information missing for an available waveform.

p5

Multiple channel/response entries matching an available waveform.

p6

Sampling rate of waveform does not match rate listed in metadata.

p7

Waveform incompletely covered by channel/response epochs.

p8

Unexpected response input quantity.

class SquirrelCheckProblem(**kwargs)[source]

Bases: Object

Diagnostics about a potential problem reported by Squirrel check.

♦ type

str (SquirrelCheckProblemType)

Coding indicating the type of problem detected.

♦ symptom

str

Short description of the problem.

♦ details

list of str objects, default: []

Details about the problem.

class KindChoiceWCR(...) → str[source]

Bases: StringChoice

Choice of content kind, restricted to 'waveform', 'channel' or 'response' (the kinds inspected by do_check()).

class SquirrelCheckEntry(**kwargs)[source]

Bases: Object

Squirrel check result for a given channel/response/waveform.

♦ codes

pyrocko.model.codes.CodesNSLCE

Codes denominating a seismic channel.

♦ available

list of str (KindChoiceWCR) objects, default: []

Available content kinds.

♦ problems

list of SquirrelCheckProblem objects, default: []

Potential problems detected.

get_text()[source]

Textual representation of this entry’s check result.

Return type:

str

class SquirrelCheck(**kwargs)[source]

Bases: Object

Container for Squirrel check results.

♦ entries

list of SquirrelCheckEntry objects, default: []

Check results, one entry per checked channel.

get_nproblems()[source]

Total number of problems detected.

Return type:

int

get_summary()[source]

Textual summary of check result.

Return type:

str

get_text(verbosity=0)[source]

Textual representation of check result.

Parameters:

verbosity (int) – Set verbosity level.

Return type:

str

do_check(squirrel, codes=None, tmin=None, tmax=None, time=None, ignore=[])[source]

Check for common data/metadata problems.

Parameters:
Returns:

SquirrelCheck object containing the results of the check.