[Paraview] Data set comparison

Berk Geveci berk.geveci at kitware.com
Tue Mar 30 13:12:48 EDT 2010


Unfortunately, you have to copy the array with something like:

copy_array = original_array.NewInstance()
copy_array.DeepCopy(original_array)
copy_array.SetName("foo")
copy_array.UnRegister(None)

Having said that there might be a better way of doing this. Are you
planning to use the calculator to compare these arrays later in the
pipeline?

-berk

On Mon, Mar 29, 2010 at 11:34 AM,  <Luca.Clementi at tororosso.com> wrote:
> Dear Berk,
>
> this really helped me a lot, thanks!
>
>
> But now Im stuck with another problem.
>
> The scalar value that I'm trying to compare from the two data sets have the
> same names.
>
>
> meanTotalPressure
>
>
> So when I do the AddArray() in my script the second array simply overrides
> the first one.
>
> http://www.vtk.org/doc/nightly/html/classvtkFieldData.html#a22259e3c071ac8ff7a62ac49e9f1a92e
>
>
> I tried to change the name with SetName() method, but it changes the Array
> name globally, and the second time I run the filter the GetArray returns
> NoneType object.
>
>
> Do I have to copy the object to rename it?
>
>
> Sincerely,
>
> Luca
>
> -----------------------------------
>
> i0 = self.GetInputDataObject(0,0)
> i1 = self.GetInputDataObject(0,1)
> o = self.GetOutputDataObject(0)
> print "the class is: " +
> str(i0.GetPointData().GetArray("meanTotalPressureMonitor").__class__)
> array0 = i0.GetPointData().GetArray("meanTotalPressureMonitor")
> array0.SetName("meanTotalPressure0")
> o.GetPointData().AddArray(array0)
> array1 = i1.GetPointData().GetArray("meanTotalPressureMonitor")
> array1.SetName("meanTotalPressure1")
> o.GetPointData().AddArray(array1)
> -----------------------------------
>
>
> Berk Geveci <berk.geveci at kitware.com> wrote on 03/23/2010 08:57:52 PM:
>>
>> This is because the EnSight reader produces a multi-block dataset. Try
>> applying Merge Blocks filter first.
>>
>> -berk
>>
>> On Mon, Mar 22, 2010 at 1:12 PM,  <Luca.Clementi at tororosso.com> wrote:
>> > Hi all,
>> > Im trying to compare two data sets in Ensight .case format.
>> >
>> > I found only this thread referring to data set comparison:
>> > http://www.cmake.org/pipermail/paraview/2008-November/010034.html
>> >
>> > But I could not get it to work. I tried resamply directly the two
>> > Ensight
>> > data reader. Then I also tried to filter the two Ensight data readers
>> > through a CellDatatoPointData reader and also through a CellCenter (with
>> > vertex cells active), but I always get:
>> > ERROR: In
>> > /home/kitware/ParaView3/Utilities/BuildScripts/ParaView-3.6/
>> ParaView3/VTK/Filtering/vtkDataSet.cxx,
>> > line 406
>> > vtkUnstructuredGrid (0x3a46da0): Point array vtkValidPointMask with 1
>> > components, only has 3726 tuples but there are 407364 pointsERROR: In
>> > /home/kitware/ParaView3/Utilities/BuildScripts/ParaView-3.6/
>> ParaView3/VTK/Filtering/vtkDataSet.cxx,
>> > line 406
>> > vtkUnstructuredGrid (0x67183e0): Point array vtkValidPointMask with 1
>> > components, only has 3726 tuples but there are 407364 points
>> >
>> >
>> > ERROR: In
>> > /home/kitware/ParaView3/Utilities/BuildScripts/ParaView-3.6/
>> ParaView3/VTK/Filtering/vtkExecutive.cxx,
>> > line 757
>> > vtkCompositeDataPipeline (0x65c0b20): Algorithm
>> > vtkPVGeometryFilter(0x65bdb80) returned failure for request:
>> > vtkInformation (0x67155a0)
>> >  Debug: Off
>> >  Modified Time: 13672858
>> >  Reference Count: 1
>> >  Registered Events: (none)
>> >  Request: REQUEST_DATA
>> >  FROM_OUTPUT_PORT: 0
>> >  ALGORITHM_AFTER_FORWARD: 1
>> >  FORWARD_DIRECTION: 0
>> >
>> >
>> > I also tried the programmable filter suggested in the previous email,
>> > (using two input file with the same geometry), but in that case I always
>> > get:
>> >
>> > paraview version 3.6.2, Date: 2009-05-18
>> >
>> > Traceback (most recent call last):
>> >  File "<string>", line 25, in <module>
>> >  File "<string>", line 5, in RequestData
>> > AttributeError: GetPointData
>> >
>> >
>> > That's the filter Im trying to use:
>> > i0 = self.GetInputDataObject(0,0)
>> > i1 = self.GetInputDataObject(0,1)
>> > o = self.GetOutputDataObject(0)
>> > o.GetPointData().AddArray(i0.GetPointData().GetArray
>> ("meanTotalPressureMonitor"))
>> > o.GetPointData().AddArray(i1.GetPointData().GetArray
>> ("meanTotalPressureMonitor"))
>> >
>> >
>> > Thank you very much for your help!
>> >
>> > Sincerely,
>> > Luca
>> >
>> >
>> >
>
> _________________________________________________________________________________________________________________
> Questo messaggio è da intendersi esclusivamente ad uso del destinatario e
> può contenere informazioni che sono di natura privilegiata, confidenziale
> o non divulgabile secondo le leggi vigenti. Se il lettore del presente
> messaggio non è il destinatario designato, o il dipendente/agente
> responsabile
> per la consegna del messaggio al destinatario designato, si informa che ogni
> disseminazione, distribuzione o copiatura di questa comunicazione è
> strettamente proibita anche ai sensi del decreto legislativo 196/03 . Se
> avete ricevuto questo messaggio per errore, vi preghiamo di notificarcelo
> immediatamente a mezzo e-mail di risposta e successivamente di procedere
> alla cancellazione di questa e-mail e relativi allegati dal vostro sistema.
> _________________________________________________________________________________________________________________
> This message is intended only for the use of the addressee and may contain
> information that is privileged, confidential and exempt from
> disclosure under applicable law. If the reader of this message is not the
> intended recipient, or the employee or agent responsible for delivering the
> message to the intended recipient, you are hereby notified that any
> dissemination, distribution or copying of this communication is strictly
> prohibited. If you have received this e-mail in error, please notify us
> immediately by return e-mail and delete this e-mail and all attachments from
> your system.
> _________________________________________________________________________________________________________________
>


More information about the ParaView mailing list