Configuration

CDFViewer reads an optional configuration file and a handful of environment variables. Everything works without any configuration. These are the knobs for adapting the viewer to your environment, such as HPC systems, shared grid pools, or slow file systems.

The configuration file

The configuration lives at ~/.config/cdfviewer/config.toml (respecting XDG_CONFIG_HOME), and the full path can be overridden with the CDFVIEWER_CONFIG environment variable. Currently it configures the grid file search.

[grid]
search = true                       # master switch for automatic search
search_dirs = [
    "~/grids",                      # your own grid collection
    "/pool/data/ICON/grids/public", # e.g. the pool on Levante
]
download = false                    # opt-in: fetch grid_file_uri if not found
download_dir = "~/.cache/cdfviewer/grids"

Environment variables

VariableDefaultEffect
CDFVIEWER_HISTORY~/.cdfviewer_historylocation of the REPL history file
CDFVIEWER_CONFIG~/.config/cdfviewer/config.tomllocation of the configuration file
CDFVIEWER_USE_LOCALfalseset to true to make --use-local the default
CDFVIEWER_LOCAL_DIRa temporary directorythe local directory used by --use-local
XDG_CONFIG_HOME~/.configbase directory for the configuration file

Slow file systems and --use-local

Recording a video writes many frames to disk before assembling the final file. On network file systems (as common on HPC login nodes), this can be painfully slow. With the --use-local flag, CDFViewer performs temporary file operations in a fast local directory and only moves the final result to your working directory.

cdfviewer output.nc --use-local

Set CDFVIEWER_USE_LOCAL=true in your shell profile to make this the default, and CDFVIEWER_LOCAL_DIR to control which local directory is used.