Changeset 24973
- Timestamp:
- Aug 2, 2009, 4:27:26 PM (17 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 1 added
- 6 edited
-
Makefile (modified) (1 diff)
-
doc/notes.txt (modified) (1 diff)
-
include/addstar.h (modified) (2 diffs)
-
src/ConfigInit.c (modified) (1 diff)
-
src/GetZeroPointExposure.c (added)
-
src/LoadData.c (modified) (1 diff)
-
src/ReadImageHeader.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/Makefile
r21508 r24973 58 58 $(SRC)/greference.$(ARCH).o \ 59 59 $(SRC)/grefstars.$(ARCH).o \ 60 $(SRC)/GetZeroPointExposure.$(ARCH).o \ 60 61 $(SRC)/LoadStars.$(ARCH).o \ 61 62 $(SRC)/LoadHeaders.$(ARCH).o \ -
trunk/Ohana/src/addstar/doc/notes.txt
r21508 r24973 1 2 2009.08.02 3 4 ZERO POINTS: addstar currently has a couple of inconsistent ways that it 5 measures or uses image zero points: 6 7 * the standard zero point: data in the database is saved as M_inst + 8 25.0. This value is written to the image header and checked when 9 the image is loaded. This is completely archaic, but removing 10 this concept from the DVO system will require some work and some 11 care. This value is NOT reflected in the image->Mcal values 12 13 * on-the-fly calibration: addstar was used by CFHT skyprobe to 14 measure the sky transparency. This calculation was done by 15 measuring the zero point between the Tycho stars in the database 16 and the stars in the image. Star data is saved in 17 AddToCalibration as they are found (in find_matches, or 18 equivalent). At the end of the match processing, the zero point 19 for the image was calculated with FindCalibration and saved to the 20 image table but NOT the measure table. For skyprobe, the stars 21 are normally not saved to the database -- the Tycho stars are kept 22 in the measure & average tables, and used as the reference for the 23 zero point calculation above. 24 25 For Pan-STARRS, the zero point analysis is performed by psastro 26 before we run addstar. However, there are a few ways we could 27 choose to apply the zero point calculation: 28 29 * use the per-chip zero point reported in the individual chip 30 headers (easy, but fairly wrong) 31 32 * calculate the per-exposure zero point from the chip headers and 33 supply. 34 35 * calculate the per-exposure zero point from the MATCHED_REFS table 36 37 We also need to consider the zero point error. We currently have 38 only dM (poisson error) + dMcal (calibration error). We need to 39 divide dMsys into dMcal (photometry calibration error) and dMap 40 (aperture correction error). 41 42 * zero point options: 43 * NOMINAL : set Mcal = 0.0 44 * CHIP_HEADER : each chip has zero point in header 45 * PHU_HEADER : a single exposure-wide value in the header 46 * CHIP_AVERAGE : determine zero point for exposure from chip zero points 47 * MATCHED_REFS : recalculate from table 1 48 2 49 2009.02.11 -
trunk/Ohana/src/addstar/include/addstar.h
r24400 r24973 118 118 double FAKE_THETA; // boresite angle for fake images 119 119 120 char ZERO_POINT_OPTION[64]; 121 float ZERO_POINT_OFFSET; 122 120 123 // carries the mosaic into gstars 121 124 … … 187 190 HeaderSet *MatchHeaders PROTO((int **extsize, int *nimage, int mode, Header **headers, int Nheaders)); 188 191 int LoadData PROTO((FILE *f, char *file, Image **images, int *nvalid, Stars **stars, int *Nstars, Header **headers, int *extsize, HeaderSet *headerSets, int NheaderSets)); 192 int GetZeroPointExposure PROTO((Header **headers, HeaderSet *headerSets, int Nimages)); 189 193 190 194 int in_image PROTO((double r, double d, Image *image)); -
trunk/Ohana/src/addstar/src/ConfigInit.c
r21508 r24973 77 77 if (!ScanConfig (config, "EXTNAME-KEYWORD", "%s", 0, ExtnameKeyword)) { 78 78 strcpy (ExtnameKeyword, "EXTNAME"); 79 } 80 81 // if this config variable is not set, do not set any zero point offset 82 if (!ScanConfig (config, "ZERO_POINT_OPTION", "%s", 0, ZERO_POINT_OPTION)) { 83 strcpy (ZERO_POINT_OPTION, "NOMINAL"); 79 84 } 80 85 -
trunk/Ohana/src/addstar/src/LoadData.c
r21508 r24973 24 24 // find image rootname 25 25 name = filebasename (file); 26 27 // if zero points are calculated for the full exposure using more than just the matched chip header, 28 // we need to perform that analysis here 29 GetZeroPointExposure (headers, headerSets, Nimages); 26 30 27 31 // now run through the images, interpret the headers and read the stars -
trunk/Ohana/src/addstar/src/ReadImageHeader.c
r21508 r24973 8 8 double tmp, sec, Cerror, ZeroPt, FWHM_X, FWHM_Y; 9 9 char *c, photname[64], line[80]; 10 PhotCode *photcodeData; 10 11 11 12 // zero out the entire image structure … … 104 105 return (FALSE); 105 106 } 106 photcode = GetPhotcodeCodebyName (photname);107 if (photcode == 0) {107 photcodeData = GetPhotcodebyName (photname); 108 if (photcodeData == NULL) { 108 109 fprintf (stderr, "photcode %s not found in photcode table\n", photname); 109 110 return (FALSE); 110 111 } 112 photcode = photcodeData[0].code; 111 113 } 112 114 if (photcode == 0) { … … 191 193 } 192 194 195 // XXX this is archaic: we used to set a fixed zero point of 25 to shift data into the range 196 // 0 - 32 so it would fit in an unsigned int. This is also needed because some programs like 197 // sextractor will put in an arbitrary zero point that we need to understand to get back to 198 // instrumental mags. 193 199 gfits_scan (header, "ZERO_PT", "%lf", 1, &ZeroPt); 194 200 if (ZeroPt != GetZeroPoint()) { … … 197 203 } 198 204 205 // if it exists, find the 206 if (!strcasecmp(ZERO_POINT_OPTION, "CHIP_HEADER")) { 207 float ZPT_OBS; 208 if (!gfits_scan (header, "ZPT_OBS", "%f", 1, &ZPT_OBS)) { 209 fprintf (stderr, "zero point not supplied in header\n"); 210 ZERO_POINT_OFFSET = 0.0; 211 } else { 212 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZPT_OBS; 213 } 214 } 215 199 216 /* secz is in units milli-airmass */ 200 image[0].Mcal = 0.0;217 image[0].Mcal = ZERO_POINT_OFFSET; 201 218 image[0].Xm = NAN_S_SHORT; 202 219 image[0].flags = 0;
Note:
See TracChangeset
for help on using the changeset viewer.
