Merge branch 'master' of https://bitbucket.org/glavaux/cosmotool
This commit is contained in:
commit
7c68df0c97
@ -87,7 +87,7 @@ class ProgrammableParticleHistoryLoad(object):
|
|||||||
class ProgrammableDensityLoad(object):
|
class ProgrammableDensityLoad(object):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def main_script(source, density, extents=None, aname="default"):
|
def main_script(source, density, extents=None, aname="default", extra_arrays={}):
|
||||||
import vtk
|
import vtk
|
||||||
from vtk.util import numpy_support
|
from vtk.util import numpy_support
|
||||||
|
|
||||||
@ -117,6 +117,11 @@ class ProgrammableDensityLoad(object):
|
|||||||
arr.SetName(aname)
|
arr.SetName(aname)
|
||||||
ido.GetPointData().AddArray(arr)
|
ido.GetPointData().AddArray(arr)
|
||||||
|
|
||||||
|
for k in extra_arrays.keys():
|
||||||
|
arr = numpy_support.numpy_to_vtk(extra_arrays[k].transpose().astype(np.float64).ravel(), deep=1)
|
||||||
|
arr.SetName(k)
|
||||||
|
ido.GetPointData().AddArray(arr)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def request_information(source, density=None, dims=None):
|
def request_information(source, density=None, dims=None):
|
||||||
import vtk
|
import vtk
|
||||||
|
Loading…
Reference in New Issue
Block a user