<HTML dir=ltr><HEAD><TITLE>Re: [Paraview] compute min/max of data array and annotate max and min values for each time step</TITLE></HEAD>
<BODY>
<DIV dir=ltr id=idOWAReplyText40315>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial>Utkarsh,</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial>Thanks! The script had one small error (for a non MultiBlockDataSet), which I fixed -- see attached. It now works just fine for the two test cases I tried -- files in the regular legacy *.vtk format and the multi-block *.exo format. </FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial>I saved the Python script as a Custom Filter in case anyone else wants to use it. Thanks again for your help.</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial></FONT> </DIV>
<DIV dir=ltr><FONT size=2 face=Arial>Cheers,</FONT></DIV>
<DIV dir=ltr><FONT size=2 face=Arial>Emily</FONT></DIV>
<DIV dir=ltr><FONT color=#000000 size=2 face=Arial><FONT size=2 face=Arial></FONT><FONT size=2 face=Arial> </DIV></DIV></FONT></FONT>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Utkarsh Ayachit [mailto:utkarsh.ayachit@kitware.com]<BR><B>Sent:</B> Wed 9/14/2011 7:53 PM<BR><B>To:</B> Guzas, Emily L CIV NUWC NWPT<BR><B>Cc:</B> paraview@paraview.org<BR><B>Subject:</B> Re: [Paraview] compute min/max of data array and annotate max and min values for each time step<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Emily,<BR><BR>Attached is the python script to use in the filer. I've added a new<BR>MODE that can be used to set to use min or max.<BR><BR>Utkarsh<BR><BR>On Wed, Sep 14, 2011 at 11:51 AM, Guzas, Emily L CIV NUWC NWPT<BR><emily.guzas@navy.mil> wrote:<BR>> Utkarsh,<BR>><BR>> Thanks! This works pretty well in serial. However, I took your<BR>> MaxLabelFilter and tried to modify it to calculate and display minimum<BR>> (instead of maximum) array values for each time step and for some reason it<BR>> isn't working -- just assigns a zero value as the minimum. Could you take a<BR>> quick look? I saved the XML file as a *.txt file in case my email tries to<BR>> strip the attachment.<BR>><BR>> And yes, I will be working in parallel, but not right now.<BR>><BR>> Thanks again,<BR>> Emily<BR>><BR>> ________________________________<BR>> From: Utkarsh Ayachit<BR>> Sent: Wed 9/14/2011 10:08 AM<BR>> To: Guzas, Emily L CIV NUWC NWPT<BR>> Cc: paraview@paraview.org<BR>> Subject: Re: [Paraview] compute min/max of data array and annotate max and<BR>> min values for each time step<BR>><BR>> Emily,<BR>><BR>> Attached is a custom filter that you can use to label using maximum<BR>> for point array named ACCL. You change the "ARRAYNAME" and<BR>> "ARRAYASSOCIATION" variable to pick the array of choice. Also, though<BR>> I've only implemented getting the max value for the magnitude of the<BR>> array, you can change the python script to do a min or a particular<BR>> component, for example.<BR>><BR>> To test,<BR>> 1) Import the attached file using Tools | Manage Custom Filters dialog<BR>> (click Import).<BR>> 2) The open can.ex2 from ParaViewData. Enable all arrays in the array<BR>> selection widget on the properties panel. Hit apply.<BR>> 3) Create "MaxLabelFilter". Hit apply. You'll see a label in the 3D<BR>> view that updates as you animate.<BR>><BR>> Are you running with a parallel pvserver? If so, I'll have to update<BR>> the filter. It should work in serial though.<BR>><BR>> Utkarsh<BR>><BR>> On Tue, Sep 13, 2011 at 2:28 PM, Guzas, Emily L CIV NUWC NWPT<BR>> <emily.guzas@navy.mil> wrote:<BR>>> Hello,<BR>>><BR>>> I am a ParaView newbie and I am trying to compute the maximum and minimum<BR>>> values of one array (e.g. pressure or density) in a multi-block dataset<BR>>> (*.exo) file in ParaView, and then display those maximum and minimum<BR>>> values<BR>>> on screen with text. To make this more fun, the dataset includes time<BR>>> data,<BR>>> and so what I really want to be able to do is to compute the maximum and<BR>>> minimum values of the array and display them on-screen for each time step<BR>>> so<BR>>> that when I animate the data, the max/min values update as the animation<BR>>> runs.<BR>>><BR>>> Could someone point me in the right direction for how to do this?<BR>>><BR>>> I looked at the Calculator filter, but I don't see any maximum and minimum<BR>>> functions there (not that I expected to see them). And I just started<BR>>> looking at the Python Programmable Filter, but I am not familiar with the<BR>>> vtk class and so this route will involve a bit of a learning curve to<BR>>> figure<BR>>> out the syntax for what I need to accomplish.<BR>>><BR>>> Thanks,<BR>>> Emily<BR>>><BR>>> _______________________________________________<BR>>> Powered by www.kitware.com<BR>>><BR>>> Visit other Kitware open-source projects at<BR>>> <A href="http://www.kitware.com/opensource/opensource.html" target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR>>><BR>>> Please keep messages on-topic and check the ParaView Wiki at:<BR>>> <A href="http://paraview.org/Wiki/ParaView" target=_blank>http://paraview.org/Wiki/ParaView</A><BR>>><BR>>> Follow this link to subscribe/unsubscribe:<BR>>> <A href="http://www.paraview.org/mailman/listinfo/paraview" target=_blank>http://www.paraview.org/mailman/listinfo/paraview</A><BR>>><BR>>><BR>><BR></FONT></P></DIV></BODY></HTML>