Tools for reading and working with simulation output from The stellar atmosphere simulation code Bifrost in Julia.
This Julia package is created for working with Bifrost data efficiently. Load single or multiple simulation snapshots, and analyse data with Julia speed.
This package is an extension of Bifrost.jl
, a script written by Mikolaj Szydlarski.
The documentation is available at https://ita-solar.github.io/BifrostTools.jl
To install the package, open julia and add it in the package manager (the package manager is opened by typing ]
)
] add BifrostTools
To load the package, type the following in the REPL
using BifrostTools
The function get_var
is the main function for reading data from Bifrost simulations.
It can read single or multiple snapshots, and it can read full data cubes or slices.
It can read primary variables or auxiliary variables.
The command
variable = get_var(expname, snap, expdir, variable)
loads the (primary or auxiliary) variable variable
from snapshot snap
in the simulation expname
located in the directory expdir
.
By creating a BifrostExperiment
object
brxp = BifrostExperiment(expname, expdir)
we can access the mesh file
brxp.mesh
snapshot numbers
brxp.snaps
and the calling signature of get_var
can be simplified
variable = get_var(brxp, snap, variable)
Using optional keyword-arguments in get_var
allows us to convert units, destagger variables, rotate the grid, and read slices of the full cube.
The command
bx = get_var(brxp, snap, "bx"; units="si", destagger=true)
will load the
See the documentation for further information and more elaborate example usage.
Contributions are welcome. Please read CONTRIBUTING.md