<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Oh, my mistake I didn’t understand the instructions. I will run it again to get .pvtu output, however in my previous scripts that generate VTK output there was an issue where the currently released 4.3.1 version of Paraview could not open the files due
to a back compatability issue. I had a developers head on an old machine that could open them, however I do not any longer and the source code is no longer available on the paraview downloads page. Will v4.3.1 be able to open these .pvtu output files? </div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Andy Bauer <<a href="mailto:andy.bauer@kitware.com">andy.bauer@kitware.com</a>><br>
<span style="font-weight:bold">Date: </span>Monday, August 3, 2015 at 1:14 PM<br>
<span style="font-weight:bold">To: </span>First name Last name <<a href="mailto:aeatmon@lanl.gov">aeatmon@lanl.gov</a>>, "Patchett, John M" <<a href="mailto:patchett@lanl.gov">patchett@lanl.gov</a>>, Dave DeMarle <<a href="mailto:dave.demarle@kitware.com">dave.demarle@kitware.com</a>>,
"<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>" <<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [Paraview] adjusting vertical level setting via paraview python script<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div>
<div>Hi,<br>
<br>
</div>
Please reply to everyone so that anyone that wants to follow along with the conversation can.<br>
<br>
</div>
<div>Did you get a chance to look through the Catalyst User's Guide?<br>
</div>
<div><br>
</div>
For MPAS, the names of the adaptor outputs are:<br>
'X_Y_NLAYER-primal',<br>
<div>
<div class="gmail_extra"> 'X_Y_NLAYER-dual',<br>
'X_Y_Z_1LAYER-primal',<br>
'X_Y_Z_1LAYER-dual',<br>
'X_Y_Z_NLAYER-primal',<br>
'X_Y_Z_NLAYER-dual',<br>
'LON_LAT_1LAYER-primal',<br>
'LON_LAT_1LAYER-dual',<br>
'LON_LAT_NLAYER-primal',<br>
'LON_LAT_NLAYER-dual'<br>
<br>
</div>
<div class="gmail_extra">The files that you want are the ones provided by Catalyst and not the ones that MPAS natively writes out. The Catalyst files all should be written out with pvtu extensions (e.g. X_Y_NLAYER-primal_1.pvtu). The MPAS native output is the
.nc file.<br>
<br>
</div>
<div class="gmail_extra">The other error that you're getting is that you have an active Python trace when going through the Catalyst export wizard and that trace needs to be stopped.<br>
<br>
</div>
<div class="gmail_extra">Regards,<br>
</div>
<div class="gmail_extra">Andy<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Aug 3, 2015 at 3:00 PM, Eatmon Jr., Arnold <span dir="ltr">
<<a href="mailto:aeatmon@lanl.gov" target="_blank">aeatmon@lanl.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">
<div><font style="font-size:14px" face="Calibri,sans-serif">Alright, in order of what I did just to be clear, I uploaded the attached python to my directory, soft linked it
</font>to mpas.py, ran the simulation for a single timestep, and got a file in my output folder labeled <a href="http://output.0015-01-01_00.00.00.nc" target="_blank">output.0015-01-01_00.00.00.nc</a>. I took that file and opened it in the Paraview desktop
gui. In paraview with coprocessing enabled (Tools > Plugin Manager > under catalyst option, hit load), I made the adjustment to the vertical level and then exported the state (CoProcessing > Export State). I do not get a python script as an output, I get the
error</div>
<div><br>
</div>
<p style="margin:0px"><span style="font-family:'Courier';font-size:13pt;color:#800000">"Cannot generate Python state when tracing is active."</span></p>
<p style="margin:0px"><span style="font-family:'Courier';font-size:13pt;color:#800000">RuntimeError: Cannot generate Python state when tracing is active.</span></p>
<p style="margin:0px;font-family:Courier;font-size:13pt;color:rgb(128,0,0)"><br>
</p>
<div> </div>
<div style="font-size:14px;font-family:Calibri,sans-serif"><span style="font-family: 'Andale Mono'; font-size: 12px;"><br>
</span></div>
<div style="font-size:14px;font-family:Calibri,sans-serif;color:rgb(0,0,0)"><br>
</div>
<span style="font-size: 14px; font-family: Calibri, sans-serif; color: rgb(0, 0, 0);">
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>Andy Bauer <<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>><br>
<span style="font-weight:bold">Date: </span>Monday, August 3, 2015 at 11:33 AM<br>
<span style="font-weight:bold">To: </span>David E DeMarle <<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>><br>
<span style="font-weight:bold">Cc: </span>First name Last name <<a href="mailto:aeatmon@lanl.gov" target="_blank">aeatmon@lanl.gov</a>>, "Patchett, John M" <<a href="mailto:patchett@lanl.gov" target="_blank">patchett@lanl.gov</a>>, "<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>"
<<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>>
<div>
<div class="h5"><br>
<span style="font-weight:bold">Subject: </span>Re: [Paraview] adjusting vertical level setting via paraview python script<br>
</div>
</div>
</div>
<div>
<div class="h5">
<div><br>
</div>
<div>
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>Hi,<br>
<br>
</div>
Dave is correct in that the reader's output needs to match what the adaptor is producing and in this case the MPAS NetCDF reader does not match what the adaptor provides to Catalyst. The way to get around this is to run Catalyst with a sample Python script
that outputs the full data set that the adaptor provides. For MPAS this is slightly more complex because it provides several outputs, 10 in fact, depending on how the scientists want the data (e.g. spherical vs. projected, primal vs. dual grid, single level
vs. multiple levels) for what they're trying to do. The attached script can be used to write out all 10 of these outputs which is done every 5th output (this can be changed by changing the outputfrequency value).
<br>
<br>
</div>
The general workflow would be to run MPAS with this script for a small amount of time steps (maybe also with a smaller input data set). Then use those outputs to generate the Catalyst script that you want from the GUI.
<br>
<br>
</div>
If this is a bit unclear, I'd recommend going through the Catalyst User's Guide (<a href="http://www.paraview.org/files/catalyst/docs/ParaViewCatalystUsersGuide_v2.pdf" target="_blank">http://www.paraview.org/files/catalyst/docs/ParaViewCatalystUsersGuide_v2.pdf</a>)
for more details.<br>
<br>
</div>
Regards,<br>
</div>
Andy<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Aug 3, 2015 at 12:20 PM, David E DeMarle <span dir="ltr">
<<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Andy Bauer just explained it to me. He'll get back to you soon with a detailed explanation and hints about how to get what you want done.
<div><br>
</div>
<div>Meanwhile, what is tripping us up is that MPAS's catalyst adaptor is not the same thing as ParaViews MPAS reader. The reader has the SetVerticalLevel(int) method, but the adaptor probably has an entirely different method for doing that.</div>
<div><br>
</div>
<div>I don't know firsthand what that method is so we'll have to wait for his response.</div>
<div>
<div>
<div><br>
<div><br>
<div>
<div><br>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div>David E DeMarle<br>
Kitware, Inc.<br>
R&D Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: <a href="tel:518-881-4909" value="+15188814909" target="_blank">518-881-4909</a></div>
</div>
<br>
<div class="gmail_quote">On Thu, Jul 30, 2015 at 4:20 PM, Eatmon Jr., Arnold <span dir="ltr">
<<a href="mailto:aeatmon@lanl.gov" target="_blank">aeatmon@lanl.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;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';color:rgb(83,48,225);background-color:rgb(0,0,0)">
<span style="color:#00fdf8"> </span># Level2 = paraview.simple.FindSource('X_Y_Z_1LAYER-primal')</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';color:rgb(83,48,225);background-color:rgb(0,0,0)">
<span style="color:#00fdf8"> </span># Level2.VerticalLevel = 32</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';color:rgb(0,253,248);background-color:rgb(0,0,0);min-height:14px">
<br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';color:rgb(0,253,248);background-color:rgb(0,0,0)">
<span style="background-color:#e6e600">Layer2</span> = output00240101_000000nc</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';color:rgb(0,253,248);background-color:rgb(0,0,0)">
<span style="background-color:#e6e600">Layer2</span>.VerticalLevel = 32</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';color:rgb(0,253,248);background-color:rgb(0,0,0);min-height:14px">
<br>
</p>
</div>
<div><br>
</div>
<div>Also, </div>
<div><br>
</div>
<div>I tried both of the above both individually with the other commented out and running at the same time, they both return that the attribute VerticalLevel does not exist in that class. It seems to solely exist in paraview.simple.NetCDFreader. </div>
<div><br>
</div>
<div><br>
</div>
<span>
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span><span style="font-weight:bold">From: </span>David E DeMarle <<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>><br>
</span><span style="font-weight:bold">Date: </span>Thursday, July 30, 2015 at 1:45 PM<span><br>
<span style="font-weight:bold">To: </span>First name Last name <<a href="mailto:aeatmon@lanl.gov" target="_blank">aeatmon@lanl.gov</a>><br>
</span>
<div>
<div><span style="font-weight:bold">Subject: </span>Re: [Paraview] adjusting vertical level setting via paraview python script<br>
</div>
</div>
</div>
<div>
<div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">I verified in the GUI that I can change the level and see it take effect, so it should work in principle. You might want to open that file in the paraView GUI and do the same exercise.
<div><br>
</div>
<div>In your script a couple of bits looks fishy to me and might cause the problem.</div>
<div><br>
</div>
<font face="monospace,monospace">paraview.simple.NetCDFMPASreader.PointArrayStatus = ['temperature']<br>
paraview.simple.NetCDFMPASreader.ShowMultilayerView = 0<br>
paraview.simple.NetCDFMPASreader.VerticalLevel = '1' <i>#use = 1 not = '1'</i></font><br>
<br>
later<br>
<br>
<font face="monospace,monospace">paraview.simple.NetCDFMPASreader.VerticalLevel = 1</font><br>
<br>
just do it one time<br>
<br>
<br>
I think the above all do something like set propeties of the global netcdmfmpasreader class, not the one specific instance of that class that you care about.<br>
<br>
<font face="monospace,monospace"># get active source.<br>
# Level2 = paraview.simple.GetActiveSource()<br>
# Level2.VerticalLevel = 1</font><br>
<br>
this is closer, try
<div><font face="monospace,monospace">level2=paraview.simple.FindSource('X_Y_Z_1LAYER-primal')<br>
</font><br>
or better yet, since it is defined early on just<br>
<br>
<font face="monospace,monospace">Layer2 = output00240101_000000nc</font><br>
<br>
Either should give you the specific instance and then you can call <font face="monospace,monospace">
Layer2.VerticalLevel = 1 </font>on it.
<div>
<div><br>
<div><br>
</div>
</div>
</div>
</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div>David E DeMarle<br>
Kitware, Inc.<br>
R&D Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: <a href="tel:518-881-4909" value="+15188814909" target="_blank">518-881-4909</a></div>
</div>
<br>
<div class="gmail_quote">On Thu, Jul 30, 2015 at 3:12 PM, Eatmon Jr., Arnold <span dir="ltr">
<<a href="mailto:aeatmon@lanl.gov" target="_blank">aeatmon@lanl.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;font-size:14px;font-family:Calibri,sans-serif">
<div style="color:rgb(0,0,0)">As a followup to my last reply, I’m pasting the script below for reference because there may be a problem within of which I am not aware. The script is not too clean, though. </div>
<div style="color:rgb(0,0,0)"><br>
</div>
<div style="color:rgb(0,0,0)">Also attached is an image of the output where I see the vertical level still needs to be turned down. </div>
<div style="color:rgb(0,0,0)"><br>
</div>
<div style="color:rgb(0,0,0)">——————————————————————————————————————————————————</div>
<div>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'">from paraview import coprocessing</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'">#--------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"># Code generated from cpstate.py to create the CoProcessor.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"># ParaView 4.3.1 64 bits</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"># ----------------------- CoProcessor definition -----------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'">def CreateCoProcessor():</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> def _CreatePipeline(coprocessor, datadescription):</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> class Pipeline:</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # state file generated using paraview version 4.3.1</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # ----------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # setup views used in the visualization</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # ----------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> #### disable automatic camera reset on 'Show'</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> paraview.simple._DisableFirstRenderCameraReset()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Create a new 'Render View'</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> renderView1 = CreateView('RenderView')</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> renderView1.ViewSize = [1811, 837]</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> renderView1.CenterOfRotation = [0.0, 0.0, 69503.75]</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> renderView1.StereoType = 0</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> renderView1.CameraPosition = [-41129254.56226203, -8828710.007515563, 6001602.840730475]</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> renderView1.CameraFocalPoint = [0.0, 0.0, 69503.75]</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> renderView1.CameraViewUp = [0.06821863148547692, 0.3176561586160046, 0.9457487949828816]</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> renderView1.CameraParallelScale = 10995245.645232411</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> renderView1.Background = [0.37254901960784315, 0.36470588235294116, 0.3411764705882353]</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # register the view with coprocessor</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # and provide it with information such as the filename to use,</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # how frequently to write the images, etc.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> coprocessor.RegisterView(renderView1,</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> filename='image_%t.png', freq=1, fittoscreen=0, magnification=1, width=1811, height=837, cinema={"camera":"Spherical", "phi":[-180,-162,-144,-126,-108,-90,-72,-54,-36,-18,0,18,36,54,72,90,108,126,144,162],
"theta":[-180,-162,-144,-126,-108,-90,-72,-54,-36,-18,0,18,36,54,72,90,108,126,144,162] })</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # ----------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # setup the data processing pipelines</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # ---------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # create a new 'NetCDF MPAS reader'</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # create a producer from a simulation input</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> output00240101_000000nc = coprocessor.CreateProducer(datadescription, 'X_Y_Z_1LAYER-primal')</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # ----------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # setup color maps and opacity mapes used in the visualization</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # note: the Get..() functions create a new object, if needed</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # ----------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # reset view to fit data</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> renderView1.ResetCamera()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # show data in view</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> output00240101_000000ncDisplay = Show(output00240101_000000nc, renderView1)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Properties modified on output00240101_000000nc</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> paraview.simple.NetCDFMPASreader.PointArrayStatus = ['temperature']</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> paraview.simple.NetCDFMPASreader.ShowMultilayerView = 0</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> paraview.simple.NetCDFMPASreader.VerticalLevel = '1'</p>
</div>
<div>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Level1 = paraview.simple.ColorByArray()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Level1.ColorBy(mpas_data_1pvtuDisplay, ('CELLS', 'temperature'))</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # set scalar coloring</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> ColorBy(output00240101_000000ncDisplay, ('CELLS', 'temperature'))</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # rescale color and/or opacity maps used to include current data range</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> output00240101_000000ncDisplay.RescaleTransferFunctionToDataRange(True)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # get color transfer function/color map for 'temperature'</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUT = GetColorTransferFunction('temperature')</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUT.InterpretValuesAsCategories = 0</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUT.Discretize = 0</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUT.MapControlPointsToLinearSpace()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUT.UseLogScale = 0</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUT.RGBPoints = [-2.0, 0.105882, 0.2, 0.14902, -1.25, 0.141176, 0.25098, 0.180392, -0.5, 0.172549, 0.301961, 0.211765, 0.25, 0.211765, 0.34902, 0.243137, 1.0, 0.227451, 0.388235,
0.254902, 1.75, 0.239216, 0.431373, 0.258824, 2.5, 0.25098, 0.470588, 0.262745, 3.25, 0.258824, 0.509804, 0.258824, 4.0, 0.294118, 0.54902, 0.27451, 4.75, 0.333333, 0.580392, 0.294118, 5.5, 0.380392, 0.619608, 0.321569, 6.250000000000002, 0.431373, 0.658824,
0.34902, 7.0, 0.482353, 0.690196, 0.380392, 7.750000000000002, 0.52549, 0.729412, 0.388235, 8.5, 0.564706, 0.760784, 0.380392, 9.250000000000002, 0.631373, 0.788235, 0.411765, 10.0, 0.694118, 0.819608, 0.443137, 10.75, 0.745098, 0.85098, 0.458824, 11.5, 0.803922,
0.878431, 0.494118, 12.25, 0.843137, 0.901961, 0.521569, 13.0, 0.894118, 0.929412, 0.556863, 14.500000000000004, 0.94902, 0.94902, 0.647059, 16.0, 0.968627, 0.968627, 0.796078, 17.05, 1.0, 0.996078, 0.901961, 17.2, 0.968627, 1.0, 0.996078, 17.35, 0.901961,
1.0, 0.984314, 18.1, 0.831373, 0.988235, 0.972549, 19.0, 0.721569, 0.94902, 0.945098, 19.75, 0.639216, 0.882353, 0.901961, 20.500000000000004, 0.568627, 0.807843, 0.85098, 21.25, 0.513725, 0.717647, 0.788235, 22.0, 0.447059, 0.627451, 0.721569, 22.75, 0.388235,
0.541176, 0.65098, 23.5, 0.337255, 0.462745, 0.580392, 24.25, 0.286275, 0.388235, 0.521569, 25.0, 0.25098, 0.333333, 0.478431, 25.750000000000004, 0.219608, 0.290196, 0.45098, 26.5, 0.196078, 0.247059, 0.419608, 27.25, 0.152941, 0.188235, 0.34902, 28.0, 0.113725,
0.113725, 0.278431]</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUT.ColorSpace = 'Lab'</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUT.LockScalarRange = 0</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUT.NanColor = [0.250004, 0.0, 0.0]</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUT.ScalarRangeInitialized = 1.0</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # get opacity transfer function/opacity map for 'temperature'</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperaturePWF = GetOpacityTransferFunction('temperature')</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperaturePWF.Points = [-2.0, 0.0, 0.5, 0.0, 28.0, 1.0, 0.5, 0.0]</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperaturePWF.ScalarRangeInitialized = 1</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Properties modified on temperatureLUT</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # temperatureLUT.InterpretValuesAsCategories = 0</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # paraview.simple.NetCDFMPASreader.ShowMultilayerView = 0 </p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> paraview.simple.NetCDFMPASreader.VerticalLevel = 1</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # renderView1.ResetCamera()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # get active source.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Level2 = paraview.simple.GetActiveSource()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Level2.VerticalLevel = 1</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # ----------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # setup the visualization in view 'renderView1'</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # ----------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # show data from output00240101_000000nc</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> output00240101_000000ncDisplay = Show(output00240101_000000nc, renderView1)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # trace defaults for the display properties. 356617.92693278694</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> output00240101_000000ncDisplay.ColorArrayName = ['CELLS', 'temperature']</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> output00240101_000000ncDisplay.LookupTable = temperatureLUT</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> output00240101_000000ncDisplay.ScalarOpacityUnitDistance = 1469170.<a href="tel:6394257464" value="+16394257464" target="_blank">6394257464</a></p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # show color legend</p>
</div>
<div>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> output00240101_000000ncDisplay.SetScalarBarVisibility(renderView1, True)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # setup the color legend parameters for each legend in this view</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # get color legend/bar for temperatureLUT in view renderView1</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUTColorBar = GetScalarBar(temperatureLUT, renderView1)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUTColorBar.Title = 'temperature'</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> temperatureLUTColorBar.ComponentTitle = ''</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> return Pipeline()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> class CoProcessor(coprocessing.CoProcessor):</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> def CreatePipeline(self, datadescription):</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> self.Pipeline = _CreatePipeline(self, datadescription)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> coprocessor = CoProcessor()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # these are the frequencies at which the coprocessor updates.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> freqs = {'X_Y_Z_1LAYER-primal': [1]}</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> coprocessor.SetUpdateFrequencies(freqs)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> return coprocessor</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'">#--------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"># Global variables that will hold the pipeline for each timestep</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"># Creating the CoProcessor object, doesn't actually create the ParaView pipeline.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"># It will be automatically setup when coprocessor.UpdateProducers() is called the</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"># first time.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'">coprocessor = CreateCoProcessor()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'">#--------------------------------------------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"># Enable Live-Visualizaton with ParaView</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'">coprocessor.EnableLiveVisualization(False, 1)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"># ---------------------- Data Selection method ----------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'">def RequestDataDescription(datadescription):</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> "Callback to populate the request for current timestep"</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> global coprocessor</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> if datadescription.GetForceOutput() == True:</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # We are just going to request all fields and meshes from the simulation</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # code/adaptor.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> for i in range(datadescription.GetNumberOfInputDescriptions()):</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> datadescription.GetInputDescription(i).AllFieldsOn()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> datadescription.GetInputDescription(i).GenerateMeshOn()</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> return</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # setup requests for all inputs based on the requirements of the</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # pipeline.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> coprocessor.LoadRequestedData(datadescription)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"># ------------------------ Processing method ------------------------</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'">def DoCoProcessing(datadescription):</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> "Callback to do co-processing for current timestep"</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> global coprocessor</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Update the coprocessor by providing it the newly generated simulation data.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # If the pipeline hasn't been setup yet, this will setup the pipeline.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> coprocessor.UpdateProducers(datadescription)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Write output data, if appropriate.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> coprocessor.WriteData(datadescription);</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"> </p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Write image capture (Last arg: rescale lookup table), if appropriate.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> coprocessor.WriteImages(datadescription, rescale_lookuptable=False)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"><br>
</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> # Live Visualization, if enabled.</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono'"> coprocessor.DoLiveVisualization(datadescription, "localhost", 22222)</p>
<p style="margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px"></p>
<p style="color:rgb(0,253,248);margin:0px;font-size:12px;font-family:'Andale Mono';min-height:14px">
</p>
</div>
<div style="color:rgb(0,0,0)"><br>
</div>
<span style="color:rgb(0,0,0)"><span>
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0in;PADDING-LEFT:0in;PADDING-RIGHT:0in;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
<span style="font-weight:bold">From: </span>David E DeMarle <<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, July 30, 2015 at 12:32 PM<br>
<span style="font-weight:bold">To: </span>First name Last name <<a href="mailto:aeatmon@lanl.gov" target="_blank">aeatmon@lanl.gov</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>" <<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>><br>
<span style="font-weight:bold">Subject: </span>Re: [Paraview] adjusting vertical level setting via paraview python script<br>
</div>
<div><br>
</div>
</span>
<div>
<div>
<div>
<div>
<div dir="ltr">
<div>Regarding the adding attributes error message, it is likely that the ActiveSource is not an MPAS reader at that point in time.<br>
</div>
<div>…GetActiveSource().__class__ should tell your what it is.</div>
<div><br>
</div>
<div>Regarding the level setting - what is yourReader.ShowMultilayerView?</div>
<div>The docs indicated a value of 1 makes VerticalLayer immaterial.</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div>David E DeMarle<br>
Kitware, Inc.<br>
R&D Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: <a href="tel:518-881-4909" value="+15188814909" target="_blank">518-881-4909</a></div>
</div>
<br>
<div class="gmail_quote">On Thu, Jul 30, 2015 at 9:52 AM, Eatmon Jr., Arnold <span dir="ltr">
<<a href="mailto:aeatmon@lanl.gov" target="_blank">aeatmon@lanl.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;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>
<div>I’m one of the DSS interns working under Jim Ahrens for the summer. I am using paraviews python script in the HPC and I’m having an issue adjusting an attribute of paraview.simple.netcdfmpasreader “VerticalLevel”. </div>
<div><br>
</div>
<div>I want to adjust it from the default to one and attempted:</div>
<div><br>
</div>
<div><span style="font-family: 'Andale Mono'; font-size: 12px;">paraview.simple.NetCDFMPASreader.VerticalLevel = 1</span></div>
<div style="font-family:Calibri"><font face="Andale Mono"><span style="font-size:12px">paraview.simple.NetCDFMPASreader.VerticalLevel = ‘1'</span></font></div>
<div style="font-family:Calibri"><font face="Calibri,sans-serif">A</font><span style="font-family: Calibri, sans-serif;">nd </span></div>
<div style="font-family:Calibri"><span style="font-family: 'Andale Mono'; font-size: 12px;">paraview.simple.GetActiveSource()</span><span style="font-family: 'Andale Mono'; font-size: 12px;">.VerticalLevel = 1</span></div>
<div style="font-family:Calibri"><span style="font-family: 'Andale Mono'; font-size: 12px;"><br>
</span></div>
<div style="font-family:Calibri"><span style="font-family: 'Andale Mono'; font-size: 12px;">The first two operate with no errors doing nothing in the program and the last returns an error that the class bars adding attributes to prevent errors due to spelling. </span></div>
<div style="font-family:Calibri"><span style="font-family: 'Andale Mono'; font-size: 12px;"><br>
</span></div>
<div style="font-family:Calibri">How do I adjust the vertical level setting? </div>
<div style="font-family:Calibri"><br>
</div>
<div style="font-family:Calibri">Thank you in advance for your assistance. </div>
</div>
</div>
<br>
_______________________________________________<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/opensource/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/ParaView</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=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/mailman/listinfo/paraview</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</span></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</span></div>
</blockquote>
</div>
<br>
</div>
<br>
_______________________________________________<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/opensource/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/ParaView</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=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/mailman/listinfo/paraview</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</span></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</span>
</body>
</html>