Commit 374df4a4 authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles

rc5 on the way

parent 9ea7a327
......@@ -9,6 +9,8 @@
# ide
*.tags*
# linux
.nfs*
#swig
py/unsio/py_unsio.py
......
......@@ -27,33 +27,34 @@ pip install python-unsio
```
## Usage
- example : load gas and stars components of an UNS supported file format
- In the example below, we load a RAMSES simulation and we save it in GADGET3 file format
```python
import unsio.input as uns_in
import unsio.input as uns_in # unsio reading module
myfile="/home/jcl/output_00004" # input RAMSES simulation
# we instantiate object
myfile="snashot.000"
my_in=uns_in.CUNS_IN(myfile,"gas,stars")
# load snapshot
if my_in.nextFrame():
my_in=uns_in.CUNS_IN(myfile,"gas,stars") # We select components GAS and STARS
#
# Reading
#
if my_in.nextFrame(): # load snapshot
# read stars positions
status,poss=my_in.getData("stars","pos")
# read gas positions
status,posg=my_in.getData("gas","pos")
# read gas densities
status,rho=my_in.getData("gas","rho")
# read time
# read time simulation
status,timex=my_in.getData("time")
#
# Writing
#
import unsio.output as uns_out # unsio writing module
```
- example : save previously loaded data in gadget3 format
```python
import unsio.output as uns_out
myoutfile="snapshot.g3" # output file name
# we instantiate object
myoutfile="snapshot.g3"
my_out=uns_out.CUNS_OUT(myoutfile,"gadget3")
my_out=uns_out.CUNS_OUT(myoutfile,"gadget3") # select gadget3 output format
# prepare data to be saved
# set time
......@@ -65,10 +66,11 @@ status=my_out.setData(posg,"gas","pos")
# set density for gas
status=my_out.setData(rho,"gas","rho")
# save on disk
# write on file system
my_out.save()
# close
my_out.close()
```
## License
......
......@@ -48,7 +48,7 @@ class build_py(_build_py, object):
#
MAJOR = '0'
MINOR = '9'
MICRO = '3rc4'
MICRO = '3rc5'
VERSION = '%s.%s.%s' % (MAJOR, MINOR, MICRO)
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment