<div dir="ltr"><div>Dear Utkarsh, </div><div><br></div><div>After some more googling and your answer I found the solution. Indeed I have to store the data as a string in the Programmable Filter and then retrieve with GetValue in the Python Annoatation. </div><div>My ProgrammableFilter with Ouput set to vtkData is now</div><div><br></div><div><span style="color:rgb(0,128,0);font-family:"Courier New";font-weight:600">import</span><span style="font-family:"Courier New""> </span><span style="color:rgb(0,0,255);font-family:"Courier New";font-weight:600">sys</span>
<pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New"">sys</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">path</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">append(</span><span style="color:rgb(186,33,33);font-family:"Courier New"">"C://Apps/Anaconda/Anaconda2/envs/paraview/Lib/site-packages/"</span><span style="font-family:"Courier New"">)</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,128,0);font-family:"Courier New";font-weight:600">import</span><span style="font-family:"Courier New""> </span><span style="color:rgb(0,0,255);font-family:"Courier New";font-weight:600">netCDF4</span><span style="font-family:"Courier New""> </span><span style="color:rgb(0,128,0);font-family:"Courier New";font-weight:600">as</span><span style="font-family:"Courier New""> </span><span style="color:rgb(0,0,255);font-family:"Courier New";font-weight:600">nc</span><span style="font-family:"Courier New""> </span></pre>
<pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New"">t </span><span style="color:rgb(102,102,102);font-family:"Courier New"">=</span><span style="font-family:"Courier New""> inputs[</span><span style="color:rgb(102,102,102);font-family:"Courier New"">0</span><span style="font-family:"Courier New"">]</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">GetInformation()</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">Get(vtk</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">vtkDataObject</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">DATA_TIME_STEP())</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New"">date_time </span><span style="color:rgb(102,102,102);font-family:"Courier New"">=</span><span style="font-family:"Courier New""> nc</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">num2date(t, units</span><span style="color:rgb(102,102,102);font-family:"Courier New"">=</span><span style="color:rgb(186,33,33);font-family:"Courier New"">"hours since 0001-01-01 00:00:00"</span><span style="font-family:"Courier New"">, calendar</span><span style="color:rgb(102,102,102);font-family:"Courier New"">=</span><span style="color:rgb(186,33,33);font-family:"Courier New"">"gregorian"</span><span style="font-family:"Courier New"">)</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New"">outputarray </span><span style="color:rgb(102,102,102);font-family:"Courier New"">=</span><span style="font-family:"Courier New""> vtk</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">vtkStringArray()</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New"">outputarray</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">SetName(</span><span style="color:rgb(186,33,33);font-family:"Courier New"">"datetime"</span><span style="font-family:"Courier New"">)</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New"">outputarray</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">SetNumberOfTuples(</span><span style="color:rgb(102,102,102);font-family:"Courier New"">1</span><span style="font-family:"Courier New"">)</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New"">outputarray</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">SetValue(</span><span style="color:rgb(102,102,102);font-family:"Courier New"">0</span><span style="font-family:"Courier New"">, </span><span style="color:rgb(186,33,33);font-family:"Courier New"">"{}"</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">format(date_time))</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(0,128,0);font-family:"Courier New";font-weight:600">print</span><span style="font-family:"Courier New"">(</span><span style="color:rgb(186,33,33);font-family:"Courier New"">"{} -> {}"</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">format(t, date_time))</span></pre>
<pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New"">output</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">RowData</span><span style="color:rgb(102,102,102);font-family:"Courier New"">.</span><span style="font-family:"Courier New"">AddArray(outputarray)</span></pre><pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New""><br></span></pre><pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New""><font face="arial,helvetica,sans-serif" size="2">and after that I add a PythonAnnotation with Row Data as Array Association and the following expression</font></span></pre><pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New""><font face="Arial"><br></font></span></pre><pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New""><font face="Arial">"{}".format(input.RowData["datetime"].GetValue(0))</font></span></pre><pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New""><font face="Arial"><br></font></span></pre><pre style="margin:0px;text-indent:0px"><span style="font-family:"Courier New""><font face="arial,helvetica,sans-serif"><br></font></span></pre><pre style="margin:0px;text-indent:0px"><font face="arial,helvetica,sans-serif" size="4">It is not very trivial I must say, but the result is now that I can plot a date/time string in stead of a float with number of hourse since. Excellent! Thanks for your quick help</font></pre><pre style="margin:0px;text-indent:0px"><font face="Arial" size="4"><br></font></pre><pre style="margin:0px;text-indent:0px"><font face="Arial" size="4">Regards</font></pre><pre style="margin:0px;text-indent:0px"><font face="Arial" size="4">Eelco</font></pre><pre style="margin:0px;text-indent:0px"><font face="Arial" size="4"><br></font></pre><pre style="margin:0px;text-indent:0px"><font face="Arial" size="4">Ps: for those interessed in using netcdf4 with paraview: you have to make sure to get all the versions correct. I did this by using Anaconda and than create a special paraview environment</font></pre><pre style="margin:0px;text-indent:0px"><font face="Arial" size="4">conda create -n paraview python=2.7.3 netcdf4</font></pre><pre style="margin:0px;text-indent:0px"><font face="Arial" size="4">activate paraview</font></pre><pre style="margin:0px;text-indent:0px"><font face="Arial" size="4">conda install numpy=1.8.1</font></pre><pre style="margin:0px;text-indent:0px"><font face="Arial" size="4"><br></font></pre><pre style="margin:0px;text-indent:0px"><font face="Arial" size="4"><br></font></pre></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-06 17:05 GMT+02:00 Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><span style="color:rgb(186,33,33);font-family:"Courier New""><font color="#222222" face="Arial"><span style="font-family:"Courier New""><div><span style="font-family:Arial">Array Association: Row Data</span><br></div><div><font face="Arial">Expression: "{}".format(input.RowData) </font></div><div><font face="Arial">But this gives me just a reference to the row data, not the string of the date/time I just stored</font></div></span></font></span></div></blockquote><div><br></div></span><div>Try using `input.RowData["datatime"].<wbr>GetValue(0)` instead. String arrays are a little cumbersome currently. You have to use the vtkAbstractArray API (GetValue) to access elements.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Utkarsh</div><div><br></div><div><br></div></font></span></div></div></div>
</blockquote></div><br></div>