[Paraview] difference of two data sets
Eric E. Monson
emonson at cs.duke.edu
Fri Apr 2 14:43:23 EDT 2010
Hey Xunlei,
So, you probably know that you can just highlight both data sets and then apply the Python Programmable Filter (PPF) and it will take multiple inputs.
If you are working from CVS ParaView compiled with Python support and have Numpy installed, you can compare attributes of two data sets with the same geometry by putting something like this in the PPF script pane:
elev0 = inputs[0].PointData['Elevation']
elev1 = inputs[1].PointData['Elevation']
output.PointData.append(elev1 - elev0, 'difference')
Here I had two cones that each had the Elevation filter applied. If I had two cones, one of which is a linearly transformed version of the other, I could get the difference vectors for each of the points like this:
pts0 = inputs[0].Points
pts1 = inputs[1].Points
output.PointData.append(pts1-pts0,'translation')
I'm still not up on all of the new API for this, so Berk can fill in more, but maybe that can get you started?
Regarding getting a vector from the individual components, you can use the Calculator filter with something like this as the equation:
vx*iHat + vy*jHat + vz*kHat
and it will create a three-component vector result. Then, you can glyph the data with arrows which are oriented along those vectors.
Talk to you later,
-Eric
On Apr 2, 2010, at 1:35 PM, Xunlei Wu wrote:
> Hi Berk,
> I was playing with programmable filter feature. Do you have any
> tutorial/examples that I can follow? My initial test would be on two
> structured mesh with the same geometry but different size. So I can skip
> the delaunay filter. After I am done with the resample filter, how can I
> compute the difference of two scalar fields from two data sets?
>
> On another novice ParaView user issue, I would like to plot the vector
> field or arrow glyphs from the structured grid data where I stored say
> velocity info. as 3 individual fields vx, vy, vz in HDF5 and XDMF. I
> tried Glyph filter. But I don't know how to use it (arrow) to represent
> vx, vy, vz.
>
> Thanks a lot for your help.
>
> Best,
> x
>
> On 4/2/2010 1:23 PM, Berk Geveci wrote:
>> The best way that I can think of doing this is to map the particle
>> data onto the structured mesh and then use the programmable filter to
>> compute the difference on the mesh. Have you thought about how that
>> would be done? You can use the delaunay filter to first create an
>> unstructured mesh from the particle data and then use the resample
>> filter to map that onto the structured mesh. That would obviously make
>> certain assumptions about how the field represented by the particles
>> is interpolated. The alternative is to use the closest point. What do
>> you think?
>>
>> 2010/4/2 Xunlei Wu <xunlei at renci.org>:
>>
>>> Hi Berk,
>>> Ideally, I would like to have pvserver in the back to handle large scale
>>> data sets. But for now, speed is not an issue. And I know how to do
>>> multiview to show two data sets side-by-side with linked camera. I
>>> currently do not have the difference between data sets pre-computed, and
>>> would like to use some ParaView features to handle that.
>>> Thanks for your help.
>>>
>>> Best,
>>> x
>>>
>>> On 4/2/2010 10:56 AM, Berk Geveci wrote:
>>>
>>>> Xunlei,
>>>>
>>>> Are you trying to do this in parallel?
>>>>
>>>> -berk
>>>>
>>>> On Fri, Apr 2, 2010 at 10:36 AM, Xunlei Wu <xunlei at renci.org> wrote:
>>>>
>>>>
>>>>> Hi All,
>>>>> I want to visualize the difference between two data sets and plot the
>>>>> error on one data set as the reference. Currently, I have 2 structured
>>>>> grid data sets of the same gemoetry; and 2 unstructured point cloud data
>>>>> sets.
>>>>> Are there any filters in ParaView for this purpose? Thanks a lot.
>>>>>
>>>>> Best,
>>>>> xunlei
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.paraview.org/mailman/listinfo/paraview
>>>>>
>>>>>
>>>>>
>>>
>>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
More information about the ParaView
mailing list