[Paraview] Color legend and log scaling

Scott, W Alan wascott at sandia.gov
Tue Jul 1 13:09:44 EDT 2014


I would like to propose a few changes in our log scaling algorithm for painting a dataset by a variable.   I discussed this with Utkarsh, and he asked that I bounce it off the e-mail list.  So, here goes.

Currently, when a user log scales a variable, if all data is positive, ParaView just uses the normal min and max.  There are times when this is not proper - for instance when looking at the temperature or density of material in a supernova, or velocity of outbound gas.  Another example is large data, with noise around zero.  I would like to propose that we have a user selectable option to set the minimum at maximum*10^-q, where q is user defined but defaults to 4.  In other words, the minimum would be set to 1*10^-4 of what the maximum is.

If all of the user's data is negative, ParaView grumbles, and then seg faults using a current master git pull - not optimal behavior.  In PV 4.1, it just sets min and max to 0.  I would like to propose that ParaView calculate the log of the data, as follows:  Index= -(log(abs(Var))).  Then, just draw the color legend as normal - for instance, red at top, white in the middle and blue at bottom.  Tick marks will be the reverse of positive log scaling - with the dense numbers, more negative numbers at the bottom and less dense, less negative numbers at the top.

The problem arises with data that spans positive and negative numbers.  Since the log of 0 is infinity, we have to deal with very small numbers in a special way.  I propose that we find maxVal = max(maximum, abs(minimum)).  Then, we set the color bar to run from maxVal to -maxVal.  We log scale the top half of the color legend, running from maxVal to maxVal*10^-4, and we reverse log scale the bottom half of the color legend, running from -maxVal*10^-4 to -maxVal.  We calculate this negative range the same as the all negative data section above.  All data between maxVal*10^-4 and -maxVal*10^-4 would remain white by default, or user selectable black.

User selectable functionality would be as follows:
*       to allow/ not allow negative numbers (default allow)
*       to be able to change the q exponent (i.e., 4 above) (default 4)
*       to be able to change the painting color that is too small (default white)
*       to clamp minimum to some number (such as q == 4 above).  (default on).

Thoughts?

Alan


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20140701/021ecf10/attachment.html>


More information about the ParaView mailing list