Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pingmapper/class_mapSubstrateObj.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ def _pltSubClass(self, map_class_method, chunk, npz, spdCor=1, maxCrop=0, probs=
ax.imshow(son, cmap='gray')

# Prepare color map
color_map = plt.cm.get_cmap('viridis')
color_map = plt.get_cmap('viridis')

im = ax.imshow(c, cmap=color_map, alpha=0.5, vmin=minSoft, vmax=maxSoft)
ax.axis('off')
Expand Down
10 changes: 5 additions & 5 deletions pingmapper/class_rectObj.py
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ def _rectSonHeading(self, df: pd.DataFrame, chunk, son=True, wgs=False, interpol
use_uint8_rgb = self._export_colormap_as_uint8()
if source_scale_bounds is not None:
norm_data = self._normalize_with_bounds(sonRect_raw16, source_scale_bounds[0], source_scale_bounds[1])
cmap = plt.cm.get_cmap(self.son_colorMap_name)(norm_data)
cmap = plt.get_cmap(self.son_colorMap_name)(norm_data)
if use_uint8_rgb:
sonRect_out = np.clip(cmap[:, :, :3] * 255.0, 0, 255).astype(np.uint8)
else:
Expand Down Expand Up @@ -2769,9 +2769,9 @@ def _rectSonRubber(self,
if source_scale_bounds is not None:
norm_data = self._normalize_with_bounds(out16_raw, source_scale_bounds[0], source_scale_bounds[1])
if use_uint8_rgb:
out16 = np.clip(plt.cm.get_cmap(self.son_colorMap_name)(norm_data)[:, :, :3] * 255.0, 0, 255).astype(np.uint8)
out16 = np.clip(plt.get_cmap(self.son_colorMap_name)(norm_data)[:, :, :3] * 255.0, 0, 255).astype(np.uint8)
else:
out16 = np.clip(plt.cm.get_cmap(self.son_colorMap_name)(norm_data)[:, :, :3] * 65535.0, 0, 65535).astype(np.uint16)
out16 = np.clip(plt.get_cmap(self.son_colorMap_name)(norm_data)[:, :, :3] * 65535.0, 0, 65535).astype(np.uint16)
valid_mask = out16_raw > 0
out16[valid_mask] = np.maximum(out16[valid_mask], 1)
else:
Expand Down Expand Up @@ -2914,9 +2914,9 @@ def _rectSonRubber(self,
if source_scale_bounds is not None:
norm_data = self._normalize_with_bounds(out16_raw, source_scale_bounds[0], source_scale_bounds[1])
if use_uint8_rgb:
out16 = np.clip(plt.cm.get_cmap(self.son_colorMap_name)(norm_data)[:, :, :3] * 255.0, 0, 255).astype(np.uint8)
out16 = np.clip(plt.get_cmap(self.son_colorMap_name)(norm_data)[:, :, :3] * 255.0, 0, 255).astype(np.uint8)
else:
out16 = np.clip(plt.cm.get_cmap(self.son_colorMap_name)(norm_data)[:, :, :3] * 65535.0, 0, 65535).astype(np.uint16)
out16 = np.clip(plt.get_cmap(self.son_colorMap_name)(norm_data)[:, :, :3] * 65535.0, 0, 65535).astype(np.uint16)
valid_mask = out16_raw > 0
out16[valid_mask] = np.maximum(out16[valid_mask], 1)
else:
Expand Down
2 changes: 1 addition & 1 deletion pingmapper/class_sonObj.py
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ def _prepare_export_uint16_display(self, data):
return out

def _colorize_array_batched(self, norm_data, valid_mask, cmap_name, scale_max, out_dtype):
cmap = plt.cm.get_cmap(cmap_name)
cmap = plt.get_cmap(cmap_name)
height, width = norm_data.shape
out = np.zeros((height, width, 3), dtype=out_dtype)

Expand Down
2 changes: 1 addition & 1 deletion pingmapper/class_sonObj_nadirgaptest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ def _writeTilesPlot(self,
# plt.savefig(outfile)

norm_data = data / 255.0
colored_data = plt.cm.get_cmap(self.sonogram_colorMap)(norm_data)
colored_data = plt.get_cmap(self.sonogram_colorMap)(norm_data)
colored_data = (colored_data[:, :, :3] * 255).astype('uint8')
data = colored_data

Expand Down
Loading