Skip to content

Commit

Permalink
[DOC] Add quick user guide to README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
eilifso committed Jun 17, 2024
1 parent 1b604be commit b7510ab
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,56 @@ This package is an extension of `Bifrost.jl`, a script written by Mikolaj Szydla
## Documentation
The documentation is available at [https://ita-solar.github.io/BifrostTools.jl](https://ita-solar.github.io/BifrostTools.jl)

## Quick user guide
To load the package, type the following in the REPL

```{julia}
using BifrostTools
```

### Using `get_var`
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

```{julia}
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

```{julia}
brxp = BifrostExperiment(expname, expdir)
```
we can access the mesh file

```{julia}
brxp.mesh
```
snapshot numbers
```{julia}
brxp.snaps
```
and the calling signature of `get_var` can be simplified

```{julia}
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

```{julia}
"bx" = get_var(brxp, snap, "bx"; units="si", destagger=true)
```
will load the $x$-component of the magnetic field in SI units and destagger it to the cell center.

See the [documentation](https://ITA-Solar.github.io/BifrostTools.jl/dev/) for further information and more elaborate example usage.

___
### Git commit message manners
The commit message is mainly for other people, so they should be able to understand it now and six months later. Commit messages cannot be longer than one sentence (line) and should start with a tag identifier (see the end of this section).
Expand Down

0 comments on commit b7510ab

Please sign in to comment.