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 :
- NEMO (read and write)
- GADGET 1 (read)
- GADGET 2 (read an write)
- GADGET 3/hdf5 (read and write)
- RAMSES (read)
- List of files stored in a file
- Simulations stored in SQLITE3 database
Installing python wrapper from PYPI
pip install unsio -U
Installing the library for C/C++/Fortran
- requirements :
- hdf5 devel
- sqlite3 devel
- Build
mkdir build cd build cmake .. make -j 4 && make install
To get some python docstring help
python -m pydoc unsio.input
python -m pydoc unsio.output
Python example code
- In the example below, we load a RAMSES simulation and we save it in GADGET3 file format
import unsio.input as uns_in # unsio reading module
myfile="/home/jcl/output_00004" # input RAMSES simulation
# we instantiate a CUNS_IN object
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 simulation
status,timex=my_in.getData("time")
#
# Writing
#
import unsio.output as uns_out # unsio writing module
myoutfile="snapshot.g3" # output file name
# we instantiate a CUNS_OUT object
my_out=uns_out.CUNS_OUT(myoutfile,"gadget3") # select gadget3 output format
# prepare data to be saved
# set time
status=my_out.setData(timex,"time")
# set stars positions
status=my_out.setData(poss,"stars","pos")
# set gas positions
status=my_out.setData(posg,"gas","pos")
# set gas densities
status=my_out.setData(rho,"gas","rho")
# write on file system
my_out.save()
# close
my_out.close()
License
UNSIO is open source and released under the terms of the CeCILL2 Licence
Webpage
PLease visit :
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file unsio-1.0.2rc1.tar.gz
.
File metadata
- Download URL: unsio-1.0.2rc1.tar.gz
- Upload date:
- Size: 297.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 243c57ddc008f0645e19d4f2ac6812772c685497691f5110d89726a26fcd9c31 |
|
MD5 | 4650bd37d4730449ab1279a8c4c05a64 |
|
BLAKE2b-256 | c13fe0e27bdea7778bba5a4f87164f2f286c1a90d83a60a3e5228a6016ddafa5 |
File details
Details for the file unsio-1.0.2rc1-cp313-cp313-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 784c98aa09081e3dc715c13d556f7aa155b2e4b5ba1acced03d7341d49176979 |
|
MD5 | 585b6be6f802e886d8a3ec01c43a3cee |
|
BLAKE2b-256 | 0f5dfb8dea175b8aef87cb61fb4753a5c5f78d40ce89e5e29baaf2bb4316e9c3 |
File details
Details for the file unsio-1.0.2rc1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d16f2bba88c5acd259296740db1ad6735dde238043706e67f17f4be784d743c |
|
MD5 | 3c5c19d140f02db57e9f9b45baa465b9 |
|
BLAKE2b-256 | bb72add9be6ae80433f97eeb97300ae0321250abe5de4859d0f97c5a7305e7b9 |
File details
Details for the file unsio-1.0.2rc1-cp312-cp312-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 403031dc0eec2761644badc35caad7591e9dd4e4cc5a67983c7cc565aa9dae80 |
|
MD5 | f10762dd2b7cedef8d091e79517adbe3 |
|
BLAKE2b-256 | 9a1a86cba9c1b072f541dc0abef0d1f6eb6422e05c8489312d8214968ed989cc |
File details
Details for the file unsio-1.0.2rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6f8ac0663329d2bc73afe8c21b0ca53fccdb0cc42b3611b9af68f9fa9977864 |
|
MD5 | 80f3324fd55a924b98ed80fce65675ed |
|
BLAKE2b-256 | 4f2d21afe5d1976a4f2a775b9be612a7f7e32f3e27d5d959ab1963c71c815628 |
File details
Details for the file unsio-1.0.2rc1-cp312-cp312-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp312-cp312-macosx_10_13_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: CPython 3.12, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 005ddde4c4efa68b23d0280c12c43ba97a60c99a83a8e34e3cde31ae1d16fb5f |
|
MD5 | cd2d9b14b064e2ae7e5dbf7c1d194f95 |
|
BLAKE2b-256 | 45c26e9f0a6d609fcc5a610dbc46d0a81271b819964b1ac7b2f2437a1f27850b |
File details
Details for the file unsio-1.0.2rc1-cp311-cp311-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf0f1266553ea86a10b558e0127ab8ea5fe250d309b8e9a97d2a2dadf9f7f2b5 |
|
MD5 | 212ac98c01323858ac27771fcf1e450a |
|
BLAKE2b-256 | 7a3f2ec820452d86072e1d757debfabb429a999ea39a871b17e8a74970adb403 |
File details
Details for the file unsio-1.0.2rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8c0c091bf2a265e52ea5c7fafea3d2ea3511b5133441f3cddbc07892ef35b67 |
|
MD5 | 9f741f5ffb774c41dcb54e9394e1421e |
|
BLAKE2b-256 | b3fa0f0d4be50a677a74559726dcbee2330659150c5c8616e3c4feb904607bf1 |
File details
Details for the file unsio-1.0.2rc1-cp311-cp311-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp311-cp311-macosx_10_13_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.11, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ef2fce28d71fd5361c2fba8961bb39afb1063379a3e170afa2eb3722025436a |
|
MD5 | c890ee485a7808f51efd944ac2a9eecb |
|
BLAKE2b-256 | 0f989b7387ec01fda3bc82825fff6b03f90d3892053132d1b14c8679bf079a39 |
File details
Details for the file unsio-1.0.2rc1-cp310-cp310-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d271a3b7b7d01329689f356a966960e14768fdb01e6f1848de7f884fee3a2cf6 |
|
MD5 | 3d399e0f257ccf8dd17a84f4d30f628a |
|
BLAKE2b-256 | 2d711dbf5e16f1357b932c459a45663da6736090d24efc5cc24c07235f1efea5 |
File details
Details for the file unsio-1.0.2rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94ad889ec0c357f153de25be7d8e84ddc19f03aba4ef503d4e99df16a4c2dd7a |
|
MD5 | 6525bd389c7100cc1b7bdfeb263425ab |
|
BLAKE2b-256 | 38f11487adb933d231cdbf8336704dfe97e99ae85822995ea7690914cc4566f5 |
File details
Details for the file unsio-1.0.2rc1-cp310-cp310-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp310-cp310-macosx_10_13_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.10, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2237aeb586d72f96a994da69cc1fae9a5cbc6525b7455e4a60951a0dfdee2d9a |
|
MD5 | cac887544e4fb959d34fb8cfefb9f4d6 |
|
BLAKE2b-256 | de50520454495f1473287b277355d2853dd03578930748845f8cf1fb745655e7 |
File details
Details for the file unsio-1.0.2rc1-cp39-cp39-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 018f3622b7a960416b8cb0f4842b1a089ff7c500923404c60e77231948842064 |
|
MD5 | 6cd92fa1bd17d4cc8515bba772075173 |
|
BLAKE2b-256 | 597a3c8f2ad89f8065006223408f5310ab5609339d0c28e740d2e5e099f1b182 |
File details
Details for the file unsio-1.0.2rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5301246745c091e768523ddef7b18a14060bddcb846a7ea56c69f32adc0574bb |
|
MD5 | ec5166e41b2876d866732ac8b71f3e06 |
|
BLAKE2b-256 | f55b2dd5b4c74b44678d2455cf367906127fced22bfdbe9d72a0ff21b538b324 |
File details
Details for the file unsio-1.0.2rc1-cp39-cp39-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp39-cp39-macosx_10_13_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.9, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36200ebfb76e4bd26bec16ceac14681674d93b3a6dbb2291da03efad7344e551 |
|
MD5 | 6ebc6e42bbcf911c2ae1e3ca401955b3 |
|
BLAKE2b-256 | 48974193547fd6d949bad51ecc60e4f291f6f2c6f8f10c69618b5888a419feb4 |
File details
Details for the file unsio-1.0.2rc1-cp38-cp38-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp38-cp38-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.8, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6042f620779a79c39349193a4e85f0e1118326d1ad60ba084ee4b42220312204 |
|
MD5 | d85b3691ed5a91b831a01760f44540f7 |
|
BLAKE2b-256 | 404d2ac382549b23fa7fac5bfc012be192c00c4ddeaa0fa79f08480eebf6b3de |
File details
Details for the file unsio-1.0.2rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ddb17ad819714455901a4617f8fd927ce2dedb8972d727a4425b31a3737e506 |
|
MD5 | 077547d94289d8c9b4053b19f6a8f236 |
|
BLAKE2b-256 | d8e089dacb4ec8f2863467b5067b2a62c24c579cf2e51d4e13e859f1ac36f647 |
File details
Details for the file unsio-1.0.2rc1-cp38-cp38-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: unsio-1.0.2rc1-cp38-cp38-macosx_10_13_x86_64.whl
- Upload date:
- Size: 4.1 MB
- Tags: CPython 3.8, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 490a0ed91065e16d5adb722a8f3e415164d64ccc442c8ff762e357a2bbe57e1a |
|
MD5 | c88bb10e1335bc8fc890f2cf5616c3ce |
|
BLAKE2b-256 | 5d80b0888b72aa3a0ac1bfe8a614369acea0b956ca2dec873289a0b3574577da |