Index: trunk/psastro/src/psastroWCS.c
===================================================================
--- trunk/psastro/src/psastroWCS.c	(revision 9373)
+++ trunk/psastro/src/psastroWCS.c	(revision 9574)
@@ -6,5 +6,5 @@
 
     psProjectionType type;
-    bool status;
+    bool status, pcKeys, cdKeys;
     float crval1, crval2, crpix1, crpix2, cdelt1, cdelt2;
     float pc1_1, pc1_2, pc2_1, pc2_2;
@@ -29,4 +29,17 @@
     }
 
+    // what type of WCS keywords are available?
+    psMetadataLookupF32 (&pcKeys, header, "PC001001");
+    psMetadataLookupF32 (&cdKeys, header, "CD1_1");
+
+    if (cdKeys && pcKeys) {
+	psLogMsg ("psastro", 2, "warning: both CDi_j and PC00i00j defined in headers, using CDi_j terms\n");
+    }
+    if (!cdKeys && !pcKeys) {
+        psError(PS_ERR_UNKNOWN, true, "missing both CDi_j and PC00i00j WCS terms");
+	// XXX we could default here to RA, DEC, ROTANGLE
+	return false;
+    }
+
     crval1 = psMetadataLookupF32 (&status, header, "CRVAL1");
     crval2 = psMetadataLookupF32 (&status, header, "CRVAL2");
@@ -35,6 +48,6 @@
     
     // test the CDELTi varient
-    cdelt1 = psMetadataLookupF32 (&status, header, "CDELT1");
-    if (status) {
+    if (pcKeys) {
+	cdelt1 = psMetadataLookupF32 (&status, header, "CDELT1");
 	cdelt2 = psMetadataLookupF32 (&status, header, "CDELT2");
 
@@ -65,6 +78,6 @@
 
     // test the CDi_j varient
-    pc1_1 = psMetadataLookupF32 (&status, header, "CD1_1");
-    if (status) {
+    if (cdKeys) {
+	pc1_1 = psMetadataLookupF32 (&status, header, "CD1_1");
 	pc1_2 = psMetadataLookupF32 (&status, header, "CD1_2");
 	pc2_1 = psMetadataLookupF32 (&status, header, "CD2_1");
