From 1383c9ea1b393dcbd415b51be808b68b8a08f57f Mon Sep 17 00:00:00 2001 From: Ana Rodrigues Date: Tue, 21 May 2024 18:12:43 +0200 Subject: [PATCH 1/2] feat: customizable colormap --- bblib/methods.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bblib/methods.py b/bblib/methods.py index 1b9d02d..039f1b1 100755 --- a/bblib/methods.py +++ b/bblib/methods.py @@ -122,14 +122,14 @@ def _run_centering(self, **kwargs) -> tuple: ax1.imshow( self.visual_data * self.mask_for_center_of_mass, norm=LogNorm(), - cmap="spring", + cmap=self.plots_info["color_map"], origin="lower", ) else: ax1.imshow( self.visual_data * self.mask_for_center_of_mass, norm=LogNorm(self.plots_info["value_min"], self.plots_info["value_max"]), - cmap="spring", + cmap=self.plots_info["color_map"], origin="lower", ) ax1.scatter( @@ -274,14 +274,14 @@ def _run_centering(self, **kwargs) -> tuple: self.visual_data * self.mask_for_circle_detection, norm=LogNorm(), origin="lower", - cmap="spring", + cmap=self.plots_info["color_map"], ) else: ax1.imshow( self.visual_data * self.mask_for_circle_detection, norm=LogNorm(self.plots_info["value_min"], self.plots_info["value_max"]), origin="lower", - cmap="spring", + cmap=self.plots_info["color_map"], ) ax1.scatter( self.initial_detector_center[0], @@ -562,14 +562,14 @@ def _run_centering(self, **kwargs) -> tuple: self.visual_data * self.mask_for_fwhm_min, norm=LogNorm(), origin="lower", - cmap="spring", + cmap=self.plots_info["color_map"], ) else: ax1.imshow( self.visual_data * self.mask_for_fwhm_min, norm=LogNorm(self.plots_info["value_min"], self.plots_info["value_max"]), origin="lower", - cmap="spring", + cmap=self.plots_info["color_map"], ) ax1.scatter( self.initial_detector_center[0], @@ -802,11 +802,11 @@ def _run_centering(self, **kwargs) -> tuple: fig, ax1 = plt.subplots(1, 1, figsize=(10, 10)) if self.plots_info["value_auto"]: pos = ax1.imshow( - self.visual_data, norm=LogNorm(), cmap="spring", origin="lower" + self.visual_data, norm=LogNorm(), cmap=self.plots_info["color_map"], origin="lower" ) else: pos = ax1.imshow( - self.visual_data, norm=LogNorm(self.plots_info["value_min"], self.plots_info["value_max"]), cmap="spring", origin="lower" + self.visual_data, norm=LogNorm(self.plots_info["value_min"], self.plots_info["value_max"]), cmap=self.plots_info["color_map"], origin="lower" ) ax1.scatter( self.initial_detector_center[0], @@ -874,11 +874,11 @@ def _run_centering(self, **kwargs) -> tuple: fig, ax1 = plt.subplots(1, 1, figsize=(10, 10)) if self.plots_info["value_auto"]: pos = ax1.imshow( - self.visual_data, norm=LogNorm(), cmap="spring", origin="lower" + self.visual_data, norm=LogNorm(), cmap=self.plots_info["color_map"], origin="lower" ) else: pos = ax1.imshow( - self.visual_data, norm=LogNorm(self.plots_info["value_min"], self.plots_info["value_max"]), cmap="spring", origin="lower" + self.visual_data, norm=LogNorm(self.plots_info["value_min"], self.plots_info["value_max"]), cmap=self.plots_info["color_map"], origin="lower" ) ax1.scatter( From aabe815f2acdafc58b687b69a1cd233f75dd6121 Mon Sep 17 00:00:00 2001 From: Ana Rodrigues Date: Tue, 21 May 2024 18:13:31 +0200 Subject: [PATCH 2/2] chore: update readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1963d1b..bdf35ce 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,8 @@ plots_info = { "xlim_min": ..., "xlim_max": ..., "ylim_min": ..., - "ylim_max": ... + "ylim_max": ..., + "color_map": ... } ``` To calculate the refined detector center of raw data frame as a numpy array using the following methods: