CLI#

Wavespectra has a command line interface to access some of the functionality of the library.

Top level commands#

$ wavespectra --help
Usage: wavespectra [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  convert
  reconstruct

Convert#

$ wavespectra convert --help
Usage: wavespectra convert [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  format  Converts INFILE with format defined by ENGINE to OUTFILE with...
  stats   Write a new file OUTFILE with integrated parameters from INFILE.

Convert file format

$ wavespectra convert format --help
Usage: wavespectra convert format [OPTIONS] INFILE ENGINE OUTFILE FMT

  Converts INFILE with format defined by ENGINE to OUTFILE with new format
  FMT.

Options:
  -k, --engine_kwargs <TEXT TEXT>...
                                  kwargs to pass to file reader engine, repeat
                                  for multiple key-value pairs
  -o, --overwrite                 Overwrite OUTFILE if it exists
  --help                          Show this message and exit.

Convert to integrated spectral parameters

$ wavespectra convert stats --help
Usage: wavespectra convert stats [OPTIONS] INFILE ENGINE OUTFILE

  Write a new file OUTFILE with integrated parameters from INFILE.

Options:
  -k, --engine_kwargs <TEXT TEXT>...
                                  kwargs to pass to file reader engine, repeat
                                  for multiple key-value pairs
  -p, --parameters TEXT           Integrated parameters to include, repeat for
                                  multiple parameters  [default: hs, tp, dpm]
  --help                          Show this message and exit.

Reconstruct#

$ wavespectra reconstruct --help
Usage: wavespectra reconstruct [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  spectra  Partition and reconstruct spectra from file.

Partition and reconstruct spectra from file

$ wavespectra reconstruct spectra --help
Usage: wavespectra reconstruct spectra [OPTIONS] INFILE ENGINE OUTFILE

  Partition and reconstruct spectra from file.

Options:
  -k, --engine_kwargs <TEXT TEXT>...
                                  kwargs to pass to file reader engine, repeat
                                  for multiple key-value pairs
  -f, --freq_name TEXT            Frequency function  [default: jonswap]
  -d, --dir_name TEXT             Spread function  [default: cartwright]
  -pm, --partition_method TEXT    Partitioning method, either `ptm1`, `ptm2`
                                  or `ptm3`  [default: ptm3]
  -m, --method_combine TEXT       Method to combine partitions  [default: max]
  -p, --parts INTEGER             Number of partitions to keep  [default: 4]
  -c, --chunks <TEXT TEXT>...     Chunks dict to chunk dataset before
                                  partitioning, repeat for multiple dims
  --help                          Show this message and exit.