IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37660


Ignore:
Timestamp:
Nov 22, 2014, 1:06:26 PM (12 years ago)
Author:
eugene
Message:

do not require frame correction tohave both SHFIT and LOCAL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140904/Ohana/src/relastro/src/FrameCorrection.c

    r37658 r37660  
    3232    free (syncfile);
    3333  }
    34   return TRUE;
     34
     35  int status = HarvestRegionHosts (regionHosts);
     36  return status;
    3537}
    3638
     
    9698
    9799  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  }
    98104
    99105  if (USE_ICRF_LOCAL) {
     
    506512  double Xave, Yave;
    507513
    508   AstromOffsetMap *map = coords->offsetMap;
     514  AstromOffsetMap *map = coords ? coords->offsetMap : NULL;
    509515
    510516  int i, j;
     
    517523      double D = average->D;
    518524
    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        }
    530539      }
    531540
    532       if (useLocal) {
     541      if (inLocalRegion) {
    533542        myAssert (map, "no local frame map defined");
    534543        double dX = AstromOffsetMapValue (map, Xave, Yave, TRUE);
     
    539548          XY_to_RD (&average->R, &average->D, Xmeas, Ymeas, coords);
    540549        }
    541       } else {
     550        continue;
     551      }
     552     
     553      if (USE_ICRF_SHFIT) {
    542554        myAssert (frame, "no frame correction defined");
    543555
Note: See TracChangeset for help on using the changeset viewer.