Changeset 36904
- Timestamp:
- Jun 18, 2014, 8:06:06 AM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140610/Ohana/src
- Files:
-
- 4 edited
-
addstar/src/find_matches.c (modified) (8 diffs)
-
addstar/src/find_matches_closest.c (modified) (1 diff)
-
dvomerge/src/merge_catalogs_old.c (modified) (3 diffs)
-
dvomerge/src/replace_match.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/find_matches.c
r36903 r36904 14 14 15 15 if (NSTAR_GROUP <= 0) { 16 fprintf (stderr, "ERROR: NSTAR_GROUP NOT SET!\n");17 exit (1);16 fprintf (stderr, "ERROR: NSTAR_GROUP NOT SET!\n"); 17 exit (1); 18 18 } 19 19 … … 169 169 float dRoff = dvoOffsetR(&catalog[0].measure[Nmeas], &catalog[0].average[n]); 170 170 171 // rationalize dR:171 // rationalize R: 172 172 if (dRoff > +180.0*3600.0) { 173 // average on high end of boundary, move star up174 catalog[0].measure[Nmeas].R += 360.0;175 dRoff -= 360.0*3600.0;173 // average on high end of boundary, move star up 174 catalog[0].measure[Nmeas].R += 360.0; 175 dRoff -= 360.0*3600.0; 176 176 } 177 177 if (dRoff < -180.0*3600.0) { 178 // average on low end of boundary, move star down 179 catalog[0].measure[Nmeas].R -= 360.0; 180 dRoff += 360.0*3600.0; 181 } 182 if (dRoff > 10*RADIUS) { 178 // average on low end of boundary, move star down 179 catalog[0].measure[Nmeas].R -= 360.0; 180 dRoff += 360.0*3600.0; 181 } 182 if (fabs(dRoff) > 10*RADIUS) { 183 // take declination into account and check again. 184 double cosD = cos(RAD_DEG*catalog[0].average[n].D); 185 if (fabs(dRoff*cosD) > 10*RADIUS) { 183 186 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 184 187 catalog[0].average[n].R, catalog[0].average[n].D, … … 186 189 X1[i], X2[J], 187 190 Y1[i], Y2[J]); 191 } 188 192 } 189 193 … … 234 238 } 235 239 236 /* incorporate unmatched image stars, if this star is in field of this catalog */237 /* these new entries are all written out in UPDATE mode */240 /* incorporate unmatched image stars, if this star is in field of this catalog */ 241 /* these new entries are all written out in UPDATE mode */ 238 242 for (i = 0; (i < Nstars) && !options.only_match; i += NSTAR_GROUP) { 239 243 /* make sure there is space for next entry */ … … 262 266 263 267 if (PSPS_ID) { 264 catalog[0].average[Nave].extID = CreatePSPSObjectID(catalog[0].average[Nave].R, catalog[0].average[Nave].D);268 catalog[0].average[Nave].extID = CreatePSPSObjectID(catalog[0].average[Nave].R, catalog[0].average[Nave].D); 265 269 } 266 270 … … 286 290 /* in UPDATE mode, this value is not saved; use relphot to recalculate */ 287 291 if (Nsec > -1) { 288 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]);292 catalog[0].secfilt[Nave*Nsecfilt+Nsec].M = PhotCat (&catalog[0].measure[Nmeas]); 289 293 } 290 294 291 295 /* next[Nmeas] should always be -1 in this context (it is always the only 292 measurement for the star) */296 measurement for the star) */ 293 297 stars[i].found = Nmeas; 294 298 next_meas[Nmeas] = -1; // initial value here update below … … 311 315 } 312 316 313 /* note stars which have been found in this catalog */317 /* note stars which have been found in this catalog */ 314 318 for (i = 0; i < NstarsIn; i++) { 315 319 if (stars[i].found > -1) { … … 318 322 } 319 323 320 /* check if the catalog has changed? if no change, no need to write */324 /* check if the catalog has changed? if no change, no need to write */ 321 325 catalog[0].objID = objID; // new max value, save on catalog close 322 326 catalog[0].Naverage = Nave; -
branches/eam_branches/ipp-20140610/Ohana/src/addstar/src/find_matches_closest.c
r36903 r36904 207 207 dRoff += 360.0*3600.0; 208 208 } 209 if (dRoff > 10*RADIUS) { 210 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 211 catalog[0].average[n].R, catalog[0].average[n].D, 212 stars[N].average.R, stars[N].average.D, 213 X1[i], X2[Jmin], 214 Y1[i], Y2[Jmin]); 215 // XXX abort on this? -- this is a bad failure... 209 if (fabs(dRoff) > 10*RADIUS) { 210 // take declination into account and check again. 211 double cosD = cos(RAD_DEG*catalog[0].average[n].D); 212 if (fabs(dRoff*cosD) > 10*RADIUS) { 213 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 214 catalog[0].average[n].R, catalog[0].average[n].D, 215 stars[N].average.R, stars[N].average.D, 216 X1[i], X2[Jmin], 217 Y1[i], Y2[Jmin]); 218 // XXX abort on this? -- this is a bad failure... 219 } 216 220 } 217 221 -
branches/eam_branches/ipp-20140610/Ohana/src/dvomerge/src/merge_catalogs_old.c
r36486 r36904 19 19 20 20 off_t i, j, k, Nin, offset, J, Jmin, status, Nstars; 21 double RADIUS2, Rmin , Rin, Din;21 double RADIUS2, Rmin; 22 22 double *X1, *Y1, *X2, *Y2; 23 23 double dX, dY, dR; … … 206 206 output[0].measure[Nmeas] = input[0].measure[offset]; 207 207 208 Rin = input[0].average[N].R - input[0].measure[offset].dR / 3600.0; 209 Din = input[0].average[N].D - input[0].measure[offset].dD / 3600.0; 210 211 /** dR,dD now represent arcsec **/ 212 output[0].measure[Nmeas].dR = 3600.0*(output[0].average[n].R - Rin); // XXX update these based on choice of astromety 213 output[0].measure[Nmeas].dD = 3600.0*(output[0].average[n].D - Din); // XXX update these based on choice of astromety 208 // old code: find R,D using average_in[0], the get offset relative to average_out[0]. no longer 209 // needed since we carry around R,D 210 // Rin = input[0].average[N].R - input[0].measure[offset].dR / 3600.0; 211 // Din = input[0].average[N].D - input[0].measure[offset].dD / 3600.0; 212 // output[0].measure[Nmeas].dR = 3600.0*(output[0].average[n].R - Rin); 213 // output[0].measure[Nmeas].dD = 3600.0*(output[0].average[n].D - Din); 214 214 215 output[0].measure[Nmeas].dbFlags = 0; // XXX why reset these? 215 216 output[0].measure[Nmeas].averef = n; … … 221 222 // fprintf (stderr, "Nave : "OFF_T_FMT", Nmeas : "OFF_T_FMT", dR: %f, dD: %f, catID: %d\n", n, Nmeas, output[0].measure[Nmeas].dR, output[0].measure[Nmeas].dD, output[0].measure[i].catID); 222 223 223 // rationalize dR 224 if (output[0].measure[Nmeas].dR > +180.0*3600.0) { 224 float dRoff = dvoOffsetR(&output[0].measure[Nmeas], &output[0].average[n]); 225 226 // rationalize R 227 if (dRoff > +180.0*3600.0) { 225 228 // average on high end of boundary, move star up 226 Rin+= 360.0;227 output[0].measure[Nmeas].dR = 3600.0*(output[0].average[n].R - Rin);228 } 229 if ( output[0].measure[Nmeas].dR< -180.0*3600.0) {229 output[0].measure[Nmeas].R += 360.0; 230 dRoff -= 360.0*3600.0; 231 } 232 if (dRoff < -180.0*3600.0) { 230 233 // average on low end of boundary, move star down 231 Rin -= 360.0; 232 output[0].measure[Nmeas].dR = 3600.0*(output[0].average[n].R - Rin); 233 } 234 if (fabs(output[0].measure[Nmeas].dR) > 10*RADIUS) { 235 // ok take declination into account and check again. 236 double cosD = cos(RAD_DEG*Din); 237 if (fabs(output[0].measure[Nmeas].dR*cosD) > 10*RADIUS) { 238 239 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 240 output[0].average[n].R, output[0].average[n].D, Rin, Din, 241 X1[i], X2[Jmin], Y1[i], Y2[Jmin]); 242 243 // XXX abort on this? -- this is a bad failure... 234 output[0].measure[Nmeas].R -= 360.0; 235 dRoff += 360.0*3600.0; 236 } 237 if (fabs(dRoff) > 10*RADIUS) { 238 // take declination into account and check again. 239 double cosD = cos(RAD_DEG*output[0].average[n].D); 240 if (fabs(dRoff*cosD) > 10*RADIUS) { 241 fprintf (stderr, "error: %10.6f,%10.6f vs %10.6f,%10.6f (%f,%f vs %f,%f)\n", 242 output[0].average[n].R, output[0].average[n].D, 243 output[0].measure[Nmeas].R, output[0].measure[Nmeas].D, 244 X1[i], X2[Jmin], Y1[i], Y2[Jmin]); 245 // XXX abort on this? -- this is a bad failure... 244 246 } 245 247 } -
branches/eam_branches/ipp-20140610/Ohana/src/dvomerge/src/replace_match.c
r33963 r36904 7 7 unsigned int averef; 8 8 unsigned int catID; 9 double Rin, Din;10 9 11 10 // find the matching photcode in the object's list of measurements … … 18 17 measure_out[Nout] = measure_in[0]; 19 18 20 Rin = average_in[0].R - measure_in[0].dR / 3600.0; 21 Din = average_in[0].D - measure_in[0].dD / 3600.0; 19 // old code: find R,D using average_in[0], the get offset relative to average_out[0]. no longer 20 // needed since we carry around R,D 21 // double Rin = average_in[0].R - measure_in[0].dR / 3600.0; 22 // double Din = average_in[0].D - measure_in[0].dD / 3600.0; 23 // measure_out[Nout].dR = 3600.0*(average_out[0].R - Rin); 24 // measure_out[Nout].dD = 3600.0*(average_out[0].D - Din); 22 25 23 /** dR,dD now represent arcsec **/24 measure_out[Nout].dR = 3600.0*(average_out[0].R - Rin);25 measure_out[Nout].dD = 3600.0*(average_out[0].D - Din);26 26 measure_out[Nout].dbFlags = 0; // XXX why reset these? 27 27 measure_out[Nout].averef = averef; … … 29 29 measure_out[Nout].catID = catID; 30 30 31 float dRoff = dvoOffsetR(&measure_out[Nout], average_out); 32 31 33 // rationalize dR 32 if ( measure_out[Nout].dR> +180.0*3600.0) {34 if (dRoff > +180.0*3600.0) { 33 35 // average on high end of boundary, move star up 34 Rin+= 360.0;35 measure_out[Nout].dR = 3600.0*(average_out[0].R - Rin);36 measure_out[Nout].R += 360.0; 37 dRoff -= 360.0*3600.0; 36 38 } 37 if ( measure_out[Nout].dR< -180.0*3600.0) {39 if (dRoff < -180.0*3600.0) { 38 40 // average on low end of boundary, move star down 39 Rin-= 360.0;40 measure_out[Nout].dR = 3600.0*(average_out[0].R - Rin);41 measure_out[Nout].R -= 360.0; 42 dRoff += 360.0*3600.0; 41 43 } 42 44 43 45 // warn on surprisingly distant detections 44 if (fabs( measure_out[Nout].dR) > 10*RADIUS) {46 if (fabs(dRoff) > 10*RADIUS) { 45 47 // ok take declination into account and check again. 46 double cosD = cos(RAD_DEG*Din); 47 if (fabs(measure_out[Nout].dR*cosD) > 10*RADIUS) { 48 48 double cosD = cos(RAD_DEG*average_out[0].D); 49 if (fabs(dRoff*cosD) > 10*RADIUS) { 49 50 fprintf (stderr, "surprisingly distant detection: %10.6f,%10.6f vs %10.6f,%10.6f\n", 50 average_out[0].R, average_out[0].D, Rin, Din);51 average_out[0].R, average_out[0].D, measure_out[Nout].R, measure_out[Nout].D); 51 52 } 52 53 }
Note:
See TracChangeset
for help on using the changeset viewer.
