RPLOT
An Interactive Utility to Access TRANSP Output
RPLOT is the standard interactive tool for inspecting TRANSP output. It can list available output quantities, plot scalar time traces, plot profiles and multigraph packages, compare quantities across runs, inspect comments and namelist values, and generate plot scripts for repeatable post-processing.
Capabilities
- Generate a table of contents with available 1-D and 2-D TRANSP output names.
- Plot scalar functions and multigraphs versus time.
- Plot functions of time and an additional coordinate, such as radius.
- List the contents of selected multigraph packages.
- Add or delete scalar and profile multigraph packages.
- Draw profile multigraphs.
- View comments and examine TRANSP namelist values.
- Create an index of graphs drawn during a session.
- Change the displayed name or abbreviation of a function.
- Redefine non-temporal x axes for plotting.
- Redirect table-of-contents output and select subsets for output options.
- Plot plasma MHD equilibrium information.
- Set plotting scale defaults.
- Read or extract UFILE time-series data for scalar multiplots.
- Use the calculator option to compute and plot user-defined functions of time or radius and time.
- Compare the same quantity for multiple TRANSP runs.
- Use the ALL_PLOT option to generate scripts for all available plot items.
Gnuplot Backend
RPLOT now includes a gnuplot backend in addition to the legacy terminal output. The gnuplot backend is selected
with TERMINAL_TYPE=GNUPLOT or TERMINAL_TYPE=GP. It can be used interactively with an
X11, Qt, or wxt gnuplot window, or in headless mode to generate image files directly.
Benefits
- Color plots: multigraph curves use distinct colors, and 2-D output can use color maps.
- Editable gnuplot output: RPLOT can keep the generated
.gpand.datfiles, so plots can be customized for presentations or publication-quality figures. - Scripted production: the backend can be used in automated workflows to generate many plots or multiplots in one run.
- Headless operation: PNG, PDF, and SVG output can be produced without an interactive graphics window.
Basic setup
Interactive X11 plotting:
# Interactive X11 plotting
export TERMINAL_TYPE=GNUPLOT
export RPLOT_GP_TERM=x11
Headless PNG output:
# Headless PNG output
export TERMINAL_TYPE=GNUPLOT
export RPLOT_GP_OUTPUT=png
export RPLOT_GP_OUTDIR=./plots
mkdir -p "$RPLOT_GP_OUTDIR"
Keep editable gnuplot files:
# Keep generated .gp and .dat files for editing
export TERMINAL_TYPE=GNUPLOT
export RPLOT_GP_OUTPUT=png
export RPLOT_GP_OUTDIR=./plots
export RPLOT_GP_KEEP=1
mkdir -p "$RPLOT_GP_OUTDIR"
Export gnuplot files without running gnuplot:
# Export-only mode for scripted post-processing
export TERMINAL_TYPE=GNUPLOT
export RPLOT_GP_OUTDIR=./plots
export RPLOT_GP_KEEP=1
export RPLOT_GP_NOEXEC=1
mkdir -p "$RPLOT_GP_OUTDIR"
Generate include snippets for assembling custom multiplots:
# Also write .gpinc snippets without terminal/output directives
export TERMINAL_TYPE=GNUPLOT
export RPLOT_GP_OUTDIR=./plots
export RPLOT_GP_INCLUDE=1
mkdir -p "$RPLOT_GP_OUTDIR"
Gnuplot environment variables
| Variable | Typical values | Description |
|---|---|---|
TERMINAL_TYPE |
GNUPLOT, GP |
Enables the gnuplot backend. |
RPLOT_GP_TERM |
x11, qt, wxt |
Sets the interactive gnuplot terminal. If unset and DISPLAY is available, RPLOT defaults to X11. |
RPLOT_GP_OUTPUT |
png, pdf, svg |
Forces file output. The backend uses pngcairo, pdfcairo, or svg terminals. If no display is available and no terminal is specified, PNG output is selected automatically. |
RPLOT_GP_OUTDIR |
., ./plots |
Directory for output files. The directory must already exist. |
RPLOT_GP_KEEP |
0, 1 |
Keeps generated .gp and .dat files when set to 1. By default, temporary files are removed after plotting. |
RPLOT_GP_INCLUDE |
0, 1 |
Writes a .gpinc file without set term or set output commands, useful for composing custom multiplots. This also keeps the generated files. |
RPLOT_GP_NOEXEC |
0, 1 |
Skips execution of gnuplot and only writes the generated files. This also keeps the generated files. |
RPLOT_GP_CNTR_LEVELS |
15, integer values |
Sets the number of contour levels for 2-D contour plots. |
RPLOT_GP_FONTSIZE |
14, integer values |
Sets the base font size used in generated gnuplot scripts. |
RPLOT_GP_LW |
2, integer values |
Sets the line width for generated plots. |
RPLOT_GP_BORDERLW |
2, integer values |
Sets the plot border line width. |
RPLOT_GP_WINBASE |
0, integer values |
Sets the base gnuplot window number for interactive terminals. RPLOT offsets this value for 1-D, multigraph, 2-D, and 3-D plots. |
Output files
When file output is selected, RPLOT writes files with names such as
rplot_page000001_1d.png, rplot_page000001_multi.png,
rplot_page000001_2d.png, or rplot_page000001_3d.png in
RPLOT_GP_OUTDIR. If RPLOT_GP_KEEP=1, the matching gnuplot script
and data files are kept with the same base name and extensions .gp and .dat.
Limitations
- The gnuplot backend is not completely developed for all 2-D RPLOT plot paths. Basic contour and color-map style output is available, but some legacy 2-D plots may still require the legacy graphics path.
- For editable output, set
RPLOT_GP_KEEP=1; otherwise generated scripts and data files are treated as temporary files. RPLOT_GP_OUTDIRmust point to an existing directory.
Running RPLOT
-
Load the TRANSP or NTCC environment:
A compiler module may need to be loaded first, depending on the local PPPL environment.module load ntcc -
Start an interactive RPLOT session:
RPLOT will display a menu and prompt for the data source and run information.rplot -
Read from PPPL disk:
Example:rplot d $ARCDIR/<tok>/<yy> q <runid>rplot d $ARCDIR/NSTX/05 q 117899A02 -
Read from the PPPL MDSplus server:
Example:rplot t y <tok>.<yy> q <runid>rplot t y NSTX.05 q 117899A02 -
Read from a non-PPPL MDSplus server:
export MDS_TRANSP_SERVER=atlas.gat.com export MDS_TRANSP_TREE=transp rplot t y D3D.09 q 136886A01 -
Read from a pulse-number based MDSplus tree, for example C-Mod:
rplot t s <server> t <tree> n <MDS pulse number> q
Generating a Table of Contents
-
Write 1-D and 2-D function names to a file:
rplot t y <TOK>.<YY> q <runid> 1 q q > <file> -
Print 1-D and 2-D function names:
rplot t y <TOK>.<YY> q <runid> 1 q q | lpr -
Print multigraph package names:
rplot t y <TOK>.<YY> q <runid> 4 q q | lpr
Templates and Repeatable Plotting
RPLOT can record an interactive session and replay it for the same or a different run. At an RPLOT prompt,
enter >filename to start recording commands into filename.tmi, and enter < to stop recording.
rplot t y NSTX.05 q 117899A02
>my_template
... interactive RPLOT commands ...
<
Replay the template for another run:
rplot t y NSTX.09 q 133046P05 @my_template
Templates can also use variable names. Enter the variable name in single quotes during template creation and provide the actual value when replaying the template.
'RunId'
117899A02
rplot @my_template/TokYr=NSTX.09/RunId=133046P05
Legacy Plot Output
The legacy SGLIB/PostScript path remains available for workflows that still rely on it. For new scripted and headless plot generation, the gnuplot backend is generally preferred because it produces editable gnuplot scripts and modern image formats directly.
export PLOT=",foo.plt-ps"
To write data to the PostScript file in the legacy path, type d at the pause prompt after the beep.
Additional Customization
MDS_TRANSP_SERVER: default MDSplus server, for exampleexport MDS_TRANSP_SERVER=atlas.gat.com.MDS_TRANSP_TREE: default MDSplus tree, for exampleexport MDS_TRANSP_TREE=transp.RPLOT_CACHE: set toTRUEwhen repeatedly inspecting the same run.
Send comments and questions to transp_support