Changeset 35665
- Timestamp:
- Jun 15, 2013, 9:06:07 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130509/Ohana/src/relastro/src/ImageOps.c
r35105 r35665 454 454 } 455 455 n = measure[0].averef; 456 Average *average = &catalog[c].average[n]; 456 457 457 458 if (moscoords == NULL) { … … 467 468 468 469 // new dR, dD : test 469 dR = 3600.0*(catalog[c].average[n].R - R); 470 dD = 3600.0*(catalog[c].average[n].D - D); 470 dR = 3600.0*(average[0].R - R); 471 dD = 3600.0*(average[0].D - D); 472 473 // make sure detection is on the same side of the 0,360 boundary as the average 474 // this will give some funny results withing ~1 arcsec of the pol 475 if (dR > +180.0*3600.0) { 476 // average on high end of boundary, move star up 477 R += 360.0; 478 dR = 3600.0*(average[0].R - R); 479 } 480 if (dR < -180.0*3600.0) { 481 // average on low end of boundary, move star down 482 R -= 360.0; 483 dR = 3600.0*(average[0].R - R); 484 } 485 486 float csdec = cos(average[0].D * RAD_DEG); 471 487 472 488 // complain if the new location is far from the average location 473 489 // NOTE: This should never happen, or our StarMap tests are not working 474 if (fabs(dR ) > 3.0*ADDSTAR_RADIUS) {490 if (fabs(dR*csdec) > 3.0*ADDSTAR_RADIUS) { 475 491 NoffRAave ++; 476 492 if (VERBOSE2) { 477 fprintf (stderr, "measurement is far from average location (R): %f %f (%f %f )\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD);478 dump_measures (& catalog[c].average[n], catalog[c].measure);493 fprintf (stderr, "measurement is far from average location (R): %f %f (%f %f %f)\n", average[0].R, average[0].D, dR, dR*csdec, dD); 494 dump_measures (&average[0], catalog[c].measure); 479 495 } 480 496 // abort (); … … 483 499 NoffDECave ++; 484 500 if (VERBOSE2) { 485 fprintf (stderr, "measurement is far from average location (D): %f %f (%f %f)\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD);486 dump_measures (& catalog[c].average[n], catalog[c].measure);501 fprintf (stderr, "measurement is far from average location (D): %f %f (%f %f)\n", average[0].R, average[0].D, dR, dD); 502 dump_measures (&average[0], catalog[c].measure); 487 503 } 488 504 // abort (); … … 490 506 491 507 // complain if the new location is far from the old location 492 if (fabs(c atalog[c].measureT[m].dR - dR) > DPOS_MAX_ASEC) {508 if (fabs(csdec*(measure[0].dR - dR)) > DPOS_MAX_ASEC) { 493 509 NoffRAori ++; 494 510 if (VERBOSE2) { 495 fprintf (stderr, "measurement is far from original location (R): %f %f (%f %f)\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD);496 dump_measures (& catalog[c].average[n], catalog[c].measure);511 fprintf (stderr, "measurement moves far from original location (R): %f %f (%f %f %f %f)\n", average[0].R, average[0].D, measure[0].dR, dR, csdec*(measure[0].dR - dR), dD); 512 dump_measures (&average[0], catalog[c].measure); 497 513 } 498 514 // abort(); … … 501 517 NoffDECori ++; 502 518 if (VERBOSE2) { 503 fprintf (stderr, "measurement is far from original location (D): %f %f (%f %f)\n", catalog[c].average[n].R, catalog[c].average[n].D, dR, dD);504 dump_measures (& catalog[c].average[n], catalog[c].measure);519 fprintf (stderr, "measurement moves far from original location (D): %f %f (%f %f)\n", average[0].R, average[0].D, dR, measure[0].dD, dD); 520 dump_measures (&average[0], catalog[c].measure); 505 521 } // abort(); 506 522 } … … 511 527 measure[0].dR = dR; 512 528 measure[0].dD = dD; 529 measureT[0].dR = dR; 530 measureT[0].dD = dD; 513 531 514 if (measure[0].dR > +180.0*3600.0) {515 // average on high end of boundary, move star up516 R += 360.0;517 measure[0].dR = 3600.0*(catalog[c].average[n].R - R);518 }519 if (measure[0].dR < -180.0*3600.0) {520 // average on low end of boundary, move star down521 R -= 360.0;522 measure[0].dR = 3600.0*(catalog[c].average[n].R - R);523 }524 525 532 // set the systematic error for this image: 526 533 measure[0].dRsys = ToShortPixels(dPosSys); 534 measureT[0].dRsys = ToShortPixels(dPosSys); 527 535 } 528 536 … … 530 538 if (VERBOSE && (Noff > 0)) fprintf (stderr, "Noff ave RA %d, Noff ave DEC %d, Noff ori RA %d, Noff ori DEC %d\n", NoffRAave, NoffDECave, NoffRAori, NoffDECori); 531 539 saveOffsets (dPos, nPos, im); 532 533 // XXX this function should probably update the average positions as well.534 540 535 541 return;
Note:
See TracChangeset
for help on using the changeset viewer.
