[prev in list] [next in list] [prev in thread] [next in thread] 

List:       paraview
Subject:    Re: [Paraview] pv python scripting
From:       Casey Goodlett <casey.goodlett () kitware ! com>
Date:       2014-04-18 16:37:15
Message-ID: CAOqyOuFmwBLAkA+gTWPtM8DA0NaF_pzQ6BGB5kdhu0x6GOv2VQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Simon,

Selecting the reader in the pipeline browser and calling GetActiveSource()
in the python shell should return a reference to the reader.


On Fri, Apr 18, 2014 at 11:39 AM, Su, Simon M CTR USAF (US) <
simon.m.su.ctr@mail.mil> wrote:

> Hello,
> 
> http://paraview.org/Wiki/ParaView/Python_Scripting has the example on how
> to list the variables in a dataset.
> 
> =============
> 
> > > > reader = ExodusIIReader(FileName='.../can.ex2')# These variables are \
> > > > currently selected>>> reader.PointVariables['DISPL', 'VEL', 'ACCL']# These \
> > > > are available in the file>>> reader.PointVariables.Available['DISPL', 'VEL', \
> > > > 'ACCL']# Enable the DISPL array only>>> reader.PointVariables = ['DISPL']# \
> > > > Force read>>> reader.UpdatePipeline()# Now check the output. Note: \
> > > > GlobalNodeId is generated automatically by the reader.>>> \
> > > > reader.PointData[:][Array: GlobalNodeId, Array: PedigreeNodeId, Array: DISPL]
> ====================
> 
> 
> If I am doing this in ParaView GUI and I load the can.ex2 data manually
> and then use Tools->Python Shell to get to python, how do I get a list of
> the variable? Who would be the parent of PointVariables.Available?
> <????>.PointVariables.Available ?
> 
> thanks
> -simon
> 
> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
> 
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
> 
> 


-- 
Casey B. Goodlett, Ph.D.
Technical Leader
Kitware, Inc. - North Carolina Office
http://www.kitware.com
(919) 969-6990 x310


[Attachment #5 (text/html)]

<div dir="ltr"><div>Simon,<br><br></div>Selecting the reader in the pipeline browser \
and calling GetActiveSource() in the python shell should return a reference to the \
reader.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Fri, Apr 18, 2014 at 11:39 AM, Su, Simon M CTR USAF (US) <span dir="ltr">&lt;<a \
href="mailto:simon.m.su.ctr@mail.mil" \
target="_blank">simon.m.su.ctr@mail.mil</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">






<div>
<div style="direction:ltr;font-size:10pt;font-family:Tahoma">Hello,<br>
<br>
<a href="http://paraview.org/Wiki/ParaView/Python_Scripting" \
target="_blank">http://paraview.org/Wiki/ParaView/Python_Scripting</a> has the \
example on how to list the variables in a dataset. <br>
<br>
=============<br>
<div dir="ltr" style="text-align:left">
<div>
<pre><span>&gt;&gt;&gt;</span> reader = \
ExodusIIReader<span>(</span>FileName=<span>&#39;.../can.ex2&#39;</span><span>)</span> \
<span># These variables are currently selected</span> <span>&gt;&gt;&gt;</span> \
reader.<span>PointVariables</span> <span>[</span><span>&#39;DISPL&#39;</span>, \
<span>&#39;VEL&#39;</span>, <span>&#39;ACCL&#39;</span><span>]</span> <span># These \
are available in the file</span> <span>&gt;&gt;&gt;</span> \
reader.<span>PointVariables</span>.<span>Available</span> \
<span>[</span><span>&#39;DISPL&#39;</span>, <span>&#39;VEL&#39;</span>, \
<span>&#39;ACCL&#39;</span><span>]</span> <span># Enable the DISPL array only</span>
<span>&gt;&gt;&gt;</span> reader.<span>PointVariables</span> = \
<span>[</span><span>&#39;DISPL&#39;</span><span>]</span> <span># Force read</span>
<span>&gt;&gt;&gt;</span> \
reader.<span>UpdatePipeline</span><span>(</span><span>)</span> <span># Now check the \
output. Note: GlobalNodeId is generated automatically by the reader.</span> \
<span>&gt;&gt;&gt;</span> reader.<span>PointData</span><span>[</span>:<span>]</span> \
<span>[</span>Array: GlobalNodeId, Array: PedigreeNodeId, Array: \
DISPL<span>]<br>====================<br></span></pre> </div>
</div>
<br>
If I am doing this in ParaView GUI and I load the can.ex2 data manually and then use \
Tools-&gt;Python Shell to get to python, how do I get a list of the variable? Who \
would be the parent of PointVariables.Available?   \
&lt;????&gt;.PointVariables.Available ?<br>


<br>
thanks<span class="HOEnZb"><font color="#888888"><br>
-simon<br>
<br>
<br>
</font></span></div>
</div>

<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <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: <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></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Casey B. \
Goodlett, Ph.D.<br>Technical Leader<br>Kitware, Inc. - North Carolina Office<br><a \
href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>

(919) 969-6990 x310</div>
</div>



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic