<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:Monaco;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Arial","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1F497D">Thanks everybody for the support,
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></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?<o:p></o:p></span></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())<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1F497D">But that did not help.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></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">https://coeri.stackstorage.com/s/0vUfQkVyv2MD3Ml</a>. (Note: It helps for visualization to stretch the z-axis by a factor 3000).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1F497D">This perhaps helps you with helping me.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></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:kmorel@sandia.gov]
<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> paraview@public.kitware.com<br>
<b>Subject:</b> Re: [Paraview] generic NetCDFreader support for CellData<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></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.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-Ken<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></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="font-size:12.0pt;color:black">From:
</span></b><span lang="EN-US" style="font-size:12.0pt;color:black">ParaView <paraview-bounces@public.kitware.com> on behalf of Cory Quammen <cory.quammen@kitware.com><br>
<b>Date: </b>Wednesday, May 2, 2018 at 11:19 AM<br>
<b>To: </b>"j.vanengelen1@uu.nl" <j.vanengelen1@uu.nl><br>
<b>Cc: </b>"paraview@public.kitware.com" <paraview@public.kitware.com><br>
<b>Subject: </b>[EXTERNAL] Re: [Paraview] generic NetCDFreader support for CellData<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><a name="_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"><span lang="EN-US">j.vanengelen1@uu.nl</span></a><span lang="EN-US">>
wrote:<o:p></o:p></span></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="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif";color:#1F497D">Thank you Cory,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span lang="EN-US"><o:p> </o:p></span></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 ..."><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><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span lang="EN-US"><o:p> </o:p></span></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><span lang="EN-US"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"><o:p> </o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"><o:p> </o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"><o:p> </o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></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<o:p></o:p></span></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><span lang="EN-US" style="color:black;background:white"><o:p></o:p></span></pre>
<pre style="margin-left:36.0pt"><span lang="EN-US" style="font-family:"Monaco","serif";color:black;background:white"><o:p> </o:p></span></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><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:36.0pt">
<span lang="EN-US"><o:p> </o:p></span></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><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span lang="EN-US"><o:p> </o:p></span></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><span lang="EN-US"><o:p></o:p></span></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><span lang="EN-US"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:36.0pt">
<span lang="EN-US"><o:p> </o:p></span></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="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></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="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
Joeri,<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<o:p></o:p></p>
</div>
<div>
<pre style="mso-margin-top-alt:9.0pt;margin-right:0cm;margin-bottom:0cm;margin-left:36.0pt;margin-bottom:.0001pt"><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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></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><o:p></o:p></pre>
<pre style="margin-left:36.0pt"><span style="font-family:"Monaco","serif""> </span><o:p></o:p></pre>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
HTH,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
Cory<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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:<o:p></o:p></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="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">Hi,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">Also, the information available to me was ambiguous,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">-this source says it is probably not possible:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">-this states it is possible return Cell Data information:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">So I have two questions:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">-Is this possible?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">I’m using Paraview v5.4.1 on Windows 7.
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<span style="font-family:"Arial","sans-serif"">Kind regards,<br>
Joeri</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;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><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
<o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
-- <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:36.0pt">
Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="margin-left:36.0pt"><span lang="EN-US"><br clear="all">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal" style="margin-left:36.0pt"><span lang="EN-US">-- <o:p></o:p></span></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><span lang="EN-US"><o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>