data_quality_control.cmdline module

Module defining the command line interface to dataqc suite.

If you “just” want to use the commands please go to Command line tool.

Here, we document the functions defining the command line tool. The CLI is implemented using argparse.

General usage is:

dataqc [-h] {process,plot,available,avail,windfilter,wind} args
  • subcommands are implemented using argparse.subparsers, but to improve legibility of the code subparsers are defined in functions marked by decorator @subcommand.

  • for each subparser, there is a function run_subcommand containing the actual program.

Warning

Functions are not intended for use outside of this module.

data_quality_control.cmdline.avail(subparsers)
data_quality_control.cmdline.main()

Executed if user calls a dataqc cli-command.

  • Measures execution time

  • shows help

  • sets log level of module logger

  • parses arguments

  • calls respective subcommands

data_quality_control.cmdline.main_subparser()

Returns main parser of cli dataqc. Collects subcommands as subparsers.

data_quality_control.cmdline.plot_amplitudes(subparsers)
data_quality_control.cmdline.plot_spectrogram(subparsers)
data_quality_control.cmdline.process(subparsers)
data_quality_control.cmdline.read_file_as_list_of_utcdatetimes(f)

Read UTCDateTime-compatible lines in file handler.

Parameters

f (filehandler) – handle to file containing datetimes per line. Other lines are ignored (e.g. if f=stdin)

data_quality_control.cmdline.run_available(args)

Requests available HDF5 data based on cli-arguments.

Uses dataqc.analysis.Analyzer.get_all_available_data(). Expects station code and data directory. Station code can contain wildcards.

Parameters

args (argparse.Namespace) – parsed cli arguments

data_quality_control.cmdline.run_plot_amplitudes(args)

Create amplitude plots from cli-arguments.

Parameters

args (argparse.Namespace) – parsed cli arguments

data_quality_control.cmdline.run_plot_spectrogram(args)

Plot classic and/or 3D interactive spectrogram.

data_quality_control.cmdline.run_processing(args)

Run SDS processing job based on cli-arguments.

Based on script scripts/run_processing.py. Computes mean amplitudes and power spectral densities of seismic data for given station code using dataqc.sds_db. Results are stored in HDF5-files.

Parameters

args (argparse.Namespace) – parsed cli arguments

data_quality_control.cmdline.run_smoothing(args)
data_quality_control.cmdline.run_windfilter(args)

Interpolate and extract list of datetimes based on observation value provided by file.

Values are first interpolated to indicated time spacing (delta) which should correspond to the window length used for processing of the seimic data. The resulting list is then filtered for times for which minspeed <= value <= maxspeed. Designed usecase is a list of wind speed measurements.

data_quality_control.cmdline.smooth(subparsers)
data_quality_control.cmdline.subcommand(func)

Decorator that registers functions as subcommands.

data_quality_control.cmdline.windfilter(subparsers)