Skip to content

fix: Follow the FITS standard when RADESYS is absent, and support pv in the keyword constructor - #19

Merged
cgarling merged 2 commits into
mainfrom
radesys-defaults
Aug 11, 2026
Merged

cgarling merged 2 commits into
mainfrom
radesys-defaults

Conversation

@icweaver

@icweaver icweaver commented Jul 23, 2026 •

Copy link
Copy Markdown
Member

Hi Chris, here are two changes to header parsing/construction that came up while I was porting Reproject.jl from WCS.jl to FITSWCS.jl.

1. Standard-compliant RADESYS defaulting

Previously, an absent RADESYS always defaulted to "ICRS". The FITS WCS standard (Paper II, Section 3.1, and wcslib's wcsset()) instead prescribes:

Header wcs.radesys before wcs.radesys now
Equatorial/ecliptic, no RADESYS, no EQUINOX "ICRS" "ICRS"
Equatorial/ecliptic, no RADESYS, EQUINOX < 1984 "ICRS" "FK4"
Equatorial/ecliptic, no RADESYS, EQUINOX >= 1984 "ICRS" "FK5"
Non-equatorial (galactic, linear, spectral, ...), no RADESYS "ICRS" ""
Explicit RADESYS kept kept (unchanged)

2. pv keyword in WCS(naxis; ...)

The keyword constructor now accepts pv = [(axis, m, value), ...], mapped to the corresponding PVi_m header keywords. The same convention as WCS.jl's WCSTransform(naxis; pv = ...), closing a small migration gap:

WCS(2; ctype = ["RA---AIR", "DEC--AIR"], crval = [0.0, -90.0], pv = [(2, 1, 45.0)])

Housekeeping

  • [compat] FITSFiles = "0.2, 0.3" widened to "0.2, 0.3, 0.4" for the upcoming FITSFiles 0.4.0 also needed for the Reproject.jl port
  • Docstrings updated to match the new defaulting behavior.

@codecov

codecov Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.55%. Comparing base (6d33b92) to head (59adeaa).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #19      +/-   ##
==========================================
+ Coverage   86.46%   86.55%   +0.09%     
==========================================
  Files          18       18              
  Lines        3376     3385       +9     
==========================================
+ Hits         2919     2930      +11     
+ Misses        457      455       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cgarling

Copy link
Copy Markdown
Member

Thanks, I'm currently in the process of moving and starting a new job so I may not be able to review and merge this for a week or so. Let me know if that's a problem for you

@icweaver

Copy link
Copy Markdown
Member Author

Not at all, congrats again on your new position! Hope the travels go smoothly

@icweaver
icweaver marked this pull request as ready for review July 23, 2026 21:11
@cgarling

Copy link
Copy Markdown
Member

Thanks, this looks good

One minor thing I noticed is that wcslib also clears equinox to UNDEFINED when RADESYS is "ICRS" or "GAPPT", and sets default equinox values for FK4/FK5 when equinox is undefined. This PR handles the main case (RADESYS defaulting from EQUINOX) correctly; the reverse-direction defaulting could be a follow-up if needed.

@cgarling
cgarling merged commit 71fed9c into main Aug 11, 2026
11 checks passed
@cgarling
cgarling deleted the radesys-defaults branch August 11, 2026 18:55
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