The python programmable filter (and the easier to use python programmable calculator variant of that) will get you beyond all of those limitations.<div><br clear="all">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>
28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x109<br>
<br><br><div class="gmail_quote">On Wed, Jun 8, 2011 at 12:11 PM, Nico Schlömer <span dir="ltr"><<a href="mailto:nico.schloemer@gmail.com">nico.schloemer@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 class="im">> If you want to do arbitrary arithmetic, you will have to first<br>
> generate the array using something like a "Calculator" filter and then<br>
> color using the generated array.<br>
<br>
</div>Oh, if I remember correctly I did look into this before, and found the<br>
calculator filter too limited on the arithmetics that you could<br>
perform. Is it still the case that you have a set of like ten<br>
functions (add, multiply, sine, cosine,...) to mix and match? I need<br>
to to something like<br>
<br>
for x in data_values:<br>
if x[0] > 0 and x[1] > 0<br>
return bla<br>
elseif ...<br>
<br>
-- atan2() that is.<br>
<div class="im"><br>
<br>
> Yes, RGBPoints defines the mapping between scalar and color. It's a<br>
> list of 4 tuples (scalar, r, g, b), repeated sequentially.<br>
<br>
</div>Hm, I'll look into it. Where's the proper spot for documentation of this?<br>
<br>
Cheers,<br>
Nico<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
On Wed, Jun 8, 2011 at 5:25 PM, Utkarsh Ayachit<br>
<div><div></div><div class="h5"><<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>> wrote:<br>
> Magnitude corresponds to the magnitude of a vector, so yes, it takes<br>
> the square root.<br>
><br>
> If you want to do arbitrary arithmetic, you will have to first<br>
> generate the array using something like a "Calculator" filter and then<br>
> color using the generated array.<br>
><br>
> Yes, RGBPoints defines the mapping between scalar and color. It's a<br>
> list of 4 tuples (scalar, r, g, b), repeated sequentially.<br>
><br>
> Utkarsh<br>
><br>
> On Wed, Jun 8, 2011 at 11:19 AM, Nico Schlömer <<a href="mailto:nico.schloemer@gmail.com">nico.schloemer@gmail.com</a>> wrote:<br>
>> Thanks for the hints.<br>
>><br>
>> The Trace function in indeed quite useful in that it get you where you<br>
>> want to be. When looking at the code there's still a lot of me to<br>
>> understand though, the GetLookupTableForArray() call seems to be<br>
>> crucial for example.<br>
>><br>
>> * The VectorMode='Magnitude' parameter seems to be responsible for<br>
>> merging the two components into one scalar, but I'm not quite sure how<br>
>> this is done: with a sqrt() or without? Is is possible to customize<br>
>> this? I'd like to have something like ATAN2 there as well.<br>
>><br>
>> * Is the RGBPoints=[0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0],<br>
>> parameter responsible for the colormap?<br>
>><br>
>> Cheers,<br>
>> Nico<br>
>><br>
>><br>
>><br>
>><br>
>><br>
>> On Wed, Jun 8, 2011 at 3:13 PM, Utkarsh Ayachit<br>
>> <<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>> wrote:<br>
>>> The following wiki page talks about how to color using arrays:<br>
>>> <a href="http://www.paraview.org/Wiki/ParaView/Python_Scripting#Representations_and_Views" target="_blank">http://www.paraview.org/Wiki/ParaView/Python_Scripting#Representations_and_Views</a><br>
>>><br>
>>> The easiest way to figure out Python code equivalents is to use the<br>
>>> Trace functionality to generate python trace files for actions<br>
>>> performed in the GUI (accessible from Tools menu). You "Start Trace",<br>
>>> do a set of actions and then "Stop Trace" and you should be able to<br>
>>> view the resulting Python code.<br>
>>><br>
>>> Utkarsh<br>
>>><br>
>>><br>
>>><br>
>>> On Wed, Jun 8, 2011 at 9:05 AM, Nico Schlömer <<a href="mailto:nico.schloemer@gmail.com">nico.schloemer@gmail.com</a>> wrote:<br>
>>>> Hi,<br>
>>>><br>
>>>> I'm just taking first steps with ParaView's Python interface and<br>
>>>> figured out so far that<br>
>>>><br>
>>>> ================ *snip* ================<br>
>>>> exodusReader = ExodusIIReader( FileName="solution.e" )<br>
>>>> Show( exodusReader )<br>
>>>> Render()<br>
>>>> ================ *snap* ================<br>
>>>><br>
>>>> would plot the mesh that is stored in the ExodusII file solution.e,<br>
>>>> and that can play around with GetActiveView() to adjust camera angles<br>
>>>> and such.<br>
>>>><br>
>>>> What I haven't found out though is how to plot actual point data. I get<br>
>>>><br>
>>>><br>
>>>>>>> exodusReader.PointData[:]<br>
>>>> [Array: GlobalNodeId, Array: PedigreeNodeId, Array: A, Array: psi,<br>
>>>> Array: thickness]<br>
>>>><br>
>>>> and l'm looking at the 2-component array "psi". For example, I'd like<br>
>>>> to do something like<br>
>>>><br>
>>>> res = sqrt( component1**2 + component2**2 )<br>
>>>><br>
>>>> and have res[:] rendered on the mesh with a certain color map.<br>
>>>><br>
>>>> Any hints?<br>
>>>><br>
>>>> Cheers,<br>
>>>> Nico<br>
>>>> _______________________________________________<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>
>>>> Follow this link to subscribe/unsubscribe:<br>
>>>> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
>>>><br>
>>><br>
>><br>
><br>
_______________________________________________<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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
</div></div></blockquote></div><br></div>