Skip to content

Commit

Permalink
Merge pull request #319 from dmgav/fix-bugs
Browse files Browse the repository at this point in the history
Fix multiple bugs
  • Loading branch information
dmgav authored Apr 9, 2024
2 parents 7c5cf85 + 133cccd commit 604efda
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pyxrf/model/draw_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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())}")
Expand Down
6 changes: 3 additions & 3 deletions pyxrf/model/draw_image_rgb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyxrf/model/fit_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 604efda

Please sign in to comment.