Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multiple bugs #319

Merged
merged 2 commits into from
Apr 9, 2024
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
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
Loading