From a2a4a87e704ac404bbb127b123e89ca226d858ca Mon Sep 17 00:00:00 2001 From: Steffen Hirtle Date: Sat, 23 Mar 2024 10:59:19 +0100 Subject: [PATCH] Priority for saving is now Denoised > Gradient-Corrected > Original --- graxpert/application/app.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/graxpert/application/app.py b/graxpert/application/app.py index 42bad7f..3514757 100644 --- a/graxpert/application/app.py +++ b/graxpert/application/app.py @@ -135,8 +135,6 @@ def on_calculate_request(self, event=None): self.prefs.images_linked_option = False img_array_to_be_processed = np.copy(self.images.get("Original").img_array) - if (self.images.get("Denoised") is not None): - img_array_to_be_processed = np.copy(self.images.get("Denoised").img_array) background = AstroImage() background.set_from_array( @@ -377,7 +375,13 @@ def on_save_request(self, event): eventbus.emit(AppEvents.SAVE_BEGIN) try: - self.images.get("Gradient-Corrected").save(dir, self.prefs.saveas_option) + if (self.images.get("Denoised") is not None): + self.images.get("Denoised").save(dir, self.prefs.saveas_option) + elif (self.images.get("Gradient-Corrected") is not None): + self.images.get("Gradient-Corrected").save(dir, self.prefs.saveas_option) + else: + self.images.get("Original").save(dir, self.prefs.saveas_option) + except Exception as e: logging.exception(e) eventbus.emit(AppEvents.SAVE_ERROR) @@ -421,10 +425,13 @@ def on_save_stretched_request(self, event): eventbus.emit(AppEvents.SAVE_BEGIN) try: - if self.images.get("Gradient-Corrected") is None: - self.images.get("Original").save_stretched(dir, self.prefs.saveas_option, StretchParameters(self.prefs.stretch_option, self.prefs.channels_linked_option)) - else: + if (self.images.get("Denoised") is not None): + self.images.get("Denoised").save_stretched(dir, self.prefs.saveas_option, StretchParameters(self.prefs.stretch_option, self.prefs.channels_linked_option)) + elif (self.images.get("Gradient-Corrected") is not None): self.images.get("Gradient-Corrected").save_stretched(dir, self.prefs.saveas_option, StretchParameters(self.prefs.stretch_option, self.prefs.channels_linked_option)) + else: + self.images.get("Original").save_stretched(dir, self.prefs.saveas_option, StretchParameters(self.prefs.stretch_option, self.prefs.channels_linked_option)) + except Exception as e: eventbus.emit(AppEvents.SAVE_ERROR) logging.exception(e)