Changeset 27369
- Timestamp:
- Mar 19, 2010, 5:52:50 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/addstar/src/ReadImageHeader.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/src/ReadImageHeader.c
r26370 r27369 85 85 } 86 86 87 { 87 { 88 88 double R, D; 89 89 /* sanity check on the image coordinates */ … … 94 94 } 95 95 } 96 96 97 97 /* CERROR in data file is in arcsec */ 98 98 if (!gfits_scan (header, "CERROR", "%lf", 1, &tmp)) tmp = 1.0; 99 99 image[0].cerror = tmp * 50.0; 100 100 101 101 /* get photcode from header */ 102 102 if (photcode == 0) { … … 112 112 photcode = photcodeData[0].code; 113 113 } 114 if (photcode == 0) { 114 if (photcode == 0) { 115 115 fprintf (stderr, "no valid photcode is supplied\n"); 116 116 return (FALSE); … … 122 122 gfits_scan (header, ExptimeKeyword, "%lf", 1, &tmp); 123 123 image[0].exptime = tmp; 124 124 125 125 /*** why are we no longer using APMIFIT?? ***/ 126 126 tmp = 0; … … 172 172 if (gfits_scan (header, AirmassKeyword, "%lf", 1, &tmp)) { 173 173 image[0].secz = tmp; 174 } 174 } 175 175 176 176 if (!gfits_scan (header, CCDNumKeyword, "%s", 1, ccdnum)) { … … 184 184 // get rid of any leading non-digit characters 185 185 while (*p && !isdigit(*p)) p++; 186 if (*p == 0) {187 fprintf (stderr, "invalid ccdnum %s\n", ccdnum);188 return FALSE;189 }190 image[0].ccdnum = atoi(p);186 if (*p) { 187 image[0].ccdnum = atoi(p); 188 } else { 189 image[0].ccdnum = 0; 190 } 191 191 } 192 192 … … 198 198 } else { 199 199 if (sourceID > 0xffff) { 200 fprintf (stderr, "image source ID is surprisingly large: %d, skipping\n", sourceID); 200 fprintf (stderr, "image source ID is surprisingly large: %d, skipping\n", sourceID); 201 201 return (FALSE); 202 202 } … … 207 207 // 0 - 32 so it would fit in an unsigned int. This is also needed because some programs like 208 208 // sextractor will put in an arbitrary zero point that we need to understand to get back to 209 // instrumental mags. 209 // instrumental mags. 210 210 gfits_scan (header, "ZERO_PT", "%lf", 1, &ZeroPt); 211 211 if (ZeroPt != GetZeroPoint()) { 212 fprintf (stderr, "WARNING: inconsistent zero point values: image: %f, config: %f\n", ZeroPt, GetZeroPoint()); 212 fprintf (stderr, "WARNING: inconsistent zero point values: image: %f, config: %f\n", ZeroPt, GetZeroPoint()); 213 213 } 214 214 … … 217 217 float ZPT_OBS; 218 218 if (!photcodeData || !gfits_scan (header, "ZPT_OBS", "%f", 1, &ZPT_OBS)) { 219 fprintf (stderr, "zero point not supplied in header\n");220 ZERO_POINT_OFFSET = 0.0;219 fprintf (stderr, "zero point not supplied in header\n"); 220 ZERO_POINT_OFFSET = 0.0; 221 221 } else { 222 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZPT_OBS;223 } 222 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZPT_OBS; 223 } 224 224 } 225 225 … … 227 227 if (!strcasecmp(ZERO_POINT_OPTION, "PHU_HEADER")) { 228 228 if (!photcodeData) { 229 fprintf (stderr, "photcode data not supplied for this chip\n");230 ZERO_POINT_OFFSET = 0.0;229 fprintf (stderr, "photcode data not supplied for this chip\n"); 230 ZERO_POINT_OFFSET = 0.0; 231 231 } else { 232 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZERO_POINT_OFFSET;233 } 232 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZERO_POINT_OFFSET; 233 } 234 234 } 235 235
Note:
See TracChangeset
for help on using the changeset viewer.
