VisForge is a small, modular Python codebase for visualizing CarpetX simulation output. The initial scope supports CarpetX output discovery, TSV line plots, and clean backend interfaces for openPMD and Silo data.
This repository uses the Python interpreter specified in AGENTS.md:
$HOME/Misc/venv/py3/bin/python -m pytestList available commands and options:
$HOME/Misc/venv/py3/bin/visforge --help
$HOME/Misc/venv/py3/bin/visforge inspect --help
$HOME/Misc/venv/py3/bin/visforge plot-line --help
$HOME/Misc/venv/py3/bin/visforge plot-slice --helpInspect a CarpetX output tree:
$HOME/Misc/venv/py3/bin/visforge inspect /Users/liwei/docker-workspace/data/TestOutput2D/testoutput2dPlot a TSV line output:
$HOME/Misc/venv/py3/bin/visforge plot-line /Users/liwei/docker-workspace/data/TestOutput2D/testoutput2d \
--field gfc \
--axis x \
--title "gfc along x" \
--xlabel "x" \
--ylabel "gfc" \
--legend "gfc" \
--output gfc_x.pngPlot an openPMD scalar slice and overlay mesh/block outlines:
$HOME/Misc/venv/py3/bin/visforge plot-slice /Users/liwei/docker-workspace/data/TestOutput2D/testoutput2d \
--field gfc \
--iteration 0 \
--plane xy \
--backend openpmd \
--show-mesh \
--cmap cividis \
--title "gfc on xy plane" \
--xlabel "x" \
--ylabel "y" \
--colorbar "gfc" \
--mesh-alpha 0.75 \
--xlim -4 4 \
--ylim -4 4 \
--dpi 240 \
--output gfc_xy_mesh.pngCustom plot titles can include metadata placeholders such as {iteration},
{time:g}, {field}, {plane}, and {axis}. For example:
$HOME/Misc/venv/py3/bin/visforge plot-slice /Users/liwei/docker-workspace/data/TestOutput2D/testoutput2d \
--field B_x \
--iteration 0 \
--plane xy \
--backend openpmd \
--title '$B_x$ at iteration {iteration}, $t={time:g}$' \
--output B_x_xy.pngUse logarithmic color normalization for positive-valued scalar fields:
$HOME/Misc/venv/py3/bin/visforge plot-slice /Users/liwei/docker-workspace/data/TestOutput2D/testoutput2d \
--field rho \
--iteration 0 \
--plane xy \
--backend openpmd \
--cmap plasma \
--scale log \
--output rho_xy_log.pngUse a YAML config file instead of passing every option on the command line:
$HOME/Misc/venv/py3/bin/visforge plot-slice --config examples/plot_slice.yamlSample a 3D openPMD field onto a user-defined 2D plane:
$HOME/Misc/venv/py3/bin/visforge plot-slice /Users/liwei/docker-workspace/data/TestOutput3D/testoutput3d \
--field gfc \
--iteration 0 \
--backend openpmd \
--sample-plane-origin 0 0 0 \
--sample-plane-normal 1 1 0 \
--sample-plane-up 0 0 1 \
--sample-plane-size 8 8 \
--sample-plane-resolution 512 512 \
--interpolation linear \
--output gfc_sample_plane.pngCLI options override values from the config file:
$HOME/Misc/venv/py3/bin/visforge plot-slice \
--config examples/plot_slice.yaml \
--xlim -2 2 \
--ylim -2 2 \
--output gfc_zoom.png