<div dir="ltr">Hey there<div><br></div><div>I have some hundred VTU files and I want to plot some data in a graph (Plot over Line - POL) next to it. The Problem is, the data from these POLs is coming from a simple log file, basically conaining only x and y values (like two np.arrays).</div><div><br></div><div>I can transform the arrays via </div><div><br></div><div><pre class="" style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">from</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> vtk</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">util </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,139)">import</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> numpy_support
values </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> np</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">array</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">((</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">x</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">y</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">))</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
vtk_values </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> numpy_support</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">numpy_to_vtk</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">values</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> array_type</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">vtk</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">VTK_FLOAT</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
vtk_values</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">setName</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'values_2_show'</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
vtk_values</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">setComponentName</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">1</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'x_value'</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
vtk_values</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">setComponentName</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">2</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'y_value'</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span></code></pre></div><div>But so far I have no success with how to change the input (source)</div><div><pre class="" style="margin-top:0px;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">VTUFILE </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">FindSource</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'VTUFILE*'</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">
plotOverLine1 </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">PlotOverLine</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Input</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">VTUFILE</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Source</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(128,0,0)">'High Resolution Line Source'</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">)</span></code></pre></div><div>to a simple array.</div><div><br></div><div>Thanks for any help!</div><div>Richard</div></div>