def make_option_d_cmap(): rgb = np.load(os.path.join(datadir, 'option_d.npy')) cmap = tools.cmap(rgb, N=256) cmap.name = 'matplotlib option_d' cmap.units = '[]' cmap.author = 'eric firing' return cmap
def make_density_cmap(): rgb = np.load(os.path.join(datadir, 'Density.npy')) cmap = tools.cmap(rgb[::-1], N=256) cmap.name = 'Density' cmap.units = 'kg/m^3' cmap.author = 'kmt' return cmap
def make_salinity_cmap(): rgb = np.load(os.path.join(datadir, 'Salinity.npy')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Salinity' cmap.units = 'g/kg' cmap.author = 'kmt' return cmap
def make_bathymetry_cmap(): rgb = np.load(os.path.join(datadir, 'Bathymetry.npy')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Bathymetry' cmap.units = 'm' cmap.author = 'kmt' return cmap
def make_temperature_cmap(): rgb = np.load(os.path.join(datadir, 'Temperature.npy')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Temperature' cmap.units = 'C' cmap.author = 'kmt' return cmap
def make_CDOM_cmap(): rgb = np.load(os.path.join(datadir, 'CDOM.npy')) cmap = tools.cmap(rgb[::-1], N=256) cmap.name = 'CDOM' cmap.units = 'mg/m^3' cmap.author = 'kmt' return cmap
def make_speed_cmap(): rgb = np.load(os.path.join(datadir, 'Speed.npy')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Speed' cmap.units = 'm/s' cmap.author = 'kmt' return cmap
def make_PAR_cmap(): rgb = np.load(os.path.join(datadir, 'PAR.npy')) cmap = tools.cmap(rgb, N=256) cmap.name = 'PAR' cmap.units = 'W/m^2' cmap.author = 'kmt' return cmap
def make_oxygen_cmap(): rgb = np.loadtxt(os.path.join(datadir, 'Oxygen-rgb.txt')) # # Did the following originally to set up the text file, but now it has already been done. # l = rgb.shape[0] # num = int(l/5.) # # Take last 1/5 of colormap and save since I want it, flipped, at the end, keeping the full lightness range in the middle 3/5 # yellow = rgb[l-num:, :].copy() # # convert .2 to 1.0 of colormap to grayscale # # from skimage import color # from colorspacious import cspace_converter # cam = cspace_converter("sRGB1", "CAM02-UCS")(rgb) # # lab = color.rgb2lab(rgb[np.newaxis, :]) # # gray[:, 0] = 0.2989*rgb[num:, 0] + 0.5870*rgb[num:, 1] + 0.1140*rgb[num:, 2] # # gray[:, 1] = gray[:, 0] # # gray[:, 2] = gray[:, 0] # # Interpolate the gray part to be just the middle 3/5 # newx = np.linspace(0, 1, rgb[num:l-num, :].shape[0]) # oldx = np.linspace(0, 1, rgb[num:, :].shape[0]) # oldgray = cam[num:, 0]/100. # # oldgray = lab[0, num:, 0] # rgb[num:l-num, 0] = np.interp(newx, oldx, oldgray) # rgb[num:l-num, 1] = np.interp(newx, oldx, oldgray) # rgb[num:l-num, 2] = np.interp(newx, oldx, oldgray) # # Add back in flipped yellow part to be divergent super saturated state # rgb[l-num:, :] = yellow[::-1, :] # cam[:num, 0] += (cam[:num, 0] - cam[0, 0])*0.3 # rgb[:num] = cspace_converter("CAM02-UCS", "sRGB1")(cam[:num, :]) cmap = tools.cmap(rgb, N=256) cmap.name = 'Oxygen' cmap.long_name = 'Oxygen' cmap.units = 'm/l' cmap.author = 'kmt' return cmap
def make_turbidity_cmap(): rgb = np.load(os.path.join(datadir, 'Turbidity.npy')) cmap = tools.cmap(rgb[::-1], N=256) cmap.name = 'Turbidity' cmap.units = 'NTU' cmap.author = 'kmt' return cmap
def make_freesurface_cmap(): rgb = np.loadtxt(os.path.join(datadir, 'Freesurface-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Free surface' cmap.units = 'm' cmap.author = 'kmt' return cmap
def make_chlorophyll_cmap(): rgb = np.loadtxt(os.path.join(datadir, 'Chlorophyll-rgb.txt')) cmap = tools.cmap(rgb, N=256) # cmap = tools.cmap(rgb[::-1], N=256) cmap.name = 'Chlorophyll' cmap.units = 'mg/m^3' cmap.author = 'kmt' return cmap
def make_CDOM_cmap(): rgb = np.loadtxt(os.path.join(datadir, 'CDOM-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'CDOM' cmap.long_name = 'Colored Dissolved Organic Matter' cmap.units = 'mg/m^3' cmap.author = 'kmt' return cmap
def make_gray_cmap(): rgb = np.loadtxt(os.path.join(datadir, 'Gray-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Gray' cmap.long_name = 'Gray' cmap.units = '' cmap.author = 'kmt' return cmap
def make_phase_cmap(): rgb = np.loadtxt(os.path.join(datadir, 'Phase-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Phase' cmap.long_name = 'Phase' cmap.units = 'degrees' cmap.author = 'kmt' return cmap
def make_PAR_cmap(): rgb = np.loadtxt(os.path.join(datadir, 'PAR-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'PAR' cmap.long_name = 'Photosynthetically Available Radiation' cmap.units = 'W/m^2' cmap.author = 'kmt' return cmap
def make_vorticity_cmap(): rgb = np.loadtxt(os.path.join(datadir, 'Vorticity-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Vorticity' cmap.long_name = 'Vertical Vorticity' cmap.units = '1/s' cmap.author = 'kmt' return cmap
def make_density_cmap(): rgb = np.loadtxt(os.path.join(datadir, 'Density-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Density' cmap.long_name = 'Density' cmap.units = 'kg/m^3' cmap.author = 'kmt' return cmap
def make_CDOM_cmap(): rgb = np.loadtxt(os.path.join(datadir, "CDOM-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "CDOM" cmap.long_name = "Colored Dissolved Organic Matter" cmap.units = "mg/m^3" cmap.author = "kmt" return cmap
def make_turbidity_cmap(): rgb = np.loadtxt(os.path.join(datadir, 'Turbidity-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Turbidity' cmap.long_name = 'Turbidity' cmap.units = 'NTU' cmap.author = 'kmt' return cmap
def make_temperature_cmap(): rgb = np.loadtxt(os.path.join(datadir, "Temperature-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "Temperature" cmap.long_name = "Temperature" cmap.units = "C" cmap.author = "kmt" return cmap
def make_chlorophyll_cmap(): rgb = np.loadtxt(os.path.join(datadir, "Chlorophyll-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "Chlorophyll" cmap.long_name = "Chlorophyll" cmap.units = "mg/m^3" cmap.author = "kmt" return cmap
def make_gray_cmap(): rgb = np.loadtxt(os.path.join(datadir, "Gray-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "Gray" cmap.long_name = "Gray" cmap.units = "" cmap.author = "kmt" return cmap
def make_salinity_cmap(): rgb = np.loadtxt(os.path.join(datadir, "Salinity-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "Salinity" cmap.long_name = "Salinity" cmap.units = "g/kg" cmap.author = "kmt" return cmap
def make_freesurface_cmap(): rgb = np.loadtxt(os.path.join(datadir, "FreeSurface-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "FreeSurface" cmap.long_name = "Free Surface" cmap.units = "m" cmap.author = "kmt" return cmap
def make_phase_cmap(): rgb = np.loadtxt(os.path.join(datadir, "Phase-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "Phase" cmap.long_name = "Phase" cmap.units = "degrees" cmap.author = "kmt" return cmap
def make_bathymetry_cmap(): rgb = np.loadtxt(os.path.join(datadir, "Bathymetry-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "Bathymetry" cmap.long_name = "Bathymetry" cmap.units = "m" cmap.author = "kmt" return cmap
def make_vorticity_cmap(): rgb = np.loadtxt(os.path.join(datadir, "Vorticity-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "Vorticity" cmap.long_name = "Vertical Vorticity" cmap.units = "1/s" cmap.author = "kmt" return cmap
def make_PAR_cmap(): rgb = np.loadtxt(os.path.join(datadir, "PAR-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "PAR" cmap.long_name = "Photosynthetically Available Radiation" cmap.units = "W/m^2" cmap.author = "kmt" return cmap
def make_density_cmap(): rgb = np.loadtxt(os.path.join(datadir, "Density-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "Density" cmap.long_name = "Density" cmap.units = "kg/m^3" cmap.author = "kmt" return cmap
def make_turbidity_cmap(): rgb = np.loadtxt(os.path.join(datadir, "Turbidity-rgb.txt")) cmap = tools.cmap(rgb, N=256) cmap.name = "Turbidity" cmap.long_name = "Turbidity" cmap.units = "NTU" cmap.author = "kmt" return cmap
def make_speed_cmap(): # Uses positive part of velocity colormap rgb = np.loadtxt(os.path.join(datadir, 'Speed-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'Speed' cmap.long_name = 'Speed' cmap.units = 'm/s' cmap.author = 'kmt' return cmap
def make_waveheight_cmap(): # Uses positive part of free surface colormap rgb = np.loadtxt(os.path.join(datadir, 'WaveHeight-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'WaveHeight' cmap.long_name = 'Wave Height' cmap.units = 'meters' cmap.author = 'kmt' return cmap
def make_waveperiod_cmap(): # Uses negative part of vorticity colormap rgb = np.loadtxt(os.path.join(datadir, 'WavePeriod-rgb.txt')) cmap = tools.cmap(rgb, N=256) cmap.name = 'WavePeriod' cmap.long_name = 'Wave Period' cmap.units = 'seconds' cmap.author = 'kmt' return cmap
def make_oxygen_cmap(): rgb = np.load(os.path.join(datadir, 'Oxygen.npy')) # convert middle .2 to .8 of colormap to grayscale l = rgb.shape[0] num = l/5. rgb[num:l-num,0] = 0.2989*rgb[num:l-num,0] + 0.5870*rgb[num:l-num,1] + 0.1140*rgb[num:l-num,2] rgb[num:l-num,1] = rgb[num:l-num,0] rgb[num:l-num,2] = rgb[num:l-num,0] cmap = tools.cmap(rgb, N=256) cmap.name = 'Oxygen' cmap.units = 'm/l' cmap.author = 'kmt' return cmap