[AstroPy] WCS exception due to header keyword PLATEID

Demitri Muna demitri.muna at gmail.com
Thu Jan 21 10:35:49 EST 2016

Hi James,

On Jan 21, 2016, at 12:13 AM, James Allen <j.allen at physics.usyd.edu.au> wrote:

> I'm having a problem with WCS() raising an exception for what looks to me like a perfectly valid FITS header. The issue appears to be that the header includes a PLATEID, which in this case is completely unrelated to the coordinates. When I delete that card from the header, WCS() works fine.

I looked for “plateid” in the Astropy sources. It does look like the keyword is interfering. I’ll leave it to you to poke around these hits further:

% grep -ri plateid *
cextern/wcslib/C/flexed/wcspih.c:18348:	  keyname = "PLATEID";
cextern/wcslib/C/flexed/wcspih.c:20945:    sprintf(wcsp->wcsname, "DSS PLATEID %.4s", (char *)(dsstmp+13));
cextern/wcslib/C/wcspih.l:1020:^PLATEID" " {
cextern/wcslib/C/wcspih.l:1028:	  keyname = "PLATEID";
cextern/wcslib/C/wcspih.l:2290:    sprintf(wcsp->wcsname, "DSS PLATEID %.4s", (char *)(dsstmp+13));

This is in wcspih.l:

	  /* DSS: plate identification. */
	  valtype = STRING;
	  distype = SEQUENT;
	  vptr    = dsstmp+13;
	  dssflag = 2;
	  distran = DSS;
	  keyname = "PLATEID";

I’d consider this a bug - as the plate designer for SDSS, I don’t think it’s reasonable to assume that any field that begins with “PLATEID” indicates a DSS plate. It’s likely that deleting that specific keyword is your best workaround for the time being (not selecting the first N rows as you note). Someone else can suggest how best to propagate this issue.

You know what the FITS format needs? The concept of a namespace.


Demitri Muna

Department of Astronomy
Il Ohio State University

My Projects:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20160121/d6ab31cd/attachment.html>

More information about the AstroPy mailing list