Hi David, <br><br>Thanks for you suggestion, I got much closer to what I want, but not quite yet. I have the feeling I need one slight extra hint :)<br><br>To obtain the position of a minimun value I now do the script below: I get the mimimum value first with MinMax, then I Threshold the original data on a range between min and 0.9*min (the minimum values are negative), then I use the calculator to get the x and y position of this range, and then I use the DescriptiveStatitics filter to get the average mean of the position. I can even use Fetch again to obtain the data, but now the very last step: how to I get the mean data itself ? Sorry, I just don't understand how that data.objects exactly work, and there is not much assessible documentation on it. <br>
<br>I hope you can give me one last hint<br><br>Regards<br><br>Eelco <br><br> mm=MinMax(Uzcomponent)<br> mm.Operation="MIN"<br> mindata=sm.Fetch(Uzcomponent,mm,mm) <br> mindata.GetPointData().GetNumberOfArrays()<br>
a0 = mindata.GetPointData().GetArray(1)<br> uzname=a0.GetName()<br> uzmin=a0.GetTuple1(0)<br> print "minimum of %s found: %g\n "%(uzname,uzmin)<br><br> Threshold1 = Threshold(Uzcomponent)<br>
Threshold1.Scalars=['POINTS',uzname]<br> Threshold1.ThresholdRange=[uzmin,0.9*uzmin]<br><br> CalcPos = Calculator()<br> CalcPos.AttributeMode = 'point_data'<br> CalcPos.Function = 'iHat*coordsX+jHat*coordsY+kHat*coordsZ'<br>
CalcPos.ResultArrayName = 'MinPos'<br><br> DescriptiveStatistics1 = DescriptiveStatistics()<br> DescriptiveStatistics1.VariablesofInterest = ['MinPos']<br> statistics=sm.Fetch(DescriptiveStatistics1)<br>
<br><br><br><br><div class="gmail_quote">On Thu, Feb 10, 2011 at 7:00 PM, David E DeMarle <span dir="ltr"><<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The min max filter unfortunately doesn't keep track of which tuple and<br>
processor it found the min in so you can't get back to the particular<br>
point or cell it came from.<br>
<br>
Instead of using fetch and minmax, try using a values selection. Set<br>
the value to be that minimum value. Once you extract the selection and<br>
fetch it to the client, you get a copy of the actuall cell(s)/point(s)<br>
that have the minimum value and you can query them directly for their<br>
spatial location.<br>
<br>
David E DeMarle<br>
Kitware, Inc.<br>
R&D Engineer<br>
28 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: 518-371-3971 x109<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On Thu, Feb 10, 2011 at 12:13 PM, Eelco van Vliet <<a href="mailto:eelcovv@gmail.com">eelcovv@gmail.com</a>> wrote:<br>
> Dear Paraviewers,<br>
><br>
> I would like to extract the location of a minimum value from a data set in<br>
> pvbatch<br>
><br>
> I were able to find the value of the minimum with<br>
><br>
><br>
><br>
><br>
> mm=MinMax(Uzcomponent)<br>
> mm.Operation="MIN"<br>
> mindata=sm.Fetch(Uzcomponent,mm,mm)<br>
> mindata.GetPointData().GetNumberOfArrays()<br>
> a0 = mindata.GetPointData().GetArray(1)<br>
> a1 = mindata.GetScalar()<br>
> print "name 1: ", a0.GetName()<br>
> print "tuple1: ", a0.GetTuple1(0)<br>
><br>
> Here, a0.GetTyple1 give me the value of the minimum<br>
><br>
> However: How do I find the location of this value ?<br>
><br>
> Any hint appriciate!<br>
><br>
> Regards<br>
><br>
> Eelco<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><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>
</blockquote></div><br>