Changeset 37009
- Timestamp:
- Jul 13, 2014, 11:22:26 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140610/Ohana/src/dvomerge/src/merge_catalogs_old.c
r36995 r37009 31 31 ALLOCATE (Y1, double, input[0].Naverage); 32 32 ALLOCATE (N1, off_t, input[0].Naverage); 33 ALLOCATE (input[0].found, off_t, input[0].Naverage); 33 if (!input[0].found_t) { 34 ALLOCATE (input[0].found_t, off_t, input[0].Naverage); 35 } else { 36 REALLOCATE (input[0].found_t, off_t, input[0].Naverage); 37 } 34 38 35 39 /** allocate local arrays (catalog) **/ … … 38 42 ALLOCATE (Y2, double, NAVE); 39 43 ALLOCATE (N2, off_t, NAVE); 40 ALLOCATE (output[0].found, off_t, NAVE); 44 if (!output[0].found_t) { 45 ALLOCATE (output[0].found_t, off_t, NAVE); 46 } else { 47 REALLOCATE (output[0].found_t, off_t, NAVE); 48 } 41 49 /* for secfilt j and star i, secfilt[i*Nsecfilt+j] */ 42 50 … … 78 86 N1[Nstars] = i; 79 87 Nstars ++; 80 input[0].found [i] = -1;88 input[0].found_t[i] = -1; 81 89 } 82 90 if (Nstars < 1) { 83 91 if (VERBOSE) fprintf (stderr, "skipping %s, no overlapping stars\n", output[0].filename); 84 free (output[0].found);85 free (input[0].found);86 92 free (X1); 87 93 free (Y1); … … 97 103 for (i = 0; i < Nave; i++) { 98 104 RD_to_XY (&X2[i], &Y2[i], output[0].average[i].R, output[0].average[i].D, &tcoords); 99 output[0].found [i] = -1;105 output[0].found_t[i] = -1; 100 106 N2[i] = i; 101 107 } … … 187 193 int Mout = output[0].average[n].measureOffset; 188 194 if (replace_match(&output[0].average[n], &output[0].measure[Mout], &input[0].average[N], &input[0].measure[offset])) { 189 input[0].found [N] = Mout;195 input[0].found_t[N] = Mout; 190 196 continue; 191 197 } … … 237 243 } 238 244 } 239 input[0].found [N] = Nmeas;245 input[0].found_t[N] = Nmeas; 240 246 output[0].average[n].Nmeasure ++; 241 247 Nmeas ++; … … 266 272 /* Nm is updated, but not written out in -update mode (for existing entries) 267 273 Nm is recalculated in build_meas_links if loaded table is not sorted */ 268 output[0].found [n] = Nmeas;274 output[0].found_t[n] = Nmeas; 269 275 i++; 270 276 } … … 288 294 } 289 295 290 if (input[0].found [N] >= 0) continue;296 if (input[0].found_t[N] >= 0) continue; 291 297 if (!IN_REGION (input[0].average[N].R, input[0].average[N].D)) continue; 292 298 … … 341 347 342 348 /* we set next[Nmeas] to -1 here, and update correctly below */ 343 input[0].found [N] = Nmeas;349 input[0].found_t[N] = Nmeas; 344 350 next_meas[Nmeas] = -1; 345 351 Nmeas ++; … … 367 373 /* note stars which have been found in this catalog */ 368 374 for (i = 0; i < input[0].Naverage; i++) { 369 if (input[0].found [i] > -1) {370 input[0].found [i] = -2;375 if (input[0].found_t[i] > -1) { 376 input[0].found_t[i] = -2; 371 377 } else { 372 input[0].found [i] = -3;378 input[0].found_t[i] = -3; 373 379 } 374 380 } … … 383 389 free (next_meas); 384 390 385 free (output[0].found);386 391 free (X2); 387 392 free (Y2); 388 393 free (N2); 389 free (input[0].found);390 394 free (X1); 391 395 free (Y1); … … 404 408 images have boundaries which are lines in pixels coords, but curve in RA and DEC 405 409 406 output[0].found [Ncat] but stars[Nstar].found410 output[0].found_t[Ncat] but stars[Nstar].found 407 411 408 412 */
Note:
See TracChangeset
for help on using the changeset viewer.
