Changeset 29132
- Timestamp:
- Sep 9, 2010, 10:14:08 AM (16 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 3 edited
-
include/addstar.h (modified) (1 diff)
-
src/GetZeroPointExposure.c (modified) (8 diffs)
-
src/ReadImageHeader.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/include/addstar.h
r28965 r29132 121 121 char ZERO_POINT_OPTION[64]; 122 122 float ZERO_POINT_OFFSET; 123 float ZERO_POINT_ERROR; 124 float ZPT_OBS_PHU; 125 float ZPT_ERR_PHU; 123 126 124 127 // carries the mosaic into gstars -
trunk/Ohana/src/addstar/src/GetZeroPointExposure.c
r27435 r29132 17 17 18 18 // PHU_HEADER: in this case, the zero point measured for the entire exposure and reported in 19 // the PHU header is used to set the zero point offset for each chip. Note that in this case, 20 // ZERO_POINT_OFFSET in this funciton is actually set to the zero point, and adjusted to an 21 // offset in ReadImageHeader based on the per-chip zero points in the photcode database 19 // the PHU header is used to set the zero point offset for each chip. 20 // Here set ZPT_OBS_PHU and ZPT_ERR_PHU to the observed values from the header. 21 // ZERO_POINT_OFFSET is calculated in ReadImageHeader based on the per-chip zero points in the 22 // photcode database. 22 23 23 24 int GetZeroPointExposure (Header **headers, HeaderSet *headerSets, off_t Nimages) { … … 26 27 if (!strcasecmp(ZERO_POINT_OPTION, "NOMINAL")) { 27 28 ZERO_POINT_OFFSET = 0.0; 29 ZERO_POINT_ERROR = NAN; 28 30 return (TRUE); 29 31 } … … 32 34 if (!strcasecmp(ZERO_POINT_OPTION, "CHIP_HEADER")) { 33 35 ZERO_POINT_OFFSET = 0.0; 36 ZERO_POINT_ERROR = NAN; 34 37 return (TRUE); 35 38 } … … 39 42 40 43 int i, Nzpt, Nmid, Nhead; 41 float *zpt, ZPT_OBS ;44 float *zpt, ZPT_OBS, ZPT_ERR; 42 45 PhotCode *photcode; 43 46 char photname[80]; … … 53 56 fprintf (stderr, "zero point not supplied in header\n"); 54 57 continue; 58 } 59 60 if (!gfits_scan (headers[Nhead], "ZPT_ERR", "%f", 1, &ZPT_ERR)) { 61 // XXX should we emit this message? We currently aren't using this value so no 62 // fprintf (stderr, "zero point not supplied in header\n"); 63 // continue; 64 ZPT_ERR = NAN; 55 65 } 56 66 … … 78 88 fprintf (stderr, "WARNING: zero point is not measured, no valid entries in headers\n"); 79 89 ZERO_POINT_OFFSET = 0.0; 90 ZERO_POINT_ERROR = NAN; 80 91 free (zpt); 81 92 return (FALSE); … … 86 97 ZERO_POINT_OFFSET = (Nzpt % 2) ? zpt[Nmid] : 0.5*(zpt[Nmid] + zpt[Nmid-1]); 87 98 free (zpt); 99 // XXX: TODO calculate someting for ZERO_POINT_ERROR 100 ZERO_POINT_ERROR = NAN; 88 101 return (TRUE); 89 102 } … … 92 105 if (!strcasecmp(ZERO_POINT_OPTION, "PHU_HEADER")) { 93 106 int i, Nhead; 94 float ZPT_OBS;95 107 96 108 ZERO_POINT_OFFSET = 0.0; 109 ZERO_POINT_ERROR = NAN; 97 110 for (i = 0; i < Nimages; i++) { 98 111 if (strcmp(headerSets[i].exthead, "PHU")) continue; 99 112 Nhead = headerSets[i].extnum_head; 100 113 114 float ZPT_OBS, ZPT_ERR; 101 115 if (!gfits_scan (headers[Nhead], "ZPT_OBS", "%f", 1, &ZPT_OBS)) { 102 116 fprintf (stderr, "WARNING: zero point is not measured, no valid entries in headers\n"); 103 117 return (FALSE); 104 118 } 105 ZERO_POINT_OFFSET = ZPT_OBS; 119 if (!gfits_scan (headers[Nhead], "ZPT_ERR", "%f", 1, &ZPT_ERR)) { 120 fprintf (stderr, "WARNING: zero point error is not measured\n"); 121 // XXX: Do we want to require ZPT_ERR? for now just set it to zero and proceed. 122 // return (FALSE); 123 ZPT_ERR = NAN; 124 } 125 ZPT_OBS_PHU = ZPT_OBS; 126 ZPT_ERR_PHU = ZPT_ERR; 106 127 return (TRUE); 107 128 } -
trunk/Ohana/src/addstar/src/ReadImageHeader.c
r28214 r29132 220 220 fprintf (stderr, "zero point not supplied in header\n"); 221 221 ZERO_POINT_OFFSET = 0.0; 222 ZERO_POINT_ERROR = NAN; 222 223 } else { 223 224 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZPT_OBS; 225 float ZPT_ERR; 226 if (!gfits_scan (header, "ZPT_ERR", "%f", 1, &ZPT_ERR)) { 227 // XXX: do we want to print this message? 228 fprintf (stderr, "zero point error not supplied in header\n"); 229 ZPT_ERR = NAN; 230 } 231 ZERO_POINT_ERROR = ZPT_ERR; 224 232 } 225 233 } … … 230 238 fprintf (stderr, "photcode data not supplied for this chip\n"); 231 239 ZERO_POINT_OFFSET = 0.0; 240 ZERO_POINT_ERROR = NAN; 232 241 } else { 233 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZERO_POINT_OFFSET; 242 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZPT_OBS_PHU; 243 ZERO_POINT_ERROR = ZPT_ERR_PHU; 234 244 } 235 245 } … … 237 247 /* secz is in units milli-airmass */ 238 248 image[0].Mcal = ZERO_POINT_OFFSET; 249 image[0].dMcal = ZERO_POINT_ERROR; 239 250 image[0].Xm = NAN_S_SHORT; 240 251 image[0].flags = 0;
Note:
See TracChangeset
for help on using the changeset viewer.
