updating call to hciplot.plot_frames in compute_binary_map
@@ -510,9 +510,6 @@ def compute_binary_map(frame, thresholds, injections, fwhm, npix=1,
if injections.ndim == 1:
injections = np.array([injections])
- # make a color map of fixed colors
- cmap_bin = colors.ListedColormap(['black', 'white'])
-
for ithr, threshold in enumerate(thresholds):
if debug:
print("\nprocessing threshold #{}: {}".format(ithr + 1, threshold))
@@ -521,7 +518,7 @@ def compute_binary_map(frame, thresholds, injections, fwhm, npix=1,
binmap = (segments.data != 0)
if debug:
- plot_frames((segments.data, binmap), cmap=('tab10', cmap_bin),
+ plot_frames((segments.data, binmap), cmap=('tab20b', 'binary'),
circle=tuple(tuple(xy) for xy in injections),
circle_radius=fwhm, circle_alpha=0.6,
label=("segmentation map", "binary map"))
@@ -537,7 +534,7 @@ def compute_binary_map(frame, thresholds, injections, fwhm, npix=1,
lab = "blob #{}, area={}px**2".format(iblob, blob_area)
plot_frames(blob_mask, circle_radius=fwhm, circle_alpha=0.6,
circle=tuple(tuple(xy) for xy in injections),
- cmap=cmap_bin, label_size=8, label=lab,
+ cmap='binary', label_size=8, label=lab,
size_factor=3)
for iinj, injection in enumerate(injections):
@@ -591,7 +588,7 @@ def compute_binary_map(frame, thresholds, injections, fwhm, npix=1,
labs = [str(det) + ' detections' + '\n' + str(fps) + ' false positives'
for det, fps in zip(list_detections, list_fps)]
plot_frames(tuple(list_binmaps), title='Final binary maps', label=labs,
- label_size=8, cmap=cmap_bin, circle_alpha=0.8,
+ label_size=8, cmap='binary', circle_alpha=0.8,
circle=tuple(tuple(xy) for xy in injections),
circle_radius=fwhm, circle_color='deepskyblue', axis=False)
