From 217d7862ae4631c5c9d174b2bffe511752440f8c Mon Sep 17 00:00:00 2001 From: Thibault Barnouin Date: Mon, 7 Apr 2025 17:02:32 +0200 Subject: [PATCH] fix error on WCS rotation that could mirror the image --- package/lib/fits.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lib/fits.py b/package/lib/fits.py index af8c10b..4e5aef7 100755 --- a/package/lib/fits.py +++ b/package/lib/fits.py @@ -16,7 +16,7 @@ from astropy.io import fits from astropy.wcs import WCS from .convex_hull import clean_ROI -from .utils import wcs_PA, princ_angle +from .utils import wcs_PA def get_obs_data(infiles, data_folder="", compute_flux=False): @@ -78,7 +78,7 @@ def get_obs_data(infiles, data_folder="", compute_flux=False): for key, val in new_wcs.to_header().items(): header[key] = val try: - header["ORIENTAT"] = princ_angle(float(header["ORIENTAT"])) + header["ORIENTAT"] = float(header["ORIENTAT"]) except KeyError: header["ORIENTAT"] = wcs_PA(new_wcs.wcs.pc[1, 0], np.diag(new_wcs.wcs.pc).mean())