Skip to content

Latest commit

 

History

History
171 lines (98 loc) · 5.89 KB

File metadata and controls

171 lines (98 loc) · 5.89 KB

Command-Line Interface

General Usage

The Waveform Editor provides a command-line interface (CLI) tool, waveform-editor, for exporting waveform configurations defined in YAML files to various formats.

Getting Help

You can get help on the main command and view the list of available subcommands by running:

waveform-editor --help

To get help for a specific subcommand, use:

waveform-editor <command> --help

For example:

waveform-editor export-ids --help

Version Information

To display the installed version of the Waveform Editor package, use the -v or --version flag:

waveform-editor --version

Commands

The CLI is organized into several subcommands for different export targets.

Specifying Time Points for Export

All export commands allow you to specify the time points at which the waveforms should be evaluated. You can do this using one of the following options:

  • --linspace START,STOP,NUM: Generates an array of NUM evenly spaced time points starting at START and ending at STOP (inclusive). The values must be provided as comma-separated numbers, e.g., --linspace 0,10,101.

  • --csv PATH: Provides the path to a CSV file containing the desired time points.

    Note

    The CSV file must contain exactly one row of comma-separated numerical values representing the time points. For example: 0.0,0.1,0.2,0.5,1.0,2.0,5.0,10.0

export-ids

Exports the waveform data to an IMAS IDS.

Usage:

waveform-editor export-ids [OPTIONS] YAML URI

Description:

This command reads the waveform definitions from the specified YAML file, evaluates them at the time points defined by either --linspace or --csv, and writes the results into the specified IMAS data entry (URI). It uses the dd_version specified in the YAML configuration and can optionally use machine descriptions if provided in the global configuration parameters.

Arguments:

  • YAML: Path to the input waveform YAML configuration file.
  • URI: The URI specifying the IMAS data entry or IMAS NetCDF filename to write to.

Options:

Note

You must provide exactly one of --linspace or --csv for this command.

export-png

Exports plots of the individual waveforms to PNG image files.

Usage:

waveform-editor export-png [OPTIONS] YAML OUTPUT_DIR

Description:

This command reads the waveform definitions from the YAML file and generates a separate PNG plot for each defined waveform. The plots are saved in the specified OUTPUT_DIR. If --linspace or --csv is provided, waveforms are evaluated at those specific time points for plotting. If neither is provided, default time points suitable for visualizing each waveform's shape will be used.

Arguments:

  • YAML: Path to the input waveform YAML configuration file.
  • OUTPUT_DIR: Path to the directory where the output PNG files will be saved. The directory will be created if it doesn't exist.

Options:

export-csv

Exports the evaluated waveform data to a single CSV file.

Usage:

waveform-editor export-csv [OPTIONS] YAML OUTPUT_DIR

Description:

This command reads the waveform definitions from the YAML file, evaluates them at the time points specified by either --linspace or --csv, and writes the results into a single CSV file within the specified OUTPUT_DIR. The CSV file will contain a 'time' column followed by columns for each waveform defined in the configuration.

Arguments:

  • YAML: Path to the input waveform YAML configuration file.
  • OUTPUT_CSV: Path where the output CSV file will be saved. The parent directory will be created if it doesn't exist.

Options:

Note

You must provide exactly one of --linspace or --csv for this command.

export-pcssp-xml

Exports the waveform data to a PCSSP-compatible XML file.

Usage:

waveform-editor export-pcssp-xml [OPTIONS] YAML OUTPUT_XML

Description:

This command reads waveform definitions from the given YAML file, evaluates them at the specified time points (via --linspace or --csv), and exports the result to a PCSSP-compatible XML file at the path specified by OUTPUT_XML. The XML format includes signal declarations and associated time-based trajectories.

Arguments:

  • YAML: Path to the input waveform YAML configuration file.
  • OUTPUT_XML: Path to the file where the XML data will be saved. The parent directory will be created if it does not exist.

Options:

Note

You must provide exactly one of --linspace or --csv for this command.