README: Add brief info how to read data.
Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
parent
775537cecf
commit
62b835ccf8
35
README.md
35
README.md
@ -60,17 +60,17 @@ Requirements
|
||||
runs, tested with version 1.8 or newer.
|
||||
* Optional [HDF5 libraries](https://www.hdfgroup.org/solutions/hdf5/), tested
|
||||
with version 1.10 or newer. The code now uses the new XML-binary snapshot
|
||||
format. However, if you still wants to use older HDF5 snapshot format, you
|
||||
format. However, if you still want to use older HDF5 snapshot format, you
|
||||
will need these libraries.
|
||||
|
||||
|
||||
Environment Variables
|
||||
=====================
|
||||
|
||||
If the HDF5 libraries are not installed in the default location, i.e. in the
|
||||
system directory **/usr**, make sure that the environment variable _HDF5DIR_ is
|
||||
set in your **~/.bashrc** (or **~/.cshrc**) and pointing to the location where
|
||||
the HDF5 libraries have been installed.
|
||||
If you need to use the HDF5 libraries and they are not installed in the default
|
||||
location, i.e. in the system directory **/usr**, make sure that the environment
|
||||
variable _HDF5DIR_ is set in your **~/.bashrc** (or **~/.cshrc**) and pointing
|
||||
to the location where the HDF5 libraries have been installed.
|
||||
|
||||
|
||||
Compilation
|
||||
@ -109,3 +109,28 @@ In order to run parallel version (after compiling the code with MPI support),
|
||||
type in your terminal:
|
||||
`mpirun -n N ./amun.x -i ./params.in`,
|
||||
where N is the number of processors to use.
|
||||
|
||||
|
||||
Reading data
|
||||
============
|
||||
|
||||
By default, the code uses new XML+binary snapshot data format. It can also be
|
||||
forced by setting parameter **snapshot_format** to **xml**.
|
||||
|
||||
In order to read produced data in this format, you will need to install the
|
||||
provided Python module. Simply change to **python/** directory and run
|
||||
`python setup.py install --user`
|
||||
to install the module in your home directory.
|
||||
|
||||
Import the module in your python script using
|
||||
`from amunpy import *`,
|
||||
and then initiate the interface using
|
||||
`snapshot = AmunXML(<path to the snapshot directory>)`
|
||||
and read desired variable using
|
||||
`var = snapshot.dataset(<variable>)`.
|
||||
|
||||
The function **dataset()** returns rescaled uniform mesh variable as NumPy
|
||||
array.
|
||||
|
||||
If you want to read data from HDF5 snapshot, just use
|
||||
`var = amun_dataset(<snapshot HDF5 file>, <variable>)`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user