Skip to content

Feature/images refactor#160

Merged
Jammy2211 merged 4 commits intomainfrom
feature/images_refactor
Feb 21, 2025
Merged

Feature/images refactor#160
Jammy2211 merged 4 commits intomainfrom
feature/images_refactor

Conversation

@Jammy2211
Copy link
Owner

Refactors image output such that:

  • Removes config customization on the level of individual figures, as this made configs too complex and can be achieved via AggretorImages.

  • Outputs .fits files containing key images as .fits output of key information is key, with these grouped packages suited to AggregatorFits object.

  • Creates a nasty new function in MultiFigurePlotter for outputting .fits groups via Plotter interface, quite hacky but works for now.

@Jammy2211 Jammy2211 requested a review from rhayes777 February 21, 2025 10:20
Comment on lines +264 to +272
if self.plotter_list[0].mat_plot_1d is not None:
self.plotter_list[0].mat_plot_1d.output.subplot_to_figure(
auto_filename=f"subplot_{filename_suffix}"
)
if self.plotter_list[0].mat_plot_2d is not None:
self.plotter_list[0].mat_plot_2d.output.subplot_to_figure(
auto_filename=f"subplot_{filename_suffix}"
)
self.plotter_list[0].close_subplot_figure()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assign variables to avoid repetition

Comment on lines +319 to +322
output_fits_file = os.path.join(output_path, f"{filename}.fits")

if remove_fits_first and os.path.exists(output_fits_file):
os.remove(output_fits_file)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's much nicer to use pathlib.Path

Comment on lines +900 to +904
try:
header["PIXSCAY"] = str(arr.pixel_scales[0])
header["PIXSCAX"] = str(arr.pixel_scales[1])
except AttributeError:
pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y, x = map(str, arr.pixel_scales)

@Jammy2211 Jammy2211 merged commit 60ee228 into main Feb 21, 2025
8 checks passed
@Jammy2211 Jammy2211 deleted the feature/images_refactor branch March 24, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants