<div dir="ltr"><div><div><div>Hi Ryan,<br><br></div>You should also be able to get the number of tuples, number of components, the range for each component, the name (though that is likely already known) and the data type that is being stored (e.g. double, float, int, etc.). I don't know how to get all of those of the top of my head but can poke around if needed.<br><br></div>Best,<br></div>Andy<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 12, 2017 at 1:01 PM, Jamison, Ryan Dale <span dir="ltr"><<a href="mailto:rdjamis@sandia.gov" target="_blank">rdjamis@sandia.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
Andy,
<div><br>
</div>
<div>I combined the Extract Filter Block with the example you outlined below and it worked! I was able to use GetRange() to get the minimum and maximum of the array for the current time. </div>
<div><br>
</div>
<div>On a side note, other than GetRange(), what else can be done with data from GetArray()?</div>
<div><br>
</div>
<div>Best, Ryan </div><div><div class="h5">
<div><br>
<div>
<blockquote type="cite">
<div>On Apr 11, 2017, at 7:46 PM, Andy Bauer <<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>> wrote:</div>
<br class="m_-2884485709288727073Apple-interchange-newline">
<div>
<div dir="ltr">
<div>
<div>
<div>Hi,<br>
<br>
Besides Yoshimi's way, you should be able to do something like the following from pvpython, pvbatch or Python shell.<br>
<span style="font-family:courier;font-size:7.8pt">yourfilter.PointData.GetArray(<wbr><arrayname>).GetRange() # or CellData<br>
<br>
</span></div>
<div><span style="font-family:courier;font-size:7.8pt">For example, for a Python script for a Wavelet source you would do the following:<br>
</span></div>
<div><span style="font-family:courier;font-size:7.8pt">w = Wavelet()<br>
</span></div>
<div><span style="font-family:courier;font-size:7.8pt">w.UpdatePipeline() # needed to execute the pipeline to create the output<br>
</span></div>
<div><span style="font-family:courier;font-size:7.8pt">w.PointData.GetArray("RTData")<wbr>.GetRange()<br>
</span></div>
<div><span style="font-family:courier;font-size:7.8pt"><br>
</span></div>
<span style="font-family:courier;font-size:7.8pt">This will work for the output of a filter that returns a regular VTK data set or a multiblock data set. If you want the range for only a single block of a multiblock I'd recommend using the Extract
Block filter to get that block. It should be a shallow copy of the data set to do that so it should be very fast, even if you don't need the output of the Extract Block filter for anything else.<br>
<br>
</span></div>
<span style="font-family:courier;font-size:7.8pt">Best,<br>
</span></div>
<span style="font-family:courier;font-size:7.8pt">Andy<br>
</span></div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Apr 11, 2017 at 9:29 PM, kenichiro yoshimi <span dir="ltr">
<<a href="mailto:rccm.kyoshimi@gmail.com" target="_blank">rccm.kyoshimi@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I also want to know if there is a simple way to do, since I only have<br>
the somewhat redundant code:<br>
---<br>
source = GetActiveSource()<br>
<br>
#options for component: -1, 0, 1 and 2 => Mag, X, Y, Z<br>
component = -1<br>
<br>
cdi = source.GetDataInformation().Ge<wbr>tCompositeDataInformation()<br>
<br>
for i in range(cdi.GetNumberOfChildren(<wbr>)):<br>
print 'Block Name: ', cdi.GetName(i)<br>
<br>
data = cdi.GetDataInformation(i).GetC<wbr>ellDataInformation()<br>
for j in range(data.GetNumberOfArrays()<wbr>):<br>
array = data.GetArrayInformation(j)<br>
arrayName = array.GetName()<br>
dataRange = array.GetComponentRange(compon<wbr>ent)<br>
print arrayName, dataRange<br>
---<br>
<br>
Thanks,<br>
yoshimi<br>
<div>
<div class="m_-2884485709288727073h5"><br>
2017-04-12 6:10 GMT+09:00 Jamison, Ryan Dale <<a href="mailto:rdjamis@sandia.gov" target="_blank">rdjamis@sandia.gov</a>>:<br>
> Hello Everyone,<br>
><br>
> I’m wanting to gain more control over automation with my paraview python<br>
> scripts. This time around, I’d like to be able to extract information from<br>
> the model and use it in my python script.<br>
><br>
> For example, I’d like to extract the minimum and maximum values of a cell<br>
> variable from a specific block and use those values in the python script.<br>
> Once I extract this information, I’d use it for some additional processing.<br>
> Something like:<br>
><br>
> minValue, maxValue = someCoolParaviewFunction(block<wbr>Name, variableName)<br>
><br>
> Is this possible? If so, any suggestions on how to do it?<br>
><br>
> Thanks,<br>
><br>
> Ryan<br>
><br>
</div>
</div>
> ______________________________<wbr>_________________<br>
> Powered by <a href="http://www.kitware.com/" rel="noreferrer" 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" rel="noreferrer" target="_blank">
http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the ParaView Wiki at:<br>
> <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">
http://paraview.org/Wiki/ParaV<wbr>iew</a><br>
><br>
> Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">
http://markmail.org/search/?q=<wbr>ParaView</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">
http://public.kitware.com/mail<wbr>man/listinfo/paraview</a><br>
><br>
______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank">
www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">
http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">
http://paraview.org/Wiki/ParaV<wbr>iew</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">
http://markmail.org/search/?q=<wbr>ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/paraview</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div></div></div>
</blockquote></div><br></div>