Skip to content

Visualization

The plot subcommand can be used as a general purpose IMAS plotting tool.

To run the command:

duqtools plot

Check out the command-line interface for more info on how to use this command.

This page shows some examples on how to use the plotting tool.

Plotting IMAS data

duqtools plot can be used as general IMAS plotting tool.

The following command will plot grid/rho_tor_norm against t_i_averge. The plotting tool will prefix profiles_1d in to the IDS path and load all time steps.

duqtools plot -x grid/rho_tor_norm -y t_i_average --imas g2ssmee/jet/94875/8000

The tool use altair to render the visualization, which in is based on on Vega and Vega-Lite. This means the plot is stored as an html file (chart_x.html).

Multiple data sets can be plotted by repeating the IMAS path.

duqtools plot -x grid/rho_tor_norm -y t_i_average \
    --imas jet/94875/8000 \
    --imas jet/94875/8001 \
    --imas jet/94875/8002

Note that the username is omitted from the imas path (--imas jet/94875/8000). When the user is left out, the current user is assumed. The equivalent way to write this would be: --imas g2ssmee/jet/94875/8000.

In addition, you can generate multiple charts by adding more y values. This is more efficient, because the data has to be loaded only once.

duqtools plot \
    -x grid/rho_tor_norm \
    -y electrons/density \
    -y electrons/temperature \
    --imas jet/94875/8000 \
    --imas jet/94875/8001 \
    --imas jet/94875/8002

Data from UQ runs

You can also read data from runs.yaml, which is generated by duqtools after a UQ run.

duqtools plot \
    -x grid/rho_tor_norm \
    -y t_i_average \
    -i runs.yaml

In fact, you can freely combine the different inputs, for example if you want to compare your output to some reference data.

duqtools plot \
    -x grid/rho_tor_norm \
    -y t_i_average \
    -i runs.yaml \
    --imas jet/94875/8000

From a CSV file

Data can also be specified using a CSV file. Check the dashboard documentation for more info on how to construct this file.

duqtools plot \
    -x grid/rho_tor_norm \
    -y t_i_average \
    -i data.csv