[fitswcs] [EXTERNAL] [fitsbits] Question about distortions when multiple coordinate systems are applied {External} {External}

Thompson, William T. (GSFC-671.0)[ADNET SYSTEMS INC] william.t.thompson at nasa.gov
Mon Jul 13 14:32:04 EDT 2026


Mark:

Thank you for your's and everybody else’s responses.  I’ve been looking into this more closely, and I believe that the report about AstroPy’s behavior is probably not true.  It turns out that the report was second hand, and my suspicion is that the people who were originally claiming this are probably doing something nonstandard to make that happen.  I found indications of this in their IDL software, and have informed the PI of that mission of the problem.

Bill

--
[cid:image001.jpg at 01DB8225.EA78D5B0]

William Thompson
Senior Scientist
ADNET SYSTEMS, Inc.
NASA Goddard Space Flight Center, Code 671
Greenbelt, MD 20771
o: 301.286.2040
William.T.Thompson at nasa.gov<mailto:William.T.Thompson at nasa.gov>
From: Mark Calabretta <mark at calabretta.id.au>
Date: Wednesday, July 8, 2026 at 11:50 PM
To: FITSbits <fitsbits at nrao.edu>
Cc: FITSWCS <fitswcs at nrao.edu>; Thompson, William T. (GSFC-671.0)[ADNET SYSTEMS INC] <william.t.thompson at nasa.gov>
Subject: [EXTERNAL] [fitsbits] Question about distortions when multiple coordinate systems are applied {External}

[You don't often get email from mark at calabretta.id.au. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

CAUTION: This email originated from outside of NASA.  Please take care when clicking links or opening attachments.  Use the "Report Message" button to report suspicious messages to the NASA SOC.




Hi Bill,

> I’ve been told that astropy will automatically apply distortions
> encoded in DPj keywords when there are no DPja keywords for
> alternative coordinate system “a”.

If true, it is not correct behaviour according to the following
statement from WCS Paper I, Sect. 2.5:

  If an alternate coordinate description is specified, all coordinate
  keywords for that version must be given even if they do not differ
  from those of the primary version.

However, astropy uses WCSLIB, which does not leak keyvalues between
alternate coordinate descriptions.  As astropy would have to add it
natively you'd need to confirm it with one of the astropy coders.

The WCSLIB bintable header parser, wcsbth(), optionally implements an
inheritance mechanism (non-standard) between primary and bintable
WCS keywords.  I wonder if someone has confused it with that.

The legacy distortion functions, TPV, TPU, SIP, DSS, TNX, and ZPX, can
be translated into the Paper IV formalism in a form recognised by
WCSLIB, including alternate coordinate descriptions.  Whether given in
that form or not, WCSLIB translates them all to TPD on input, as
explained in the WCSLIB manual:

  https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.atnf.csiro.au%2Fcomputing%2Fsoftware%2Fwcs%2Fwcslib%2Fdis_8h.html&data=05%7C02%7Cwilliam.t.thompson%40nasa.gov%7Cee7189f0430c4903ce2e08dedd6d3f60%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C639191658461304094%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=vyudwX2Q56XF7TVa1JyW4SIuaB9liClPo4wJ%2Fa0wxHg%3D&reserved=0<https://www.atnf.csiro.au/computing/software/wcs/wcslib/dis_8h.html>

noting, in particular, the paragraph on historical idiosyncrasies.

Regards,
Mark Calabretta



On Tue, 7 Jul 2026 19:43:25 +0000
"Thompson, William T. \(GSFC-671.0\)\[ADNET SYSTEMS INC\] via fitsbits"
<fitsbits at listmgr.nrao.edu> wrote:

Folks:

I’ve been presented with a question about the use of distortion
parameters when a FITS header contains multiple coordinate systems.
Earlier I had asked about this issue when using the Simple Image
Polynomial convention, but now I’m asking about distortions as
described in the Calabretta et al. 2004 paper.

Specifically I’m asking about prior (DP) distortions, since subsequent
(DQ) distortions are a different case entirely.  I’ve been told that
astropy will automatically apply distortions encoded in DPj keywords
when there are no DPja keywords for alternative coordinate system “a”.
I’ve looked through the Calabretta et al. 2004 paper, and cannot find
anything that says that this substitution should be made.  Is this a
convention that is widely adopted?

To me, it does make sense that any prior distortion parameters
applicable to one coordinate system would be equally applicable to any
alternate coordinate system.  The same is not necessarily true for
subsequent distortion parameters, given the possibly different effects
from the CRPIXja and CDi_ja values between the systems.

I’d appreciate any clarity that can be applied to this situation.  If
that convention is widely used, then I should adopt it too.

Thank you,

Bill Thompson

--
[cid:image001.jpg at 01DB8225.EA78D5B0]

William Thompson
Senior Scientist
ADNET SYSTEMS, Inc.
NASA Goddard Space Flight Center, Code 671
Greenbelt, MD 20771
o: 301.286.2040
William.T.Thompson at nasa.gov<mailto:William.T.Thompson at nasa.gov>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listmgr.nrao.edu/pipermail/fitswcs/attachments/20260713/c01db52f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 5952 bytes
Desc: image001.jpg
URL: <http://listmgr.nrao.edu/pipermail/fitswcs/attachments/20260713/c01db52f/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 276 bytes
Desc: image002.png
URL: <http://listmgr.nrao.edu/pipermail/fitswcs/attachments/20260713/c01db52f/attachment-0001.png>


More information about the fitswcs mailing list