<div dir="ltr">The best option would be to indeed move the Python code to "get" the array from the the other numerical process to the Programmable Filter's script itself, rather than doing it in the batch script.<div><br></div><div>The do-at-your-own-peril option, which may work if you don't intend to run the batch script in parallel or client-server modes, would be to pass the array via a global variable in some module that both the batch script and the programmable filter script import. Since the Python interpreter is shared between the two, and modules don't get imported twice, you should be able to set the variable in one and access it in another.</div><div><br></div><div>Utkarsh</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 26, 2017 at 10:53 AM, Alessandro De Maio <span dir="ltr"><<a href="mailto:demaio.a@gmail.com" target="_blank">demaio.a@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear all,<div> I'm writing a pvbatch script in which I need to perform some calculations on paraview objects (provided by a quite complex pipeline that starts from reading vtu files and processing through reseamplewithdataset filter and other filter manipulations) by using a programmable filter to which I must pass some information that in the main script is representable as a quite big float numpy ndarray. This array comes from another numerical process that cannot be included in the same programmable filter.</div><div><br></div><div>I don't know how to pass this numpy array to the programmable filter. </div><div>Probably I could use the Parameters property of the programmable filter but, if I correctly understand the use of this feature, the whole array should be converted to a very big string (or more than one) and then reconverted back to float values inside the PF.</div><div><br></div><div>I've tried to create a vtkTable object in the main script using the following lines:</div><div><br></div><div>T = vtkTable()</div><div>array_vtk = numpy_support.numpy_to_vtk(<wbr>array)</div><div>array_vtk.SetName("AAA")</div><div>T.AddColumn(array_vtk)</div><div><br></div><div>and this seems to generate a vtkTable object (by printing type(T) I get "<type 'vtkCommonDataModelPython.<wbr>vtkTable'> " ) but this is not a Paraview class object so when I pass this as an input argument to the Programmable Filter I obviously get the error: "vtkCommonDataModelPython.<wbr>vtkTable' object has no attribute 'SMProxy'.</div><div><br></div><div><br></div><div><br></div><div>Is there any way to do this? I've thought about using servermanager.CreateProxy() but I don't know how to use it and if it could help.</div><div><br></div><div>Of course the easy solution could be to write the array to the disk from the main script and to read it from the disk inside the programmable filter, but I would like to avoid passing through the disk writing that could be too much slow.</div><div><br></div><div>Any help would be appreciated.</div><div>Thank you in advance</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Alessandro</div></font></span></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" rel="noreferrer" target="_blank">http://paraview.org/Wiki/<wbr>ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/paraview" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>