I need to discriminate against non physical data in my heatmaps. I am using python(bokeh and holoviews).
Example Code:
import numpy as np
import holoviews as hv
import warnings\
warnings.filterwarnings("ignore")
hv.extension('bokeh')
%opts Image [colorbar=True tools=['hover']
%opts Image (cmap='rainbow')
%output max_frames=3000
import Definitions as def #these are my equations
a = 2
b = .2
c = .3
d = .4
e = 0
f = 0
g = 0
h = 0
i = .2
j = 0
l = .2
m = 1
N = 100 # number of points
yval = np.linspace(0.1,1,N)
xval = np.linspace(0,5,N)
bounds = (0,.1,5,1) #this sets the bounds from .1 to 1 on y axis and 0 to 5 on x axis
xval,yval = np.meshgrid(xval, yval, indexing 'xy')
v1val = def.v1(yval,b,a,m,l,xval) #Calling my these definitions from a seperate file
v2val = def.v2(b,m,a)
Zlist = def.Z(a,v2val/d,v2val/c,h,e,i,j,xval,l,v1val,f,g)
plot = hv.Image(np.flipud(Zlist), label = "Z Heat Map" \
,bounds = bounds, vdims = hv.Dimension('Z', range=(0,1))).redimlabel(x = 'x', y = 'y')
plot
This code makes a heat map where the value of the function Z is mapped as a color for a region of x and y. So Z depends on x and y and for different values of x and y, Z will have different colors.
My problem: I need to discriminate against any situations where v1val < c . The code I currently have plots all of the data but I need it to plot only the data for v1val > c and maybe assign a color like white or black to portion of the graph corresponding to v1val < c. I also similarly need to white out or blackout any region where v2val < d. Essentially I want to black out or white out regions of my heatmap that correspond to non physical data ie when v1val < c and when v2val < d.
I have been trying different things but each time I have some idea I get an error like " The truth of a value of an array with more than one element is ambiguous. Use a.any() or a.all()"
Help with blacking out this non physical data would be much appreciated.