From f879af18352fa2e4575e1bd0e6b7920f08c5ed64 Mon Sep 17 00:00:00 2001 From: Dmitri Gavrilov Date: Mon, 8 Apr 2024 19:37:30 -0400 Subject: [PATCH 1/2] FIX: replaced 'hdfpath' with 'hdf_path' --- pyxrf/model/fit_spectrum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyxrf/model/fit_spectrum.py b/pyxrf/model/fit_spectrum.py index 6d31f1ac..6337281f 100644 --- a/pyxrf/model/fit_spectrum.py +++ b/pyxrf/model/fit_spectrum.py @@ -708,7 +708,7 @@ def fit_single_pixel(self): if self.point2v > 0 or self.point2h > 0: prefix_fname = os.path.basename(self.hdf_path).split(".")[0] - output_folder = os.path.join(os.path.dirname(self.hdfpath), prefix_fname + "_pixel_fit") + output_folder = os.path.join(os.path.dirname(self.hdf_path), prefix_fname + "_pixel_fit") if os.path.exists(output_folder) is False: os.mkdir(output_folder) save_fitted_fig( From 133cccde87f67693d3e4c9c6af9772d4bcc4d4e1 Mon Sep 17 00:00:00 2001 From: Dmitri Gavrilov Date: Mon, 8 Apr 2024 22:26:13 -0400 Subject: [PATCH 2/2] FIX: selection of pixels/positions in image viewer is not reset after repeated map fitting --- pyxrf/model/draw_image.py | 6 +++--- pyxrf/model/draw_image_rgb.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyxrf/model/draw_image.py b/pyxrf/model/draw_image.py index fdc3b807..98d5b1dc 100644 --- a/pyxrf/model/draw_image.py +++ b/pyxrf/model/draw_image.py @@ -140,6 +140,9 @@ def __init__(self, *, io_model): self.param_quant_analysis.set_experiment_distance_to_sample(distance_to_sample=0.0) self.param_quant_analysis.set_experiment_incident_energy(incident_energy=self.incident_energy) + # init of pos values + self.pixel_or_pos = 0 + self.fig = plt.figure(figsize=(3, 2)) matplotlib.rcParams["axes.formatter.useoffset"] = True @@ -171,9 +174,6 @@ def init_plot_status(self): self.scaler_items.sort() self.scaler_data = None - # init of pos values - self.set_pixel_or_pos(0) - if "positions" in self.io_model.img_dict: try: logger.debug(f"Position keys: {list(self.io_model.img_dict['positions'].keys())}") diff --git a/pyxrf/model/draw_image_rgb.py b/pyxrf/model/draw_image_rgb.py index 4d8353c6..d007aecd 100644 --- a/pyxrf/model/draw_image_rgb.py +++ b/pyxrf/model/draw_image_rgb.py @@ -135,6 +135,9 @@ def __init__(self, *, io_model, img_model_adv): "dwell_time", ] + # init of pos values + self.pixel_or_pos = 0 + self.rgb_keys = ["red", "green", "blue"] self._init_rgb_dict() @@ -155,9 +158,6 @@ def img_dict_updated(self, change): self.init_plot_status() def init_plot_status(self): - # init of pos values - self.set_pixel_or_pos(0) - # init of scaler for normalization self.scaler_name_index = 0