<div dir="ltr">Joeri,<div><br></div><div class="gmail_quote"><div dir="ltr">On Thu, May 3, 2018 at 11:37 AM Engelen, J. van (Joeri) <<a href="mailto:j.vanengelen1@uu.nl">j.vanengelen1@uu.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div class="m_198876762357081960WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d">Thank you Cory,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d">That indeed worked on the toy example, but when I tried it on my full dataset (uploaded here as well) Paraview v5.4.1 had trouble rendering it (only rendered
 part of the outer sides, when activating coloring).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d">I think it is not the script now giving issues, but the renderer. As I experience similar issues previously with celldata loaded from a .VTR file (I assumed that
 that file was corrupted). <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d">It seems to me that when you go beyond a certain amount of cells, Paraview does not render its output properly.</span></p></div></div></blockquote><div><br></div><div>ParaView is regularly used to render data much larger than your full example, which is around 6 million cells, so unless you are running out of RAM on your graphics card, I don't think that is it.</div><div><br></div><div>I suspect the problem is that the full data is by default read as a Rectilinear Grid instead of a Image (Uniform Rectilinear Grid). Did you remember to change the Output Type to "Image"? Do that, then create a Programmable Filter with the script. It works for me:</div><div><br></div><div><img src="cid:ii_jgqpfz9l0" alt="image.png" width="530" height="562"><br><br></div><div>You might be running into a bug with the Programmable Filter that occurs when the output data type of its input changes. If you change the Output Type to "Image", make sure you add a new Programmable Filter after applying your change, otherwise you may run into this bug.<br></div><div><br></div><div>HTH,</div><div>Cory</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div class="m_198876762357081960WordSection1"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d">Could you test whether it works for you on v5.5?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d">I uploaded my full dataset here:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d"><a href="https://coeri.stackstorage.com/s/ztga1yLO8mjD1EO" target="_blank">https://coeri.stackstorage.com/s/ztga1yLO8mjD1EO</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d">To visualize data properly:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d">Put a threshold filter and filter out 0.0 (as that is NoData) by putting minimum on 0.5, furthermore stretch the z direction by a factor 3000.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Cory Quammen [mailto:<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>]
<br>
<b>Sent:</b> Thursday, May 03, 2018 4:13 PM<br>
<b>To:</b> Engelen, J. van (Joeri)<br>
<b>Cc:</b> Moreland, Kenneth; <a href="mailto:paraview@public.kitware.com" target="_blank">paraview@public.kitware.com</a><br>
<b>Subject:</b> Re: [Paraview] generic NetCDFreader support for CellData<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Indeed, my original script is not quite right. Here is a more robust version that should copy all point data arrays to cell data arrays:<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<pre style="margin-top:9.0pt"><span style="font-family:"Monaco","serif"">dims <span style="color:#666666">=</span> inputs[<span style="color:#666666">0</span>]<span style="color:#666666">.</span>GetDimensions()</span><u></u><u></u></pre>
<pre><span style="font-family:"Monaco","serif"">ext <span style="color:#666666">=</span> inputs[<span style="color:#666666">0</span>]<span style="color:#666666">.</span>GetExtent()</span><u></u><u></u></pre>
<pre><span style="font-family:"Monaco","serif"">output<span style="color:#666666">.</span>SetDimensions(dims[<span style="color:#666666">0</span>]<span style="color:#666666">+1</span>, dims[<span style="color:#666666">1</span>]<span style="color:#666666">+1</span>, dims[<span style="color:#666666">2</span>]<span style="color:#666666">+1</span>)</span><u></u><u></u></pre>
<pre><span style="font-family:"Monaco","serif"">output<span style="color:#666666">.</span>SetExtent(ext[<span style="color:#666666">0</span>], ext[<span style="color:#666666">1</span>]<span style="color:#666666">+1</span>, ext[<span style="color:#666666">2</span>], ext[<span style="color:#666666">3</span>]<span style="color:#666666">+1</span>, ext[<span style="color:#666666">4</span>], ext[<span style="color:#666666">5</span>]<span style="color:#666666">+1</span>)</span><u></u><u></u></pre>
<pre><span style="font-family:"Monaco","serif"">inputPd <span style="color:#666666">=</span> inputs[<span style="color:#666666">0</span>]<span style="color:#666666">.</span>PointData</span><u></u><u></u></pre>
<pre><span style="font-family:"Monaco","serif"">outputCd <span style="color:#666666">=</span> output<span style="color:#666666">.</span>CellData</span><u></u><u></u></pre>
<pre><b><span style="font-family:"Monaco","serif";color:green">for</span></b><span style="font-family:"Monaco","serif""> array <b><span style="color:#aa22ff">in</span></b> inputPd:</span><u></u><u></u></pre>
<pre><span style="font-family:"Monaco","serif"">  <b><span style="color:green">print</span></b>(<span style="color:green">type</span>(array))</span><u></u><u></u></pre>
<pre style="margin-bottom:9.0pt"><span style="font-family:"Monaco","serif"">  outputCd<span style="color:#666666">.</span>append(array, array<span style="color:#666666">.</span>GetName()) </span><u></u><u></u></pre>
<p class="MsoNormal">I hope that does it. It works in my ParaView 5.5 with the sample data you provided (thank you for providing that!).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Best regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Cory<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Thu, May 3, 2018 at 7:48 AM Engelen, J. van (Joeri) <<a href="mailto:j.vanengelen1@uu.nl" target="_blank">j.vanengelen1@uu.nl</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1f497d">Thanks everybody for the support,
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1f497d">I followed Ken’s suggestion, which will simplify things, however when I put Cory’s original script in the programmable
 filter no Data Array can be found in the output. So I sense there is a (small) bug in the script?</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1f497d">I tried changing the last three lines to the oneliner
</span><span style="font-family:"Courier New"">output<span style="color:#666666">.</span>GetCellData()<span style="color:#666666">.</span>SetScalars(inputs[<span style="color:#666666">0</span>]<span style="color:#666666">.</span>GetPointData()<span style="color:#666666">.</span>GetScalars())</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1f497d">But that did not help.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1f497d">I have uploaded a small subset of my data here for you to toy around with
<a href="https://coeri.stackstorage.com/s/0vUfQkVyv2MD3Ml" target="_blank">https://coeri.stackstorage.com/s/0vUfQkVyv2MD3Ml</a>. (Note: It helps for visualization to stretch the z-axis by a factor 3000).</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1f497d">This perhaps helps you with helping me.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Moreland,
 Kenneth [mailto:<a href="mailto:kmorel@sandia.gov" target="_blank">kmorel@sandia.gov</a>]
<br>
<b>Sent:</b> Wednesday, May 02, 2018 7:27 PM<br>
<b>To:</b> Quammen, Cory (External Contacts); Engelen, J. van (Joeri)<br>
<b>Cc:</b> <a href="mailto:paraview@public.kitware.com" target="_blank">paraview@public.kitware.com</a><br>
<b>Subject:</b> Re: [Paraview] generic NetCDFreader support for CellData</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">The NetCDF Generic/CF reader has an option named “Output Type” that you can use to force the output to a vtkImageData. Then Cory’s original programmable filter
 will work, and you won’t have to deal with the coordinates.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">-Ken</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-left:36.0pt">
<b><span lang="EN-US" style="color:black">From: </span></b><span lang="EN-US" style="color:black">ParaView <<a href="mailto:paraview-bounces@public.kitware.com" target="_blank">paraview-bounces@public.kitware.com</a>> on behalf of Cory Quammen <<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>><br>
<b>Date: </b>Wednesday, May 2, 2018 at 11:19 AM<br>
<b>To: </b>"<a href="mailto:j.vanengelen1@uu.nl" target="_blank">j.vanengelen1@uu.nl</a>" <<a href="mailto:j.vanengelen1@uu.nl" target="_blank">j.vanengelen1@uu.nl</a>><br>
<b>Cc: </b>"<a href="mailto:paraview@public.kitware.com" target="_blank">paraview@public.kitware.com</a>" <<a href="mailto:paraview@public.kitware.com" target="_blank">paraview@public.kitware.com</a>><br>
<b>Subject: </b>[EXTERNAL] Re: [Paraview] generic NetCDFreader support for CellData</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US"> </span><u></u><u></u></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<a name="m_198876762357081960_m_1426475798394212955__MailOriginalBody"><span lang="EN-US">On Wed, May 2, 2018 at 11:37 AM Engelen, J. van (Joeri) <</span></a><a href="mailto:j.vanengelen1@uu.nl" target="_blank"><span lang="EN-US">j.vanengelen1@uu.nl</span></a><span lang="EN-US">>
 wrote:</span><u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif";color:#1f497d">Thank you Cory,</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif";color:#1f497d">I sense this solution might work. However, the type of my data is “Rectilinear Grid”, not sure if that increases the complexity (dx = 1000, dy = 1000, dz = 1).</span><u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US">Ah. From the documentation: "</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black;background:white">To define a </span><a href="https://www.vtk.org/doc/nightly/html/classvtkRectilinearGrid.html" title="a dataset that is topologically regular with variable spacing in the three coordinate directions ..." target="_blank"><b><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial","sans-serif";color:#4665a2;background:white;text-decoration:none">vtkRectilinearGrid</span></b></a><span lang="EN-US" style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black;background:white">,
 you must specify the dimensions of the data and provide three arrays of values specifying the coordinates along the x-y-z axes". It should be a similar script, but you'd have to add an additional X, Y, and Z position at the end of those coordinate arrays.
 So your script would look more like:</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:10.5pt;font-family:"Monaco","serif";color:black">dims
