Rescale data to custom range, but not just for colorscheme

Dear everyone,

I have a pressure scalar field as a plane, to better visualize maxima and minima, I usually rescale the colorscheme to a range between -1 and 1 and then I play with the opacity mapping until I see only really low and really high zones as blobs.

Now, I would really like to put some contours on these blobs, but the data in itself is not scaled, so I can’t put contours directly on the normalized scale…
Is there a way to rescale data to custom range with a calculator or something like that, so that I can put the contour on the range from -1 to 1 and not the original one?

Thanks a lot and happy festive days

The Python Calculator allows you to rescale a range of data to an arbitrary range. That is, the Expression in the Python Calculator would be as follows:

(custom_max-custom_min)*(YourVariable-min(YourVariable))/(max(YourVariable)-min(YourVariable))+custom_min

In particular, if custom_max = 1 and custom_min = -1, the following can be written:

2*(YourVariable-min(YourVariable))/(max(YourVariable)-min(YourVariable))-1