MantisBT - ParaView
View Issue Details
0011539ParaViewFeaturepublic2010-11-30 11:182016-03-09 13:17
Rick Angelini 
Alan Scott 
normalminorN/A
closedfixed 
ALLALLALL
Development 
 
0011539: Python Macro to "Rescale Data to Range"
Can I get a single Python macro that is equivalent to "Rescale to Data Range"? I will provide below an example of how I want to use this macro, but I suppose this feature would be valuable for ANY python script that loads a state file where the scale of some variables changes after the state file is created.


I am doing some testing with Paraview where I'm looking at how the data is distributed across processors. So, I'm loading my data and applying the Process ID Filter. So far, so good.

I'm using PVBATCH to do some of the testing and I'm using a very simple .py file that looks like this:

rom paraview.simple import *
servermanager.LoadState("cth_390.pvsm")
WriteAnimation("./cth_390.png")

I need one more command to get things the way that I want them. The color table is not automatically scaled across the number of processors used in the current batch run - it's scaled across the number of processors I used when I created the state file. If I'm running ParaView interactively, I can simply use the "Rescale to Data Range" button. How do I find the appropriate action when running in batch? I looked at the python that was generated when I do this interactively, and the command is specific to the current run - it's not a generic solution:

a1_ProcessId_PVLookupTable = GetLookupTableForArray( "ProcessId", 1, RGBPoints=[0.0, 0.23000000000000001, 0.29899999999999999, 0.754, 5.0, 0.70599999999999996, 0.016, 0.14999999999999999] )
Render()

I suppose this feature would be valuable for ANY state file where the scale of some variables changes after the state file is created.



   
No tags attached.
Issue History
2010-11-30 11:18Rick AngeliniNew Issue
2010-11-30 11:26Rick AngeliniNote Added: 0023581
2011-06-16 13:10Zack GalbreathCategoryFeature Request => Feature
2016-03-09 13:17Alan ScottNote Added: 0035836
2016-03-09 13:17Alan ScottStatusexpired => closed
2016-03-09 13:17Alan ScottAssigned To => Alan Scott
2016-03-09 13:17Alan ScottResolutionopen => fixed

Notes
(0023581)
Rick Angelini   
2010-11-30 11:26   
On a side note, it seems as though anything that you can click on in the GUI should have an equivalent Python macro.
(0035836)
Alan Scott   
2016-03-09 13:17   
This has been implemented, and can be found through the trace recorder (i.e., tools/ start and stop trace).

The actual command is

# rescale color and/or opacity maps used to exactly fit the current data range
canex2Display.RescaleTransferFunctionToDataRange(False)

Closing bug.