</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Monaco","serif";color:#666666">=</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Monaco","serif";color:black"> inputs[</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Monaco","serif";color:#666666">0</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Monaco","serif";color:black">]</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Monaco","serif";color:#666666">.</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Monaco","serif";color:black">GetDimensions()</span><u></u><u></u></p>
</div>
<div>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">ext </span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">=</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"> inputs[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">GetExtent()</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">output.SetDimensions(dims[0]+1, dims[1]+1, dims[2]+1)</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">output</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">SetExtent(ext[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">], ext[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">1</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">+1</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">, ext[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">2</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">], ext[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">3</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">+1</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">, ext[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">4</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">], ext[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">5</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">+1</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">)</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">inputPd </span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">=</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"> inputs[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">GetPointData()</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">outputCd </span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">=</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"> output</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">GetCellData()</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">outputCd</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">SetScalars(inputPd</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">GetScalars())</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"> </span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><i><span lang="EN-US" style="font-family:"Monaco","serif";color:#408080;background:white"># Set coordinates</span></i><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">xCoords </span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">=</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"> inputs[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">GetXCoordinates()</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">NewInstance()</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">xCoords</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">DeepCopy(inputs[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">GetXCoordinates())</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">xCoords</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">InsertNextValue(</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">1.0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">) # Should a reasonable x value for your dataset larger than previous max x</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">output</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">SetXCoordinates(xCoords)</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"> </span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">yCoords </span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">=</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"> inputs[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">GetYCoordinates()</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">NewInstance()</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">yCoords</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">DeepCopy(inputs[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">GetYCoordinates())</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">yCoords</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">InsertNextValue(</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">1.5</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">) </span><span lang="EN-US" style="font-family:"Monaco","serif";background:white"># Should be a reasonable like the x coordinate</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="color:black;background:white">output</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">SetYCoordinates(yCoords)</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"> </span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">zCoords </span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">=</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"> inputs[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">GetZCoordinates()</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">NewInstance()</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">zCoords</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">DeepCopy(inputs[</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">]</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">GetZCoordinates())</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">zCoords</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">InsertNextValue(</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">1.0</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">) </span><span lang="EN-US" style="color:black;background:white"># Should be a reasonable like the z coordinate</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">output</span><span lang="EN-US" style="font-family:"Monaco","serif";color:#666666;background:white">.</span><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white">SetZCoordinates(zCoords)</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"> </span><u></u><u></u></pre>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black;background:white">Some extent information also needs to be supplied, but I'm not entirely clear on how to do that correctly.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;margin-left:36.0pt">
<span lang="EN-US"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black">A better solution would be to add an option to the reader to take care of this for you if that is reasonable for your data.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black">Best,</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US" style="font-size:10.5pt;font-family:"Arial","sans-serif";color:black">Cory</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;margin-left:36.0pt">
<span lang="EN-US"> </span><u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif";color:#1f497d">Regardless, the script you provided does not give me output and it also does not throw an error, so I’m left a bit in the dark here.</span><u></u><u></u></p>
</div>
</div>
</blockquote>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif";color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Cory Quammen [mailto:</span><a href="mailto:cory.quammen@kitware.com" target="_blank"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">cory.quammen@kitware.com</span></a><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">]
<br>
<b>Sent:</b> Wednesday, May 02, 2018 5:01 PM<br>
<b>To:</b> Engelen, J. van (Joeri)<br>
<b>Cc:</b> </span><a href="mailto:paraview@public.kitware.com" target="_blank"><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">paraview@public.kitware.com</span></a><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""><br>
<b>Subject:</b> Re: [Paraview] generic NetCDFreader support for CellData</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
 <u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
Joeri,<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
 <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
You can try the "Point Data to Cell Data" filter, but that averages the point data and places the results in the cell data. You may wind up with some incorrect values using that approach.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
 <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
Better would be to use a "Progammable Filter" to resize the cartesian grid read by the NetCDF reader and treat the point data as cell data. That is a bit involved, but not terrible. Set the Script to<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
 <u></u><u></u></p>
</div>
<div>
<pre style="margin-left:36.0pt"><span style="font-family:"Monaco","serif"">dims <span style="color:#666666">=</span> inputs[<span style="color:#666666">0</span>]<span style="color:#666666">.</span>GetDimensions()</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span style="font-family:"Monaco","serif"">ext <span style="color:#666666">=</span> inputs[<span style="color:#666666">0</span>]<span style="color:#666666">.</span>GetExtent()</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span style="font-family:"Monaco","serif"">output<span style="color:#666666">.</span>SetDimensions(dims[<span style="color:#666666">0</span>]<span style="color:#666666">+1</span>, dims[<span style="color:#666666">1</span>]<span style="color:#666666">+1</span>, dims[<span style="color:#666666">2</span>]<span style="color:#666666">+1</span>)</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span style="font-family:"Monaco","serif"">output<span style="color:#666666">.</span>SetExtent(ext[<span style="color:#666666">0</span>], ext[<span style="color:#666666">1</span>]<span style="color:#666666">+1</span>, ext[<span style="color:#666666">2</span>], ext[<span style="color:#666666">3</span>]<span style="color:#666666">+1</span>, ext[<span style="color:#666666">4</span>], ext[<span style="color:#666666">5</span>]<span style="color:#666666">+1</span>)</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span style="font-family:"Monaco","serif"">inputPd <span style="color:#666666">=</span> inputs[<span style="color:#666666">0</span>]<span style="color:#666666">.</span>GetPointData()</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span style="font-family:"Monaco","serif"">outputCd <span style="color:#666666">=</span> output<span style="color:#666666">.</span>GetCellData()</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span style="font-family:"Monaco","serif"">outputCd<span style="color:#666666">.</span>SetScalars(inputPd<span style="color:#666666">.</span>GetScalars())</span><u></u><u></u></pre>
<pre style="margin-left:36.0pt"><span style="font-family:"Monaco","serif""> </span><u></u><u></u></pre>
<p class="MsoNormal" style="margin-left:36.0pt">
This assumes that the NetCDF reader is producing a vtkImageData (you can check under the Information panel) which would report the Type: of the data set as "Image (Uniform Rectilinear Grid).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
 <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
HTH,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
Cory<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:36.0pt">
 <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
On Wed, May 2, 2018 at 10:17 AM Engelen, J. van (Joeri) <<a href="mailto:j.vanengelen1@uu.nl" target="_blank">j.vanengelen1@uu.nl</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">Hi,</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">I was wondering whether it is possible to read NetCDF files as CellData.</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">I have categorial data on Cartesian coordinates that I want to visualize. To be more specific, the data represents lithologies of the subsurface. So 1 = sand, 3 = clay, 5 = rock.</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">The problem is that my file is automatically interpreted as PointData. To render this PointData, Paraview than consequently interpolates to achieve cell values.
</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">With most variables that is not such a problem, but here it is. If I have sand (1) overlying rock (5), Paraview shows me clay (3).
</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">Also, the information available to me was ambiguous,</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">-this source says it is probably not possible:</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<a href="https://public.kitware.com/pipermail/paraview/2017-September/040984.html" target="_blank"><span style="font-family:"Arial","sans-serif"">https://public.kitware.com/pipermail/paraview/2017-September/040984.html</span></a><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">-this states it is possible return Cell Data information:</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<a href="https://www.paraview.org/ParaView/Doc/Nightly/www/py-doc/paraview.simple.NetCDFReader.html" target="_blank"><span style="font-family:"Arial","sans-serif"">https://www.paraview.org/ParaView/Doc/Nightly/www/py-doc/paraview.simple.NetCDFReader.html</span></a><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">I tried converting my data from NetCDF to a .vtr file in Python, but this resulted in more problems than solutions. (Just gave me very glitched rendering).</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">So I have two questions:</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">-Is this possible?</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">-Are there any workarounds you can think of to get my data as CellData in Paraview?</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">I’m using Paraview v5.4.1 on Windows 7.
</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">Kind regards,<br>
Joeri</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:36.0pt">
_______________________________________________<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>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">
http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview" target="_blank">https://public.kitware.com/mailman/listinfo/paraview</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:36.0pt">
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
 <u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-left:36.0pt">
-- <u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<u></u><u></u></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US"><br clear="all">
</span><u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US"> </span><u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US">-- </span><u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt">
<span lang="EN-US">Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.</span><u></u><u></u></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<p class="MsoNormal">Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<u></u><u></u></p>
</div>
</div>
</div>

</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Cory Quammen<br>Staff R&D Engineer<br>Kitware, Inc.</div></div>