A simple wrapper around athena++ vtk reader #25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added simple code snippets to
LoadSim
for identifying athena++ vtk files and read them. Users can useload_vtk
to read the data. It returns a dictionary containing arrays x1f, x2f, x3f, and other field variables. It works for both uniform grids and AMR data. The shape of x1f is (nmb, nx1_mb), field_var (nmb, nx1_mb, nx2_mb, nx3_mb). I have not tested for joined vtk files.In its current form it's not very much useful. We can make it more useful by adding an option for converting to an xarray DataSet (especially for uniform grids data or data with a few levels of refinement). We can also improve the vanilla athena++ vtk reader (currently it doesn't even read the output time).
However, unless there are advantages of using vtk output (possibly as tarred format?) over hdf5 with athena++, it will not be worth putting much effort to improve this.