Skip to main content

A python wrapper to unsio

Project description

ABOUT

UNSIO (Universal Nbody Snapshot Input Output) is an API which perform input/output operations in a generic way, and on different kind of nbody files format (nemo, Gadget binaries 1 and 2, Gadget hdf5, Ramses). By using this API, a user could write only one analysis program which will work on all known files format supported by UNSIO. It's not necessary anymore to know how is implemented a file format, UNSIO will do transparently and automatically all the hard work for you ! With UNSIO, you will spend less time to develop your analysis program. UNSIO comes with an integrated sqlite3 database which can be used to retrieve automatically all your data among terabytes of hard disks.

Features

UNSIO can be used from different languages (C,C++,Fortran and Python)

Supported files format :

Installing python wrapper

pip install python-unsio

Usage

  • example : load gas and stars component of an UNS compliant snapshot
import unsio.input as uns_in

# we instantiate object
myfile="snashot.000"
my_in=uns_in.CUNS_IN(myfile,"gas,stars")

# load snapshot
if my_in.nextFrame():
  # 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
  status,timex=my_in.getData("time")
  • example : save previously loaded data in gadget3 format
import unsio.output as uns_out

# we instantiate object
myoutfile="snapshot.g3"
my_out=uns_out.CUNS_OUT(myoutfile,"gadget3")

# prepare data to be saved
# set time
status=my_out.setData(timex,"time")
# set positions for stars
status=my_out.setData(poss,"stars","pos")
# set positions for gas
status=my_out.setData(posg,"gas","pos")
# set density for gas
status=my_out.setData(rho,"gas","rho")

# save on disk
my_out.save()
# close
my_out.close()

License

UNSIO is open source and released under the terms of the CeCILL2 Licence

Webpage

PLease visit : https://projets.lam.fr/projects/unsio

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-unsio-0.9.3rc4.tar.gz (25.2 kB view hashes)

Uploaded Source

Built Distributions

python_unsio-0.9.3rc4-cp37-cp37m-manylinux2010_x86_64.whl (6.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

python_unsio-0.9.3rc4-cp37-cp37m-manylinux1_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 3.7m

python_unsio-0.9.3rc4-cp37-cp37m-macosx_10_13_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.7m macOS 10.13+ x86-64

python_unsio-0.9.3rc4-cp36-cp36m-manylinux2010_x86_64.whl (6.1 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

python_unsio-0.9.3rc4-cp36-cp36m-manylinux1_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 3.6m

python_unsio-0.9.3rc4-cp36-cp36m-macosx_10_13_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.6m macOS 10.13+ x86-64

python_unsio-0.9.3rc4-cp35-cp35m-manylinux2010_x86_64.whl (6.1 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

python_unsio-0.9.3rc4-cp35-cp35m-manylinux1_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 3.5m

python_unsio-0.9.3rc4-cp35-cp35m-macosx_10_13_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.5m macOS 10.13+ x86-64

python_unsio-0.9.3rc4-cp34-cp34m-manylinux2010_x86_64.whl (6.1 MB view hashes)

Uploaded CPython 3.4m manylinux: glibc 2.12+ x86-64

python_unsio-0.9.3rc4-cp34-cp34m-manylinux1_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 3.4m

python_unsio-0.9.3rc4-cp34-cp34m-macosx_10_13_x86_64.whl (1.8 MB view hashes)

Uploaded CPython 3.4m macOS 10.13+ x86-64

python_unsio-0.9.3rc4-cp27-cp27mu-manylinux2010_x86_64.whl (6.1 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

python_unsio-0.9.3rc4-cp27-cp27mu-manylinux1_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 2.7mu

python_unsio-0.9.3rc4-cp27-cp27m-manylinux2010_x86_64.whl (6.1 MB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ x86-64

python_unsio-0.9.3rc4-cp27-cp27m-manylinux1_x86_64.whl (4.3 MB view hashes)

Uploaded CPython 2.7m

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page