Changeset 27430
- Timestamp:
- Mar 24, 2010, 8:56:59 AM (16 years ago)
- Location:
- branches/eam_branches/largefiles.20100314/Ohana
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
src/addstar/include/addstar.h (modified) (1 diff)
-
src/addstar/src/ReadImageHeader.c (modified) (9 diffs)
-
src/addstar/src/ReadStarsSDSS.c (modified) (1 diff)
-
src/addstar/src/args.c (modified) (1 diff)
-
src/addstar/src/find_matches.c (modified) (6 diffs)
-
src/addstar/src/find_matches_closest.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/largefiles.20100314/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/20091201/Ohana merged eligible /trunk/Ohana merged eligible
-
Property svn:mergeinfo
set to
-
branches/eam_branches/largefiles.20100314/Ohana/src/addstar/include/addstar.h
r27368 r27430 145 145 char *SELECT_2MASS_QUALITY; // used only by get2mass_as 146 146 int NREFSTAR_GROUP; 147 int NSTAR_GROUP; 147 148 148 149 /*** addstar prototypes ***/ -
branches/eam_branches/largefiles.20100314/Ohana/src/addstar/src/ReadImageHeader.c
r27338 r27430 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)) { … … 199 199 } else { 200 200 if (sourceID > 0xffff) { 201 fprintf (stderr, "image source ID is surprisingly large: %d, skipping\n", sourceID); 201 fprintf (stderr, "image source ID is surprisingly large: %d, skipping\n", sourceID); 202 202 return (FALSE); 203 203 } … … 208 208 // 0 - 32 so it would fit in an unsigned int. This is also needed because some programs like 209 209 // sextractor will put in an arbitrary zero point that we need to understand to get back to 210 // instrumental mags. 210 // instrumental mags. 211 211 gfits_scan (header, "ZERO_PT", "%lf", 1, &ZeroPt); 212 212 if (ZeroPt != GetZeroPoint()) { 213 fprintf (stderr, "WARNING: inconsistent zero point values: image: %f, config: %f\n", ZeroPt, GetZeroPoint()); 213 fprintf (stderr, "WARNING: inconsistent zero point values: image: %f, config: %f\n", ZeroPt, GetZeroPoint()); 214 214 } 215 215 … … 218 218 float ZPT_OBS; 219 219 if (!photcodeData || !gfits_scan (header, "ZPT_OBS", "%f", 1, &ZPT_OBS)) { 220 fprintf (stderr, "zero point not supplied in header\n");221 ZERO_POINT_OFFSET = 0.0;220 fprintf (stderr, "zero point not supplied in header\n"); 221 ZERO_POINT_OFFSET = 0.0; 222 222 } else { 223 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZPT_OBS;224 } 223 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZPT_OBS; 224 } 225 225 } 226 226 … … 228 228 if (!strcasecmp(ZERO_POINT_OPTION, "PHU_HEADER")) { 229 229 if (!photcodeData) { 230 fprintf (stderr, "photcode data not supplied for this chip\n");231 ZERO_POINT_OFFSET = 0.0;230 fprintf (stderr, "photcode data not supplied for this chip\n"); 231 ZERO_POINT_OFFSET = 0.0; 232 232 } else { 233 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZERO_POINT_OFFSET;234 } 233 ZERO_POINT_OFFSET = 0.001*photcodeData[0].C - ZERO_POINT_OFFSET; 234 } 235 235 } 236 236 -
branches/eam_branches/largefiles.20100314/Ohana/src/addstar/src/ReadStarsSDSS.c
r27296 r27430 259 259 } 260 260 261 NSTAR_GROUP = NFILTER; 261 262 *nimages += NFILTER; 262 263 *nstars = Nstars*NFILTER; -
branches/eam_branches/largefiles.20100314/Ohana/src/addstar/src/args.c
r24975 r27430 9 9 // a global used by find_matches_refstars.c (value is 1 except for load2mass) 10 10 NREFSTAR_GROUP = 1; 11 // a global used by find_matches_closest.c (value is 1 except for loadsdss) 12 NSTAR_GROUP = 1; 11 13 12 14 /* check for help request */ -
branches/eam_branches/largefiles.20100314/Ohana/src/addstar/src/find_matches.c
r27295 r27430 12 12 unsigned int objID, catID; 13 13 Coords tcoords; 14 15 if (NSTAR_GROUP <= 0) { 16 fprintf (stderr, "ERROR: NSTAR_GROUP NOT SET!\n"); 17 exit (1); 18 } 14 19 15 20 /* photcode data - must by of type DEP; options.photcode is equiv photcode for all input … … 103 108 104 109 /** find matched stars **/ 110 // XXX could use NSTAR_GROUP to do this match more quicky if NSTAR_GROUP > 1 105 111 for (i = j = 0; (i < Nstars) && (j < Nave); ) { 106 112 if (!finite(X1[i]) || !finite(Y1[i])) { … … 141 147 NMEAS = Nmeas + 1000; 142 148 REALLOCATE (next_meas, off_t, NMEAS); 149 143 150 REALLOCATE (catalog[0].measure, Measure, NMEAS); 144 151 } … … 227 234 /* incorporate unmatched image stars, if this star is in field of this catalog */ 228 235 /* these new entries are all written out in UPDATE mode */ 229 for (i = 0; (i < Nstars) && !options.only_match; i ++) {236 for (i = 0; (i < Nstars) && !options.only_match; i += NSTAR_GROUP) { 230 237 /* make sure there is space for next entry */ 231 if (Nmeas >= NMEAS ) {238 if (Nmeas >= NMEAS - NSTAR_GROUP) { 232 239 NMEAS = Nmeas + 1000; 233 240 REALLOCATE (next_meas, off_t, NMEAS); … … 249 256 catalog[0].average[Nave].dD = 0; 250 257 251 catalog[0].average[Nave].Nmeasure = 1;258 catalog[0].average[Nave].Nmeasure = NSTAR_GROUP; 252 259 catalog[0].average[Nave].Nmissing = 0; 253 260 catalog[0].average[Nave].Nextend = 0; … … 290 297 } 291 298 292 // supply the measurments from this detection 293 catalog[0].measure[Nmeas] = stars[N].measure; 294 295 // the following measure elements cannot be set until here: 296 catalog[0].measure[Nmeas].dR = 0.0; 297 catalog[0].measure[Nmeas].dD = 0.0; 298 catalog[0].measure[Nmeas].dbFlags = 0; 299 catalog[0].measure[Nmeas].averef = Nave; // XXX EAM : must be absolute Nave if partial read 300 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 301 catalog[0].measure[Nmeas].catID = catalog[0].catID; 302 303 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ 304 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 305 if (Nsec > -1) { 306 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]); 307 } 308 309 /* next[Nmeas] should always be -1 in this context (it is always the only 310 measurement for the star) */ 311 stars[N].found = Nmeas; 312 next_meas[Nmeas] = -1; 313 Nmeas ++; 299 for (j = 0; j < NSTAR_GROUP; j++) { 300 // supply the measurments from this detection 301 catalog[0].measure[Nmeas] = stars[N].measure; 302 N = N1[i + j]; 303 304 // the following measure elements cannot be set until here: 305 catalog[0].measure[Nmeas].dR = 0.0; 306 catalog[0].measure[Nmeas].dD = 0.0; 307 catalog[0].measure[Nmeas].dbFlags = 0; 308 catalog[0].measure[Nmeas].averef = Nave; // XXX EAM : must be absolute Nave if partial read 309 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 310 catalog[0].measure[Nmeas].catID = catalog[0].catID; 311 312 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ 313 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 314 if (Nsec > -1) { 315 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]); 316 } 317 318 /* next[Nmeas] should always be -1 in this context (it is always the only 319 measurement for the star) */ 320 stars[N].found = Nmeas; 321 next_meas[Nmeas] = -1; // initial value here update below 322 Nmeas ++; 323 } 324 for (j = 0; j < NSTAR_GROUP - 1; j++) { 325 next_meas[Nmeas - NSTAR_GROUP + j] = Nmeas - NSTAR_GROUP + j + 1; 326 } 314 327 Nave ++; 315 328 } -
branches/eam_branches/largefiles.20100314/Ohana/src/addstar/src/find_matches_closest.c
r27382 r27430 13 13 Coords tcoords; 14 14 15 if (NSTAR_GROUP <= 0) { 16 fprintf (stderr, "ERROR: NSTAR_GROUP NOT SET!\n"); 17 exit (1); 18 } 19 15 20 /* photcode data - must by of type DEP; options.photcode is equiv photcode for all input 16 21 images this function requires incoming stars to have the same photcode.equiv value. if … … 104 109 105 110 /** find matched stars **/ 111 // XXX could use NSTAR_GROUP to do this match more quicky if NSTAR_GROUP > 1 106 112 for (i = j = 0; (i < Nstars) && (j < Nave); ) { 107 113 if (!finite(X1[i]) || !finite(Y1[i])) { … … 223 229 /** incorporate unmatched image stars, if this star is in field of this catalog **/ 224 230 /* these new entries are all written out in UPDATE mode */ 225 for (i = 0; (i < Nstars) && !options.only_match; i ++) {231 for (i = 0; (i < Nstars) && !options.only_match; i += NSTAR_GROUP) { 226 232 /* make sure there is space for next entry */ 227 if (Nmeas >= NMEAS ) {233 if (Nmeas >= NMEAS - NSTAR_GROUP) { 228 234 NMEAS = Nmeas + 1000; 229 235 REALLOCATE (next_meas, off_t, NMEAS); … … 245 251 catalog[0].average[Nave].dD = 0; 246 252 247 catalog[0].average[Nave].Nmeasure = 1;253 catalog[0].average[Nave].Nmeasure = NSTAR_GROUP; 248 254 catalog[0].average[Nave].Nmissing = 0; 249 255 catalog[0].average[Nave].Nextend = 0; … … 285 291 } 286 292 287 // supply the measurments from this detection 288 catalog[0].measure[Nmeas] = stars[N].measure; 289 290 // the following measure elements cannot be set until here: 291 catalog[0].measure[Nmeas].dR = 0.0; // astrometric offset, not error 292 catalog[0].measure[Nmeas].dD = 0.0; // astrometric offset, not error 293 catalog[0].measure[Nmeas].dbFlags = 0; 294 catalog[0].measure[Nmeas].averef = Nave; 295 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 296 catalog[0].measure[Nmeas].catID = catalog[0].catID; 297 298 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ 299 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 300 if (Nsec > -1) { 301 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]); 302 } 303 304 /* next[Nmeas] should always be -1 in this context (it is always the only 305 measurement for the star) */ 306 stars[N].found = Nmeas; 307 next_meas[Nmeas] = -1; 308 Nmeas ++; 293 for (j = 0; j < NSTAR_GROUP; j++) { 294 // supply the measurments from this detection 295 catalog[0].measure[Nmeas] = stars[N].measure; 296 N = N1[i + j]; 297 298 // the following measure elements cannot be set until here: 299 catalog[0].measure[Nmeas].dR = 0.0; // astrometric offset, not error 300 catalog[0].measure[Nmeas].dD = 0.0; // astrometric offset, not error 301 catalog[0].measure[Nmeas].dbFlags = 0; 302 catalog[0].measure[Nmeas].averef = Nave; 303 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 304 catalog[0].measure[Nmeas].catID = catalog[0].catID; 305 306 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ 307 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 308 if (Nsec > -1) { 309 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]); 310 } 311 312 /* next[Nmeas] should always be -1 in this context (it is always the only 313 measurement for the star) */ 314 stars[N].found = Nmeas; 315 next_meas[Nmeas] = -1; // inital value here update below 316 Nmeas ++; 317 } 318 for (j = 0; j < NSTAR_GROUP - 1; j++) { 319 next_meas[Nmeas - NSTAR_GROUP + j] = Nmeas - NSTAR_GROUP + j + 1; 320 } 309 321 Nave ++; 310 322 }
Note:
See TracChangeset
for help on using the changeset viewer.
