Changeset 27392
- Timestamp:
- Mar 22, 2010, 1:59:00 PM (16 years ago)
- Location:
- trunk/Ohana/src/addstar
- Files:
-
- 5 edited
-
include/addstar.h (modified) (1 diff)
-
src/ReadStarsSDSS.c (modified) (1 diff)
-
src/args.c (modified) (1 diff)
-
src/find_matches.c (modified) (6 diffs)
-
src/find_matches_closest.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/addstar/include/addstar.h
r26384 r27392 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 ***/ -
trunk/Ohana/src/addstar/src/ReadStarsSDSS.c
r21508 r27392 258 258 } 259 259 260 NSTAR_GROUP = NFILTER; 260 261 *nimages += NFILTER; 261 262 *nstars = Nstars*NFILTER; -
trunk/Ohana/src/addstar/src/args.c
r24975 r27392 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 */ -
trunk/Ohana/src/addstar/src/find_matches.c
r26384 r27392 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, int, 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, int, 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 } -
trunk/Ohana/src/addstar/src/find_matches_closest.c
r26384 r27392 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 … … 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])) { … … 222 228 /** incorporate unmatched image stars, if this star is in field of this catalog **/ 223 229 /* these new entries are all written out in UPDATE mode */ 224 for (i = 0; (i < Nstars) && !options.only_match; i ++) {230 for (i = 0; (i < Nstars) && !options.only_match; i += NSTAR_GROUP) { 225 231 /* make sure there is space for next entry */ 226 if (Nmeas >= NMEAS ) {232 if (Nmeas >= NMEAS - NSTAR_GROUP) { 227 233 NMEAS = Nmeas + 1000; 228 234 REALLOCATE (next_meas, int, NMEAS); … … 244 250 catalog[0].average[Nave].dD = 0; 245 251 246 catalog[0].average[Nave].Nmeasure = 1;252 catalog[0].average[Nave].Nmeasure = NSTAR_GROUP; 247 253 catalog[0].average[Nave].Nmissing = 0; 248 254 catalog[0].average[Nave].Nextend = 0; … … 286 292 } 287 293 288 // supply the measurments from this detection 289 catalog[0].measure[Nmeas] = stars[N].measure; 290 291 // the following measure elements cannot be set until here: 292 catalog[0].measure[Nmeas].dR = 0.0; // astrometric offset, not error 293 catalog[0].measure[Nmeas].dD = 0.0; // astrometric offset, not error 294 catalog[0].measure[Nmeas].dbFlags = 0; 295 catalog[0].measure[Nmeas].averef = Nave; 296 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 297 catalog[0].measure[Nmeas].catID = catalog[0].catID; 298 299 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ 300 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 301 if (Nsec > -1) { 302 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]); 303 } 304 305 /* next[Nmeas] should always be -1 in this context (it is always the only 306 measurement for the star) */ 307 stars[N].found = Nmeas; 308 next_meas[Nmeas] = -1; 309 Nmeas ++; 294 for (j = 0; j < NSTAR_GROUP; j++) { 295 // supply the measurments from this detection 296 catalog[0].measure[Nmeas] = stars[N].measure; 297 N = N1[i + j]; 298 299 // the following measure elements cannot be set until here: 300 catalog[0].measure[Nmeas].dR = 0.0; // astrometric offset, not error 301 catalog[0].measure[Nmeas].dD = 0.0; // astrometric offset, not error 302 catalog[0].measure[Nmeas].dbFlags = 0; 303 catalog[0].measure[Nmeas].averef = Nave; 304 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID; 305 catalog[0].measure[Nmeas].catID = catalog[0].catID; 306 307 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ 308 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 309 if (Nsec > -1) { 310 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]); 311 } 312 313 /* next[Nmeas] should always be -1 in this context (it is always the only 314 measurement for the star) */ 315 stars[N].found = Nmeas; 316 next_meas[Nmeas] = -1; // inital value here update below 317 Nmeas ++; 318 } 319 for (j = 0; j < NSTAR_GROUP - 1; j++) { 320 next_meas[Nmeas - NSTAR_GROUP + j] = Nmeas - NSTAR_GROUP + j + 1; 321 } 310 322 Nave ++; 311 323 }
Note:
See TracChangeset
for help on using the changeset viewer.
