Skip to content

Commit

Permalink
adds wcs keywords to ignore to prevent duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
lowderchris committed Dec 6, 2024
1 parent 544b039 commit d69dcf2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion punchbowl/data/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
_ROOT = os.path.abspath(os.path.dirname(__file__))
REQUIRED_HEADER_KEYWORDS = ["SIMPLE", "BITPIX", "NAXIS", "EXTEND"]
DISTORTION_KEYWORDS = ["CPDIS1", "CPDIS2", "DP1", "DP2"]
WCS_OMITTED_KEYWORDS = ["TIMESYS", "DATE-OBS", "DATE-BEG", "DATE-AVG", "DATE-END"]


def load_omniheader(path: str | None = None) -> pd.DataFrame:
Expand Down Expand Up @@ -293,7 +294,9 @@ def to_fits_header(self, wcs: WCS | None = None, write_celestial_wcs: bool = Tru
else:
wcs_header = this_wcs.to_header()
for card in wcs_header.cards:
if key == "" or (key != "" and card[0][-1].isnumeric() and card[0] not in DISTORTION_KEYWORDS):
if key == "" or (key != "" and card[0][-1].isnumeric() and
card[0] not in DISTORTION_KEYWORDS and
card[0] not in WCS_OMITTED_KEYWORDS):
hdr.append(
(
card[0] + key,
Expand Down

0 comments on commit d69dcf2

Please sign in to comment.