Skip to main content

Python wrapper to unsiotools

Project description

ABOUT

UNSIOTOOLS contains a collection of unsio based programs and depends of the Nemo package. You have access to falcON algorithm to compute density and gravity.

Installing python wrapper

pip install python-unsiotools -U

To get some docstring help

# Help on falcON class
pydoc unsiotools.simulations.cfalcon

Usage

  • In the example below, we load a RAMSES simulation, and compute density on HALO particles
import unsio.input as uns_in  # unsio reading module
import unsiotools.simulations.cfalcon as falcon

myfile="/home/jcl/output_00004" # input RAMSES simulation
# we instantiate a CUNS_IN object
my_in=uns_in.CUNS_IN(myfile,"halo") # We select components HALO
#
# Reading
#
if my_in.nextFrame(): # load snapshot
  # read halo positions
  status,pos=my_in.getData("halo","pos")
  # read halo mass
  status,mass=my_in.getData("halo","mass")
  # read time simulation
  status,timex=my_in.getData("time")

# we compute density
cf=falcon.CFalcon()
ok,rho,hsml=cf.getDensity(pos,mass)

print("Rho=",rho)
  • In this more simple example, we compute density on random data. Note that data must be in float32 format
import unsiotools.simulations.cfalcon as falcon
import numpy as np

pos=np.float32(np.random.random_sample((300,)))
mass=np.float32(np.random.random_sample((100,)))

cf=falcon.CFalcon()

ok,rho,hsml=cf.getDensity(pos,mass)

print(ok,rho)

Licence

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

Webpage

PLease visit :

Copyright

Copyright Jean-Charles LAMBERT
Jean-Charles.Lambert_at_lam.fr

Project details


Download files

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

Files for python-unsiotools, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size python_unsiotools-0.0.5-cp27-cp27m-manylinux1_x86_64.whl (9.0 MB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp27-cp27m-manylinux2010_x86_64.whl (12.4 MB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp27-cp27mu-manylinux1_x86_64.whl (9.0 MB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp27-cp27mu-manylinux2010_x86_64.whl (12.4 MB) File type Wheel Python version cp27 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp34-cp34m-manylinux1_x86_64.whl (10.8 MB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp34-cp34m-manylinux2010_x86_64.whl (12.7 MB) File type Wheel Python version cp34 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp35-cp35m-manylinux1_x86_64.whl (10.8 MB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp35-cp35m-manylinux2010_x86_64.whl (12.7 MB) File type Wheel Python version cp35 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp36-cp36m-manylinux1_x86_64.whl (10.8 MB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp36-cp36m-manylinux2010_x86_64.whl (12.7 MB) File type Wheel Python version cp36 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp37-cp37m-manylinux1_x86_64.whl (10.8 MB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp37-cp37m-manylinux2010_x86_64.whl (12.7 MB) File type Wheel Python version cp37 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp38-cp38-manylinux1_x86_64.whl (10.8 MB) File type Wheel Python version cp38 Upload date Hashes View hashes
Filename, size python_unsiotools-0.0.5-cp38-cp38-manylinux2010_x86_64.whl (12.7 MB) File type Wheel Python version cp38 Upload date Hashes View hashes
Filename, size python-unsiotools-0.0.5.tar.gz (71.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page