Skip to content

Commit

Permalink
Merge pull request #340 from punch-mission/prune-header-dates
Browse files Browse the repository at this point in the history
adds wcs keywords to ignore to prevent duplication
  • Loading branch information
lowderchris authored Dec 6, 2024
2 parents 9b1c8f7 + 8c1630c commit 8f1538c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion punchbowl/data/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
_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", "TELAPSE",
"RSUN_REF", "DSUN_OBS", "CRLN_OBS", "CRLT_OBS", "HGLN_OBS", "HGLT_OBS"]


def load_omniheader(path: str | None = None) -> pd.DataFrame:
Expand Down Expand Up @@ -293,7 +295,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 8f1538c

Please sign in to comment.