View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0015770 | ParaView | (No Category) | public | 2015-10-12 08:39 | 2016-08-12 09:59 | ||||
Reporter | Eelco van Vliet | ||||||||
Assigned To | Kitware Robot | ||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | ||||
Status | closed | Resolution | moved | ||||||
Platform | OS | OS Version | |||||||
Product Version | 4.4 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0015770: Not all numpy funtions can be acccessed in PythonCalculator | ||||||||
Description | I 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 Information | I 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") | ||||||||
Tags | No tags attached. | ||||||||
Project | ParaViewVR | ||||||||
Topic Name | |||||||||
Type | feature | ||||||||
Attached Files | |||||||||
Relationships | |
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. |
Notes |
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 |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |