<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Mark:</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
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.</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Bill</div>
<div style="direction: ltr; font-family: Aptos, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="ms-outlook-mobile-signature">
<div class="MsoNormal">-- </div>
<table class="MsoNormalTable" cellspacing="0" cellpadding="0" border="0" style="width: 461.25pt; box-sizing: border-box; border-collapse: collapse; border-spacing: 0px;">
<tbody>
<tr>
<td class="MsoNormalTable" style="padding: 2.15pt 1.45pt; width: 103.5pt; height: 93.2pt;">
<div class="MsoNormal" style="direction: ltr; text-align: center; color: black;">
<img src="cid:image001.jpg@01DB8225.EA78D5B0" id="Picture_x0020_1" width="132" height="31" style="width: 1.3854in; height: 0.3333in;"></div>
</td>
<td class="MsoNormalTable" style="padding: 2.15pt 1.45pt; vertical-align: bottom; width: 24.65pt; height: 93.2pt;">
<div class="MsoNormal" style="direction: ltr; text-align: center; line-height: 115%;">
<img src="cid:image002.png@01DB8225.EA78D5B0" id="Straight_x0020_Connector_x0020_2" width="0" height="144" style="width: 0.0104in; height: 1.5104in;"></div>
</td>
<td class="MsoNormalTable" style="padding: 2.15pt 1.45pt; width: 333.25pt; height: 93.2pt;">
<div class="MsoNormal" style="line-height: 115%; font-family: Helvetica; color: black;">
<b>William Thompson</b></div>
<div class="MsoNormal" style="line-height: 115%; font-family: Helvetica; font-size: 9pt; color: black;">
<span style="line-height: 115%;"><b>Senior Scientist</b></span></div>
<div class="MsoNormal" style="line-height: 115%; font-family: Helvetica; font-size: 9pt; color: black;">
<span style="line-height: 115%;">ADNET SYSTEMS, Inc.</span></div>
<div class="MsoNormal" style="line-height: 115%; font-family: Helvetica; font-size: 9pt; color: black;">
<span style="line-height: 115%;">NASA Goddard Space Flight Center, Code 671</span></div>
<div class="MsoNormal" style="line-height: 115%; font-family: Helvetica; font-size: 9pt; color: black;">
<span style="line-height: 115%;">Greenbelt, MD 20771</span></div>
<div class="MsoNormal" style="line-height: 115%; font-family: Helvetica; font-size: 9pt; color: black;">
<span style="line-height: 115%;">o: 301.286.2040</span></div>
<div class="MsoNormal" style="font-family: Helvetica; font-size: 9pt;"><a href="mailto:William.T.Thompson@nasa.gov" data-outlook-id="60a105b2-da70-416f-9079-296a1608ea5b">William.T.Thompson@nasa.gov</a></div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="mail-editor-reference-message-container">
<div class="ms-outlook-mobile-reference-message skipProofing">
<meta name="Generator" content="Microsoft Exchange Server">
</div>
<div style="padding: 3pt 0in 0in; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) currentcolor currentcolor;">
<div class="ms-outlook-mobile-reference-message skipProofing" style="text-align: left; font-family: Aptos; font-size: 12pt; color: black;">
<b>From: </b>Mark Calabretta <mark@calabretta.id.au><br>
<b>Date: </b>Wednesday, July 8, 2026 at 11:50 PM<br>
<b>To: </b>FITSbits <fitsbits@nrao.edu><br>
<b>Cc: </b>FITSWCS <fitswcs@nrao.edu>; Thompson, William T. (GSFC-671.0)[ADNET SYSTEMS INC] <william.t.thompson@nasa.gov><br>
<b>Subject: </b>[EXTERNAL] [fitsbits] Question about distortions when multiple coordinate systems are applied {External}<br>
<br>
</div>
</div>
<div class="PlainText" style="font-size: 11pt;">[You don't often get email from mark@calabretta.id.au. Learn why this is important at
<a href="https://aka.ms/LearnAboutSenderIdentification" data-outlook-id="053b0b74-82b9-4d7e-a454-e4637e35c05c">
https://aka.ms/LearnAboutSenderIdentification</a> ]<br>
<br>
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.<br>
<br>
<br>
<br>
<br>
Hi Bill,<br>
<br>
> I’ve been told that astropy will automatically apply distortions<br>
> encoded in DPj keywords when there are no DPja keywords for<br>
> alternative coordinate system “a”.<br>
<br>
If true, it is not correct behaviour according to the following<br>
statement from WCS Paper I, Sect. 2.5:<br>
<br>
  If an alternate coordinate description is specified, all coordinate<br>
  keywords for that version must be given even if they do not differ<br>
  from those of the primary version.<br>
<br>
However, astropy uses WCSLIB, which does not leak keyvalues between<br>
alternate coordinate descriptions.  As astropy would have to add it<br>
natively you'd need to confirm it with one of the astropy coders.<br>
<br>
The WCSLIB bintable header parser, wcsbth(), optionally implements an<br>
inheritance mechanism (non-standard) between primary and bintable<br>
WCS keywords.  I wonder if someone has confused it with that.<br>
<br>
The legacy distortion functions, TPV, TPU, SIP, DSS, TNX, and ZPX, can<br>
be translated into the Paper IV formalism in a form recognised by<br>
WCSLIB, including alternate coordinate descriptions.  Whether given in<br>
that form or not, WCSLIB translates them all to TPD on input, as<br>
explained in the WCSLIB manual:<br>
<br>
  <a href="https://www.atnf.csiro.au/computing/software/wcs/wcslib/dis_8h.html" data-outlook-id="5fa72d4d-b6b3-4d9c-954b-5d54e0993d26"><font color="red"><b>MailScanner has detected a possible fraud attempt from "www.atnf.csiro.au" claiming to be</b></font> 
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</a><br>
<br>
noting, in particular, the paragraph on historical idiosyncrasies.<br>
<br>
Regards,<br>
Mark Calabretta<br>
<br>
<br>
<br>
On Tue, 7 Jul 2026 19:43:25 +0000<br>
"Thompson, William T. \(GSFC-671.0\)\[ADNET SYSTEMS INC\] via fitsbits"<br>
<fitsbits@listmgr.nrao.edu> wrote:<br>
<br>
Folks:<br>
<br>
I’ve been presented with a question about the use of distortion<br>
parameters when a FITS header contains multiple coordinate systems.<br>
Earlier I had asked about this issue when using the Simple Image<br>
Polynomial convention, but now I’m asking about distortions as<br>
described in the Calabretta et al. 2004 paper.<br>
<br>
Specifically I’m asking about prior (DP) distortions, since subsequent<br>
(DQ) distortions are a different case entirely.  I’ve been told that<br>
astropy will automatically apply distortions encoded in DPj keywords<br>
when there are no DPja keywords for alternative coordinate system “a”.<br>
I’ve looked through the Calabretta et al. 2004 paper, and cannot find<br>
anything that says that this substitution should be made.  Is this a<br>
convention that is widely adopted?<br>
<br>
To me, it does make sense that any prior distortion parameters<br>
applicable to one coordinate system would be equally applicable to any<br>
alternate coordinate system.  The same is not necessarily true for<br>
subsequent distortion parameters, given the possibly different effects<br>
from the CRPIXja and CDi_ja values between the systems.<br>
<br>
I’d appreciate any clarity that can be applied to this situation.  If<br>
that convention is widely used, then I should adopt it too.<br>
<br>
Thank you,<br>
<br>
Bill Thompson<br>
<br>
--<br>
[cid:image001.jpg@01DB8225.EA78D5B0]<br>
<br>
William Thompson<br>
Senior Scientist<br>
ADNET SYSTEMS, Inc.<br>
NASA Goddard Space Flight Center, Code 671<br>
Greenbelt, MD 20771<br>
o: 301.286.2040<br>
William.T.Thompson@nasa.gov<mailto:William.T.Thompson@nasa.gov><br>
</div>
</div>
</body>
</html>