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