View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015770ParaView(No Category)public2015-10-12 08:392016-08-12 09:59
ReporterEelco van Vliet 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version4.4 
Target VersionFixed in Version 
Summary0015770: Not all numpy funtions can be acccessed in PythonCalculator
DescriptionI would like to clip my data field using the PythonCalculator in order to be able to clip the largest vectors from a data array

Normally I did this with

minimum(0.1, mag(U))*U/(mag(U)+1e-6)

But I noticed that minimum does not work anymore.

Also other useful numpy routines like clip do not work in 4.4. I would like to do

clip(mag(U), 0, 0.1)

But this gives 'name' clip ' not defined error.

Other numpy function like sin, square, and sqrt are available.

Is it possible to include the whole list as given here: http://docs.scipy.org/doc/numpy/reference/routines.math.html [^]
Additional InformationI found that the following PythonProgramableFilter does more or less what I want. But I used to do this in a one liner in the PythonCalculator. Anyway how to do this easier?


from vtk.numpy_interface import dataset_adapter as dsa
from vtk.numpy_interface import algorithms as algs
import numpy as np
import numpy.linalg

# input parameter

Umax = 1

data = inputs[0]

U = data.PointData['U']
alpha1 = data.PointData['alpha1']

def mag(x):
    return algs.sqrt(x[:,0]*x[:,0]+x[:,1]*x[:,1]+x[:,2]*x[:,2])

Umag = mag(U)
Un = U/algs.max(Umag)

msk = 1*(Umag<Umax)

Uclip = (U*msk+Umax*(1-msk))*alpha1

#print algs.min(Uclip), algs.max(Uclip)
#print algs.min(Umag), algs.max(Umag)
#print algs.min(msk), algs.max(msk)

output.PointData.append(Uclip, "Uclip")
TagsNo tags attached.
ProjectParaViewVR
Topic Name
Typefeature
Attached Files

 Relationships

  Notes
(0038906)
Kitware Robot (administrator)
2016-08-12 09:59

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current ParaView Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-10-12 08:39 Eelco van Vliet New Issue
2015-10-12 10:21 Eelco van Vliet Additional Information Updated
2016-08-12 09:59 Kitware Robot Note Added: 0038906
2016-08-12 09:59 Kitware Robot Status backlog => closed
2016-08-12 09:59 Kitware Robot Resolution open => moved
2016-08-12 09:59 Kitware Robot Assigned To => Kitware Robot


Copyright © 2000 - 2018 MantisBT Team