Changeset 9574 for trunk/psastro/src/psastroWCS.c
- Timestamp:
- Oct 13, 2006, 5:10:34 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psastro/src/psastroWCS.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psastro/src/psastroWCS.c
r9373 r9574 6 6 7 7 psProjectionType type; 8 bool status ;8 bool status, pcKeys, cdKeys; 9 9 float crval1, crval2, crpix1, crpix2, cdelt1, cdelt2; 10 10 float pc1_1, pc1_2, pc2_1, pc2_2; … … 29 29 } 30 30 31 // what type of WCS keywords are available? 32 psMetadataLookupF32 (&pcKeys, header, "PC001001"); 33 psMetadataLookupF32 (&cdKeys, header, "CD1_1"); 34 35 if (cdKeys && pcKeys) { 36 psLogMsg ("psastro", 2, "warning: both CDi_j and PC00i00j defined in headers, using CDi_j terms\n"); 37 } 38 if (!cdKeys && !pcKeys) { 39 psError(PS_ERR_UNKNOWN, true, "missing both CDi_j and PC00i00j WCS terms"); 40 // XXX we could default here to RA, DEC, ROTANGLE 41 return false; 42 } 43 31 44 crval1 = psMetadataLookupF32 (&status, header, "CRVAL1"); 32 45 crval2 = psMetadataLookupF32 (&status, header, "CRVAL2"); … … 35 48 36 49 // test the CDELTi varient 37 cdelt1 = psMetadataLookupF32 (&status, header, "CDELT1");38 if (status) { 50 if (pcKeys) { 51 cdelt1 = psMetadataLookupF32 (&status, header, "CDELT1"); 39 52 cdelt2 = psMetadataLookupF32 (&status, header, "CDELT2"); 40 53 … … 65 78 66 79 // test the CDi_j varient 67 pc1_1 = psMetadataLookupF32 (&status, header, "CD1_1");68 if (status) { 80 if (cdKeys) { 81 pc1_1 = psMetadataLookupF32 (&status, header, "CD1_1"); 69 82 pc1_2 = psMetadataLookupF32 (&status, header, "CD1_2"); 70 83 pc2_1 = psMetadataLookupF32 (&status, header, "CD2_1");
Note:
See TracChangeset
for help on using the changeset viewer.
