Changeset 38544
- Timestamp:
- Jun 25, 2015, 2:00:04 PM (11 years ago)
- Location:
- branches/eam_branches/ipp-20150616/Ohana/src/addstar
- Files:
-
- 4 edited
-
Makefile (modified) (1 diff)
-
include/addstar.h (modified) (1 diff)
-
src/addstar.c (modified) (1 diff)
-
src/find_matches.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150616/Ohana/src/addstar/Makefile
r38542 r38544 76 76 $(SRC)/edge_check.$(ARCH).o \ 77 77 $(SRC)/fakeimage.$(ARCH).o \ 78 $(SRC)/find_matches.$(ARCH).o \ 78 79 $(SRC)/find_matches_closest.$(ARCH).o \ 79 80 $(SRC)/GetZeroPointExposure.$(ARCH).o \ -
branches/eam_branches/ipp-20150616/Ohana/src/addstar/include/addstar.h
r38542 r38544 220 220 221 221 int find_matches_closest PROTO((SkyRegion *region, Catalog *newcat, Catalog *catalog, AddstarClientOptions options)); 222 int find_matches PROTO((SkyRegion *region, Catalog *newcat, Catalog *catalog, AddstarClientOptions options)); 222 223 223 224 # if (0) 224 int find_matches PROTO((SkyRegion *region, Stars *stars, unsigned int Nstars, Catalog *catalog, AddstarClientOptions options));225 225 int find_matches_refstars PROTO((SkyRegion *region, Stars **stars, unsigned int Nstars, Catalog *catalog, AddstarClientOptions options)); 226 226 int find_matches_closest_refstars PROTO((SkyRegion *region, Stars **stars, unsigned int Nstars, Catalog *catalog, AddstarClientOptions options)); -
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/addstar.c
r38536 r38544 150 150 Nmatch += find_matches_closest (skylist[0].regions[i], newcat, &catalog, options); 151 151 } else { 152 // XXX Nmatch += find_matches (skylist[0].regions[i], stars, Nstars, &catalog, options);152 Nmatch += find_matches (skylist[0].regions[i], newcat, &catalog, options); 153 153 } 154 154 break; -
branches/eam_branches/ipp-20150616/Ohana/src/addstar/src/find_matches.c
r38467 r38544 1 1 # include "addstar.h" 2 2 3 int find_matches (SkyRegion *region, Stars *stars, unsigned int NstarsIn, Catalog *catalog, AddstarClientOptions options) {4 5 off_t i, j, n, N, J, Nstars ;3 int find_matches (SkyRegion *region, Catalog *srccat, Catalog *tgtcat, AddstarClientOptions options) { 4 5 off_t i, j, n, N, J, Nstars, mSrc; 6 6 double RADIUS, RADIUS2; 7 7 double *X1, *Y1, *X2, *Y2; 8 8 double dX, dY, dR; 9 off_t *N1, *N2 , *next_meas;9 off_t *N1, *N2; 10 10 off_t Nave, NAVE, Nmeas, NMEAS, Nmatch; 11 11 int Nsecfilt, Nsec, status; … … 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 20 15 /* photcode data - must by of type DEP; options.photcode is equiv photcode for all input 21 16 images this function requires incoming stars to have the same photcode.equiv value. if … … 27 22 28 23 /** allocate local arrays (stars) **/ 29 ALLOCATE (X1, double, NstarsIn); 30 ALLOCATE (Y1, double, NstarsIn); 31 ALLOCATE (N1, off_t, NstarsIn); 32 33 /** allocate local arrays (catalog) **/ 34 NAVE = Nave = catalog[0].Naverage; 24 ALLOCATE (X1, double, srccat->Naverage); 25 ALLOCATE (Y1, double, srccat->Naverage); 26 ALLOCATE (N1, off_t, srccat->Naverage); 27 28 myAbort ("figure out if found_t needs to be tracking Naverage or Nmeasure"); 29 if (!srccat->found_t) { 30 ALLOCATE (srccat->found_t, off_t, srccat->Naverage); 31 for (i = 0; i < srccat->Naverage; i++) { 32 srccat->found_t[i] = -1; 33 } 34 } 35 36 /** allocate local arrays (tgtcat) **/ 37 NAVE = Nave = tgtcat[0].Naverage; 35 38 ALLOCATE (X2, double, NAVE); 36 39 ALLOCATE (Y2, double, NAVE); 37 40 ALLOCATE (N2, off_t, NAVE); 38 ALLOCATE (catalog[0].found_t, off_t, NAVE); 41 42 if (!tgtcat->found_t) { 43 ALLOCATE (tgtcat[0].found_t, off_t, NAVE); 44 for (i = 0; i < NAVE; i++) { 45 tgtcat->found_t[i] = -1; 46 } 47 } 39 48 /* for secfilt j and star i, secfilt[i*Nsecfilt+j] */ 40 49 41 50 /* internal counters */ 42 51 Nmatch = 0; 43 NMEAS = Nmeas = catalog[0].Nmeasure;52 NMEAS = Nmeas = tgtcat[0].Nmeasure; 44 53 45 // current max obj ID for this catalog 46 objID = catalog[0].objID; 47 catID = catalog[0].catID; 54 off_t *next_meas = NULL; 55 56 // current max obj ID for this tgtcat 57 objID = tgtcat[0].objID; 58 catID = tgtcat[0].catID; 48 59 49 60 /* project onto rectilinear grid with 1 arcsec pixels. the choice of ZEA projection has the … … 51 62 * possible X,Y points map back to R,D and the local plate scale changes substantially far from 52 63 * the projection pole. a better mapping might be ARC, not yet implemented (see 53 * coordops.update.c). We use the center of the region ( catalog) for crval1,2.64 * coordops.update.c). We use the center of the region (tgtcat) for crval1,2. 54 65 */ 55 66 InitCoords (&tcoords, "DEC--ARC"); … … 64 75 /* build spatial index (RA sort) referencing input array sequence */ 65 76 Nstars = 0; 66 for (i = 0; i < NstarsIn; i++) {67 status = RD_to_XY (&X1[Nstars], &Y1[Nstars], s tars[i].average.R, stars[i].average.D, &tcoords);77 for (i = 0; i < srccat->Naverage; i++) { 78 status = RD_to_XY (&X1[Nstars], &Y1[Nstars], srccat->average[i].R, srccat->average[i].D, &tcoords); 68 79 if (!status) continue; 69 80 N1[Nstars] = i; … … 71 82 } 72 83 if (Nstars < 1) { 73 if (VERBOSE) fprintf (stderr, "skipping %s, no overlapping stars\n", catalog[0].filename);84 if (VERBOSE) fprintf (stderr, "skipping %s, no overlapping stars\n", tgtcat[0].filename); 74 85 free (X1); 75 86 free (Y1); … … 84 95 /* build spatial index (RA sort) */ 85 96 for (i = 0; i < Nave; i++) { 86 RD_to_XY (&X2[i], &Y2[i], catalog[0].average[i].R, catalog[0].average[i].D, &tcoords);97 RD_to_XY (&X2[i], &Y2[i], tgtcat[0].average[i].R, tgtcat[0].average[i].D, &tcoords); 87 98 N2[i] = i; 88 catalog[0].found_t[N2[i]] = -1;99 tgtcat[0].found_t[N2[i]] = -1; 89 100 } 90 101 if (Nave > 1) sort_coords_index (X2, Y2, N2, Nave); 91 102 92 103 /* set up pointers for linked list of measure */ 93 if ( catalog[0].sorted && (catalog[0].Nmeasure == catalog[0].Nmeasure_disk)) {94 next_meas = init_measure_links ( catalog[0].average, Nave, catalog[0].measure, Nmeas);104 if (tgtcat[0].sorted && (tgtcat[0].Nmeasure == tgtcat[0].Nmeasure_disk)) { 105 next_meas = init_measure_links (tgtcat[0].average, Nave, tgtcat[0].measure, Nmeas); 95 106 } else { 96 next_meas = build_measure_links ( catalog[0].average, Nave, catalog[0].measure, Nmeas);107 next_meas = build_measure_links (tgtcat[0].average, Nave, tgtcat[0].measure, Nmeas); 97 108 } 98 109 … … 102 113 103 114 /** find matched stars **/ 104 // XXX could use NSTAR_GROUP to do this match more quicky if NSTAR_GROUP > 1105 115 for (i = j = 0; (i < Nstars) && (j < Nave); ) { 106 116 if (!finite(X1[i]) || !finite(Y1[i])) { … … 138 148 139 149 /* make sure there is space for next entry */ 140 if (Nmeas >= NMEAS ) {141 NMEAS = Nmeas + 1000 ;150 if (Nmeas >= NMEAS - srccat->average[N].Nmeasure) { 151 NMEAS = Nmeas + 1000 + srccat->average[N].Nmeasure; 142 152 REALLOCATE (next_meas, off_t, NMEAS); 143 144 REALLOCATE (catalog[0].measure, Measure, NMEAS); 145 } 146 147 /* add to end of measurement list */ 148 add_meas_link (&catalog[0].average[n], next_meas, Nmeas, NMEAS); 153 REALLOCATE (tgtcat[0].measure, Measure, NMEAS); 154 } 149 155 150 156 /** add measurements for this star **/ 151 152 // set the new measurements 153 catalog[0].measure[Nmeas] = stars[N].measure; 154 155 // the following measure elements cannot be set until here: 156 catalog[0].measure[Nmeas].dbFlags = 0; 157 catalog[0].measure[Nmeas].averef = n; // this must be an absolute sequence number, if partial average is loaded 158 catalog[0].measure[Nmeas].objID = catalog[0].average[n].objID; 159 catalog[0].measure[Nmeas].catID = catalog[0].catID; 160 161 float dRoff = dvoOffsetR(&catalog[0].measure[Nmeas], &catalog[0].average[n]); 162 163 // rationalize R: 164 if (dRoff > +180.0*3600.0) { 165 // average on high end of boundary, move star up 166 catalog[0].measure[Nmeas].R += 360.0; 167 dRoff -= 360.0*3600.0; 168 } 169 if (dRoff < -180.0*3600.0) { 170 // average on low end of boundary, move star down 171 catalog[0].measure[Nmeas].R -= 360.0; 172 dRoff += 360.0*3600.0; 173 } 174 if (fabs(dRoff) > 10*RADIUS) { 175 // take declination into account and check again. 176 double cosD = cos(RAD_DEG*catalog[0].average[n].D); 177 if (fabs(dRoff*cosD) > 10*RADIUS) { 178 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 179 catalog[0].average[n].R, catalog[0].average[n].D, 180 stars[N].average.R, stars[N].average.D, 181 X1[i], X2[J], 182 Y1[i], Y2[J]); 183 } 184 } 185 186 /* adds the measurement to the calibration if appropriate color terms are found */ 187 /* we call this before (optionally) setting the average magnitude to avoid auto-correlations */ 188 if (options.calibrate) { 189 AddToCalibration (&catalog[0].average[n], &catalog[0].secfilt[n*Nsecfilt], catalog[0].measure, &catalog[0].measure[Nmeas], next_meas, N); 190 } 191 192 /* set the average magnitude if not already set and if photcode.equiv is not 0 */ 193 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 194 if (Nsec > -1) { 195 if (isnan(catalog[0].secfilt[n*Nsecfilt+Nsec].M)) { 196 catalog[0].secfilt[n*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas], MAG_CLASS_PSF); 197 } 198 } 199 200 /*** flag multiple stars */ 201 /* this image star matches more than one catalog star */ 202 if (stars[N].found > -1) { 203 catalog[0].measure[stars[N].found].dbFlags |= ID_MEAS_BLEND_MEAS; 204 catalog[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_MEAS; 205 } 206 if (stars[N].found == -2) { /* this image star matches a catalog star on a neighboring catalog */ 207 catalog[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_MEAS_X; 208 } 209 if (stars[N].found == -1) { /* this image star matches only this catalog star */ 210 stars[N].found = Nmeas; /* save first match, in case coincidences are found */ 211 } 212 /* this catalog star matches more than one image star */ 213 if (catalog[0].found_t[n] > -1) { 214 catalog[0].measure[catalog[0].found_t[n]].dbFlags |= ID_MEAS_BLEND_OBJ; 215 catalog[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_OBJ; 216 } else { 217 catalog[0].found_t[n] = Nmeas; 218 } 219 /* Nm is updated, but not written out in -update mode (for existing entries) 220 Nm is recalculated in build_meas_links if loaded table is not sorted */ 221 catalog[0].average[n].Nmeasure ++; 222 Nmeas ++; 157 off_t mOff = srccat->average[N].measureOffset; 158 for (mSrc = 0; mSrc < srccat->average[N].Nmeasure; mSrc++) { 159 /* add to end of measurement list */ 160 add_meas_link (&tgtcat[0].average[n], next_meas, Nmeas, NMEAS); 161 162 /** add measurements for this star **/ 163 164 // set the new measurements 165 tgtcat[0].measure[Nmeas] = srccat->measure[mSrc + mOff]; 166 167 // the following measure elements cannot be set until here: 168 tgtcat[0].measure[Nmeas].dbFlags = 0; 169 tgtcat[0].measure[Nmeas].averef = n; // this must be an absolute sequence number, if partial average is loaded 170 tgtcat[0].measure[Nmeas].objID = tgtcat[0].average[n].objID; 171 tgtcat[0].measure[Nmeas].catID = tgtcat[0].catID; 172 173 float dRoff = dvoOffsetR(&tgtcat[0].measure[Nmeas], &tgtcat[0].average[n]); 174 175 // rationalize R: 176 if (dRoff > +180.0*3600.0) { 177 // average on high end of boundary, move star up 178 tgtcat[0].measure[Nmeas].R += 360.0; 179 dRoff -= 360.0*3600.0; 180 } 181 if (dRoff < -180.0*3600.0) { 182 // average on low end of boundary, move star down 183 tgtcat[0].measure[Nmeas].R -= 360.0; 184 dRoff += 360.0*3600.0; 185 } 186 if (fabs(dRoff) > 10*RADIUS) { 187 // take declination into account and check again. 188 double cosD = cos(RAD_DEG*tgtcat[0].average[n].D); 189 if (fabs(dRoff*cosD) > 10*RADIUS) { 190 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 191 tgtcat[0].average[n].R, tgtcat[0].average[n].D, 192 srccat->average[N].R, srccat->average[N].D, 193 X1[i], X2[J], 194 Y1[i], Y2[J]); 195 } 196 } 197 198 /* adds the measurement to the calibration if appropriate color terms are found */ 199 /* we call this before (optionally) setting the average magnitude to avoid auto-correlations */ 200 if (options.calibrate) { 201 AddToCalibration (&tgtcat[0].average[n], &tgtcat[0].secfilt[n*Nsecfilt], tgtcat[0].measure, &tgtcat[0].measure[Nmeas], next_meas, N); 202 } 203 204 /* set the average magnitude if not already set and if photcode.equiv is not 0 */ 205 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 206 if (Nsec > -1) { 207 if (isnan(tgtcat[0].secfilt[n*Nsecfilt+Nsec].M)) { 208 tgtcat[0].secfilt[n*Nsecfilt+Nsec].M = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF); 209 } 210 } 211 212 myAbort ("fix logic on multiple detections"); 213 214 /*** flag multiple stars */ 215 /* this image star matches more than one tgtcat star */ 216 if (srccat->found_t[N] > -1) { 217 tgtcat[0].measure[srccat->found_t[N]].dbFlags |= ID_MEAS_BLEND_MEAS; 218 tgtcat[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_MEAS; 219 } 220 if (srccat->found_t[N] == -2) { /* this image star matches a tgtcat star on a neighboring tgtcat */ 221 tgtcat[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_MEAS_X; 222 } 223 if (srccat->found_t[N] == -1) { /* this image star matches only this tgtcat star */ 224 srccat->found_t[N] = Nmeas; /* save first match, in case coincidences are found */ 225 } 226 /* this tgtcat star matches more than one image star */ 227 if (tgtcat[0].found_t[n] > -1) { 228 tgtcat[0].measure[tgtcat[0].found_t[n]].dbFlags |= ID_MEAS_BLEND_OBJ; 229 tgtcat[0].measure[Nmeas].dbFlags |= ID_MEAS_BLEND_OBJ; 230 } else { 231 tgtcat[0].found_t[n] = Nmeas; 232 } 233 /* Nm is updated, but not written out in -update mode (for existing entries) 234 Nm is recalculated in build_meas_links if loaded table is not sorted */ 235 tgtcat[0].average[n].Nmeasure ++; 236 Nmeas ++; 237 } 223 238 224 239 if (!options.update) { 225 240 /* in UPDATE mode, newly calculated coordinates are not saved */ 226 update_coords (& catalog[0].average[n], &catalog[0].measure[0], next_meas);241 update_coords (&tgtcat[0].average[n], &tgtcat[0].measure[0], next_meas); 227 242 } 228 243 } … … 230 245 } 231 246 232 /* incorporate unmatched image stars, if this star is in field of this catalog*/247 /* incorporate unmatched image stars, if this star is in field of this tgtcat */ 233 248 /* these new entries are all written out in UPDATE mode */ 234 for (i = 0; (i < Nstars) && !options.only_match; i + = NSTAR_GROUP) {249 for (i = 0; (i < Nstars) && !options.only_match; i ++) { 235 250 /* make sure there is space for next entry */ 236 if (Nmeas >= NMEAS - NSTAR_GROUP) {237 NMEAS = Nmeas + 1000 ;251 if (Nmeas >= NMEAS - srccat->average[i].Nmeasure) { 252 NMEAS = Nmeas + 1000 + srccat->average[i].Nmeasure; 238 253 REALLOCATE (next_meas, off_t, NMEAS); 239 REALLOCATE ( catalog[0].measure, Measure, NMEAS);254 REALLOCATE (tgtcat[0].measure, Measure, NMEAS); 240 255 } 241 256 if (Nave >= NAVE) { 242 257 NAVE = Nave + 1000; 243 REALLOCATE (catalog[0].average, Average, NAVE); 244 REALLOCATE (catalog[0].secfilt, SecFilt, NAVE*catalog[0].Nsecfilt); 245 } 246 247 if (stars[i].found >= 0) continue; 248 if (!IN_REGION (stars[i].average.R, stars[i].average.D)) continue; 249 250 dvo_average_init (&catalog[0].average[Nave]); 251 catalog[0].average[Nave].R = stars[i].average.R; 252 catalog[0].average[Nave].D = stars[i].average.D; 253 254 catalog[0].average[Nave].Nmeasure = NSTAR_GROUP; 255 catalog[0].average[Nave].measureOffset = Nmeas; 256 catalog[0].average[Nave].objID = objID; 257 catalog[0].average[Nave].catID = catID; 258 REALLOCATE (tgtcat[0].average, Average, NAVE); 259 if (tgtcat[0].secfilt) { 260 // we only update the secfilt table if it has been allocated for output 261 REALLOCATE (tgtcat[0].secfilt, SecFilt, NAVE*tgtcat[0].Nsecfilt); 262 } 263 } 264 265 if (srccat->found_t[i] >= 0) continue; 266 if (!IN_REGION (srccat->average[i].R, srccat->average[i].D)) continue; 267 268 dvo_average_init (&tgtcat[0].average[Nave]); 269 tgtcat[0].average[Nave].R = srccat->average[i].R; 270 tgtcat[0].average[Nave].D = srccat->average[i].D; 271 272 tgtcat[0].average[Nave].Nmeasure = srccat->average[i].Nmeasure; 273 tgtcat[0].average[Nave].measureOffset = Nmeas; 274 tgtcat[0].average[Nave].objID = objID; 275 tgtcat[0].average[Nave].catID = catID; 258 276 259 277 if (PSPS_ID) { 260 catalog[0].average[Nave].extID = CreatePSPSObjectID(catalog[0].average[Nave].R, catalog[0].average[Nave].D);278 tgtcat[0].average[Nave].extID = CreatePSPSObjectID(tgtcat[0].average[Nave].R, tgtcat[0].average[Nave].D); 261 279 } 262 280 263 281 objID ++; 264 282 265 for (j = 0; j < Nsecfilt; j++) { 266 dvo_secfilt_init (&catalog[0].secfilt[Nave*Nsecfilt+j], SECFILT_RESET_ALL); 267 } 268 269 for (j = 0; j < NSTAR_GROUP; j++) { 283 for (j = 0; tgtcat[0].secfilt && (j < Nsecfilt); j++) { 284 dvo_secfilt_init (&tgtcat[0].secfilt[Nave*Nsecfilt+j], SECFILT_RESET_ALL); 285 } 286 287 off_t mOff = srccat->average[i].measureOffset; 288 for (mSrc = 0; mSrc < srccat->average[i].Nmeasure; mSrc++) { 270 289 // supply the measurments from this detection 271 catalog[0].measure[Nmeas] = stars[i + j].measure; 290 dvo_measure_init (&tgtcat[0].measure[Nmeas]); 291 tgtcat[0].measure[Nmeas] = srccat->measure[mSrc + mOff]; 272 292 273 293 // the following measure elements cannot be set until here: 274 catalog[0].measure[Nmeas].dbFlags = 0;275 catalog[0].measure[Nmeas].averef = Nave; // XXX EAM : must be absolute Nave if partial read276 catalog[0].measure[Nmeas].objID = catalog[0].average[Nave].objID;277 catalog[0].measure[Nmeas].catID = catalog[0].catID;294 tgtcat[0].measure[Nmeas].dbFlags = 0; 295 tgtcat[0].measure[Nmeas].averef = Nave; // XXX EAM : must be absolute Nave if partial read 296 tgtcat[0].measure[Nmeas].objID = tgtcat[0].average[Nave].objID; 297 tgtcat[0].measure[Nmeas].catID = tgtcat[0].catID; 278 298 279 299 /* set the average magnitude if not already set and the photcode.equiv is not 0 */ 280 300 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 281 301 if (Nsec > -1) { 282 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas], MAG_CLASS_PSF);302 tgtcat[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&tgtcat[0].measure[Nmeas], MAG_CLASS_PSF); 283 303 } 284 304 285 305 /* next[Nmeas] should always be -1 in this context (it is always the only 286 306 measurement for the star) */ 287 stars[i].found = Nmeas; 288 next_meas[Nmeas] = -1; // initial value here update below 307 srccat->found_t[i] = Nmeas; 289 308 Nmeas ++; 290 } 291 for (j = 0; j < NSTAR_GROUP - 1; j++) {292 next_meas[Nmeas - NSTAR_GROUP + j] = Nmeas - NSTAR_GROUP + j +1;309 310 // update the next_meas pointer for this entry (last one for this star is -1) 311 next_meas[Nmeas-1] = (mSrc < srccat->average[i].Nmeasure - 1) ? Nmeas : -1; 293 312 } 294 313 Nave ++; 295 314 } 296 315 297 REALLOCATE ( catalog[0].average, Average, Nave);298 REALLOCATE ( catalog[0].measure, Measure, Nmeas);316 REALLOCATE (tgtcat[0].average, Average, Nave); 317 REALLOCATE (tgtcat[0].measure, Measure, Nmeas); 299 318 300 319 if (options.nosort) { 301 catalog[0].sorted = FALSE;320 tgtcat[0].sorted = FALSE; 302 321 } else { 303 catalog[0].sorted = TRUE;304 catalog[0].measure = sort_measure (catalog[0].average, Nave, catalog[0].measure, Nmeas, next_meas);305 } 306 307 /* note stars which have been found in this catalog*/308 for (i = 0; i < NstarsIn; i++) {309 if (s tars[i].found> -1) {310 s tars[i].found= -2;311 } 312 } 313 314 /* check if the cataloghas changed? if no change, no need to write */315 catalog[0].objID = objID; // new max value, save on catalogclose316 catalog[0].Naverage = Nave;317 catalog[0].Nmeasure = Nmeas;318 catalog[0].Nsecfilt_mem = Nave*Nsecfilt;322 tgtcat[0].sorted = TRUE; 323 tgtcat[0].measure = sort_measure (tgtcat[0].average, Nave, tgtcat[0].measure, Nmeas, next_meas); 324 } 325 326 /* note stars which have been found in this tgtcat */ 327 for (i = 0; i < srccat->Nmeasure; i++) { 328 if (srccat->found_t[i] > -1) { 329 srccat->found_t[i] = -2; 330 } 331 } 332 333 /* check if the tgtcat has changed? if no change, no need to write */ 334 tgtcat[0].objID = objID; // new max value, save on tgtcat close 335 tgtcat[0].Naverage = Nave; 336 tgtcat[0].Nmeasure = Nmeas; 337 tgtcat[0].Nsecfilt_mem = Nave*Nsecfilt; 319 338 if (VERBOSE) fprintf (stderr, "Nstars, Nave, Nmeas: "OFF_T_FMT" "OFF_T_FMT" "OFF_T_FMT", ("OFF_T_FMT" matches)\n", Nstars, Nave, Nmeas, Nmatch); 320 339 … … 333 352 notes: 334 353 335 for finding if a catalog star is in an image or an image star is in the catalog:354 for finding if a tgtcat star is in an image or an image star is in the tgtcat: 336 355 337 catalogs have boundaries defined by RA and DEC, but they may curve in projection356 tgtcats have boundaries defined by RA and DEC, but they may curve in projection 338 357 images have boundaries which are lines in pixels coords, but curve in RA and DEC 339 358 340 catalog[0].found[Ncat] but stars[Nstar].found359 tgtcat[0].found[Ncat] but stars[Nstar].found 341 360 342 361 */
Note:
See TracChangeset
for help on using the changeset viewer.
