[Paraview] Changing colormap parameters in a Catalyst script
Cory Quammen
cory.quammen at kitware.com
Fri Oct 30 15:19:37 EDT 2015
Mattheiu,
For rescaling when your data range is known, use:
a1_dbz_PiecewiseFunction.RescaleTransferFunction(min, max)
a1_dbz_PVLookupTable.RescaleTransferFunction(min, max)
When it is unknown, you can use
pipelineObject = GetActiveSource()
display = GetDisplayProperties(pipelineObject)
display.RescaleTransferFunctionToDataRange(False)
You can change the False argument to True in the second line if you want
the rescaling to only extend the current range instead of possibly
shrinking it.
Hope that helps,
Cory
On Fri, Oct 30, 2015 at 2:59 PM, Dorier, Matthieu <mdorier at anl.gov> wrote:
> Hi,
>
> I have generated a Catalyst python script that produces a colormap on a
> slice of a 3D rectilinear grid. I would like to use the same script for
> another variable of the simulation, but the range of data is not the same.
> How can I adapt the script, both in case where I know the new data range,
> and in case I don't know and want the colormap to simply figure it out?
>
> I believe the part of the script that deals with that is as follows:
>
> a1_dbz_PiecewiseFunction = CreatePiecewiseFunction(
> Points=[-36.903831481933594, 0.0, 0.5, 0.0, 57.036045074462891, 1.0, 0.5,
> 0.0] )
>
> a1_dbz_PVLookupTable = GetLookupTableForArray( "dbz", 1,
> RGBPoints=[-36.903831481933594, 0.23000000000000001, 0.29899999999999999,
> 0.754, 10.066106796264648, 0.86499999999999999, 0.86499999999999999,
> 0.86499999999999999, 57.036045074462891, 0.70599999999999996, 0.016,
> 0.14999999999999999], VectorMode='Magnitude', NanColor=[0.25, 0.0, 0.0],
> ScalarOpacityFunction=a1_dbz_PiecewiseFunction, ColorSpace='Diverging',
> ScalarRangeInitialized=1.0 )
>
> But I don't know how to adapt it.
>
> Thanks,
>
> Matthieu
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
>
--
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20151030/f2e43c06/attachment.html>
More information about the ParaView
mailing list