- get_flags(files, starttime=None, endtime=None, io_flags=True, activity_flags=True, data_quality_flags=True, timing_quality=True)
Counts all data quality, I/O, and activity flags of the given MiniSEED file and returns statistics about the timing quality if applicable.
starttime (str or
obspy.core.utcdatetime.UTCDateTime) – Only use records whose end time is larger than this given time.
endtime (str or
obspy.core.utcdatetime.UTCDateTime) – Only use records whose start time is smaller than this given time.
io_flags (bool) – Extract I/O flag counts.
activity_flags (bool) – Extract activity flag counts.
data_quality_flags (bool) – Extract data quality flag counts.
timing_quality (bool) – Extract timing quality and corresponding statistics.
Dictionary with information about the timing quality and the data quality, I/O, and activity flags. It has the following keys:
This method will count all set bit flags in the fixed header of a MiniSEED file and return the total count for each flag type. The following flags are extracted:
Data quality flags:
Amplifier saturation detected (station dependent)
Digitizer clipping detected
Missing/padded data present
Telemetry synchronization error
A digital filter may be charging
Time tag is questionable
Calibration signals present
Time correction applied
Beginning of an event, station trigger
End of the event, station detriggers
A positive leap second happened during this record
A negative leap second happened during this record
Event in progress
I/O and clock flags:
Station volume parity error possibly present
Long record read (possibly no problem)
Short record read (record padded)
Start of time series
End of time series
If the file has a Blockette 1001 statistics about the timing quality will be returned if
timing_qualityis True. See the doctests for more information.
This method will read the timing quality in Blockette 1001 for each record in the file if available and return the following statistics: Minima, maxima, average, median and upper and lower quartiles.
>>> from obspy.core.util import get_example_file >>> filename = get_example_file("qualityflags.mseed") >>> flags = get_flags(filename) >>> for k, v in flags["data_quality_flags_counts"].items(): ... print(k, v) amplifier_saturation 9 digitizer_clipping 8 spikes 7 glitches 6 missing_padded_data 5 telemetry_sync_error 4 digital_filter_charging 3 suspect_time_tag 2
Reading a file with Blockette 1001 will return timing quality statistics if requested.
>>> filename = get_example_file("timingquality.mseed") >>> flags = get_flags(filename) >>> for k, v in sorted(flags["timing_quality"].items()): ... print(k, v) all_values [...] lower_quartile 25.0 max 100.0 mean 50.0 median 50.0 min 0.0 upper_quartile 75.0