<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Thank you Berk for your answer.<br><br></div>You are right, make_vector is even mentioned in some parts of the Paraview Guide that I have read. But my first need was to create a 9-component field to be able to use the Tensor Glyph filter, so I still have to use numpy.<br><br></div>To reproduce the bug:<br></div>- create a source sphere<br></div>- create a filter Python Calculator with this formula: numpy.column_stack((Normals[:,0], Normals[:,1], Normals[:,2])) and Apply.<br></div>- display the field result<br></div><div>- in the toolbar, click on Magnitude to see the components: X, Y, Z. It is OK.<br></div>- edit the formula of the Python Calculator with a formula that changes the number of components: numpy.column_stack((Normals[:,0], Normals[:,1], Normals[:,2], Normals[:,0])) and Apply without changing the name of the result field.<br>- in the toolbar, click on Magnitude to see the components: X, Y, Z. It is not OK.<br></div>- in the panel Information, the field "result" has 4 components. It is OK.<br></div>- edit the name of the result field to call it result2 and Apply.<br>- display the field result2, and click on Magnitude to see the components: 0, 1, 2, 3. It is OK.<br><br></div>So it seems to be a bug in the drop down button to select the component that is not updated when the formula changes the number of components on an existing field.<br><br></div>Christophe<br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-04-02 17:01 GMT+02:00 Berk Geveci <span dir="ltr"><<a href="mailto:berk.geveci@kitware.com" target="_blank">berk.geveci@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">Dear Christophe,<div><br></div><div>It seems like the documentation got out of date. Thank you for reporting it. There is also a make_vector() function now. You can pass it 2 or 3 components:</div><div><br></div><div><div>def make_vector(arrayx, arrayy, arrayz=None):</div><div> """Given 2 or 3 scalar arrays, returns a vector array. If only</div><div> 2 scalars are provided, the third component will be set to 0."""</div></div><div><br></div><div><br></div><div>I defer to Utkarsh to explain how to contribute to the tex documentation. It is definitely very welcome.</div><div><br></div><div>Finally, I am not sure that I understand the comment about the potential bug. Can you please give the steps to reproduce?</div><div><br>Thanks,</div><div>-berk</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Apr 2, 2015 at 5:23 AM, Christophe Bourcier <span dir="ltr"><<a href="mailto:christophe.bourcier.pv@gmail.com" target="_blank">christophe.bourcier.pv@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><div><div><div><div><div><div>Dear Paraview folks,<br><br></div>It seems there is a mistake in the Paraview User's Guide at the end of the section Python Calculator.<br><br>To create a multi-component field from multiple scalar fields, hstack used to work before Paraview 4.2.0.<br><br></div>But since Paraview 4.2.0, we must use numpy.column_stack. This change may have been caused by the great work done in 4.2.0 to be able to use numpy arrays as vtk arrays with automatic conversion from numpy to vtk and inversely.<br><br></div>Using hstack will create a dataset with many components (number of nodes times the number of field in hstack).<br><br></div>For instance, create a sphere source with default properties.<br><br></div>In Paraview 4.1.0, use this formula to create the same field as Normals:<br>hstack((Normals[:,0], Normals[:,1], Normals[:,2]))<br><br>In Paraview 4.2.0 and 4.3.1, if you use numpy.hstack((Normals[:,0], Normals[:,1], Normals[:,2])), you will get a field with 150 components, since the default sphere has 50 points. And it may lead to a memory oversize for a source with thousands points.<br><br>In Paraview 4.2.0 and 4.3.1, the following formula gives the wanted result: <br>numpy.column_stack((Normals[:,0], Normals[:,1], Normals[:,2]))<br><br></div>Note that you must change the name of the result, otherwise the number of components is not updated between two different formulas. This might be a bug.<br><br></div><div>I have not found where the latex documentation is. Is it available somewhere as a git repository? What is the policy on contributing to it?<span><font color="#888888"><span><font color="#888888"><br></font></span></font></span></div><span><font color="#888888"><span><font color="#888888"><div><br></div>Christophe<br></font></span></font></span></div>
</div><br></div>
<br></div></div>_______________________________________________<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="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>