Commit eb032ebd authored by LAMBERT Jean-charles's avatar LAMBERT Jean-charles
Browse files

add density

parent 5ca38e71
......@@ -4,6 +4,7 @@ from __future__ import print_function
from py_unstools import * # import py_unstools package
from py_unsio import *
from uns_simu import *
from cfalcon import *
import numpy as np
#
......@@ -16,7 +17,6 @@ class CSnapshot:
select=None
def __init__(self,simname,select="all",times="all",float32=True,verbose=False,verbose_debug=False):
simname=simname.encode('ascii')
select=select.encode('ascii')
times=times.encode('ascii')
self.__verbose=verbose
......@@ -26,6 +26,7 @@ class CSnapshot:
if self.__vdebug:
print(">>",float32)
if simname is not None:
simname=simname.encode('ascii')
if float32:
if self.__vdebug:
print("32 bits",simname,select,times,verbose,type(simname),type(select))
......@@ -172,5 +173,19 @@ class CSnapshot:
data[:,2] -= zcom
return xcom,ycom,zcom
#
def computeDensity(self,pos,mass,K=32,N=1,method=0,ncrit=None):
"""
Compute local density using falcON algorithm
Return :
boolean, rho, hsml
Arguments :
see getDensity from cfalcon modules
"""
c=CFalcon() # new falcon object
return c.getDensity(pos,mass) # compute density
Supports Markdown
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