Skip to content

Commit

Permalink
Priority for saving is now Denoised > Gradient-Corrected > Original
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffenhir committed Mar 23, 2024
1 parent 6d0a1bb commit a2a4a87
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions graxpert/application/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit a2a4a87

Please sign in to comment.