Changeset 37660
- Timestamp:
- Nov 22, 2014, 1:06:26 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FrameCorrection.c
r37658 r37660 32 32 free (syncfile); 33 33 } 34 return TRUE; 34 35 int status = HarvestRegionHosts (regionHosts); 36 return status; 35 37 } 36 38 … … 96 98 97 99 FrameCorrectionSet *set = FrameCorrectionSetInit(); 100 if (!USE_ICRF_LOCAL && !USE_ICRF_SHFIT) { 101 fprintf (stderr, "ERROR: no ICRF correction mode selected\n"); 102 exit (0); 103 } 98 104 99 105 if (USE_ICRF_LOCAL) { … … 506 512 double Xave, Yave; 507 513 508 AstromOffsetMap *map = coords ->offsetMap;514 AstromOffsetMap *map = coords ? coords->offsetMap : NULL; 509 515 510 516 int i, j; … … 517 523 double D = average->D; 518 524 519 myAssert (coords, "no local frame coords defined"); 520 521 // this local correction is defined for (Rmin < R < Rmax, Dmin < D < Dmax) 522 int useLocal = RD_to_XY (&Xave, &Yave, R, D, coords); 523 if (USE_ICRF_POLE) { 524 useLocal = (D > 85.0); 525 } else { 526 useLocal = (useLocal && (Xave > 0.0)); 527 useLocal = (useLocal && (Xave < map->Nx)); 528 useLocal = (useLocal && (Yave > 0.0)); 529 useLocal = (useLocal && (Yave < map->Ny)); 525 int inLocalRegion = FALSE; 526 if (USE_ICRF_LOCAL) { 527 myAssert (coords, "no local frame coords defined"); 528 529 // this local correction is defined for (Rmin < R < Rmax, Dmin < D < Dmax) 530 inLocalRegion = RD_to_XY (&Xave, &Yave, R, D, coords); 531 if (USE_ICRF_POLE) { 532 inLocalRegion = (D > 85.0); 533 } else { 534 inLocalRegion = (inLocalRegion && (Xave > 0.0)); 535 inLocalRegion = (inLocalRegion && (Xave < map->Nx)); 536 inLocalRegion = (inLocalRegion && (Yave > 0.0)); 537 inLocalRegion = (inLocalRegion && (Yave < map->Ny)); 538 } 530 539 } 531 540 532 if ( useLocal) {541 if (inLocalRegion) { 533 542 myAssert (map, "no local frame map defined"); 534 543 double dX = AstromOffsetMapValue (map, Xave, Yave, TRUE); … … 539 548 XY_to_RD (&average->R, &average->D, Xmeas, Ymeas, coords); 540 549 } 541 } else { 550 continue; 551 } 552 553 if (USE_ICRF_SHFIT) { 542 554 myAssert (frame, "no frame correction defined"); 543 555
Note:
See TracChangeset
for help on using the changeset viewer.
