IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 16, 2012, 5:56:41 PM (14 years ago)
Author:
eugene
Message:

do not select all images in db for RA = 0,360; select images using the smaller of the RA ranges defined for a midpoint of 180 and 0.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120405/Ohana/src/relphot/src/select_images.c

    r33651 r33788  
    3333  struct timeval start, stop;
    3434 
    35   double RmaxSkyRegion, RminSkyRegion, RmidSkyRegion, DminSkyRegion, DmaxSkyRegion;
    36 
    3735  double *RmaxSky;
    3836  off_t *index;
     
    5957  ALLOCATE (index, off_t, skylist[0].Nregions);
    6058
    61   RminSkyRegion = +360.0;
    62   RmaxSkyRegion = -360.0;
    63   DminSkyRegion = +90.0;
    64   DmaxSkyRegion = -90.0;
     59  double RminSkyRegion = +360.0;
     60  double RmaxSkyRegion = -360.0;
     61  double DminSkyRegion = +90.0;
     62  double DmaxSkyRegion = -90.0;
    6563
    6664  D_NIMAGE = 6000;
    6765
    6866  // FILE *ftest = fopen ("relphot.dump.dat", "w");
     67
     68  // The regions have RA values in the range 0-360, which implies an RA midpoint of 180.
     69  // A patch which covers the 0,360 boundary (but not much more) needs to treat the values
     70  // as being centered on 0.0.  Run the following test with both and see which yields a
     71  // smaller contiguious patch
     72
     73  double RminSkyRegionAlt = +360.0;
     74  double RmaxSkyRegionAlt = -360.0;
    6975
    7076  /* compare with each region file */
     
    100106    DminSkyRegion = MIN(DminSkyRegion, skylist[0].regions[i][0].Dmin);
    101107    DmaxSkyRegion = MAX(DmaxSkyRegion, skylist[0].regions[i][0].Dmax);
    102   }
    103   RmidSkyRegion = 0.5*(RminSkyRegion + RmaxSkyRegion);
     108
     109    double RminAlt   = ohana_normalize_angle_to_midpoint (skylist[0].regions[i][0].Rmin, 0.0);
     110    double RmaxAlt   = ohana_normalize_angle_to_midpoint (skylist[0].regions[i][0].Rmax, 0.0);
     111    RminSkyRegionAlt = MIN(RminSkyRegionAlt, RminAlt);
     112    RmaxSkyRegionAlt = MAX(RmaxSkyRegionAlt, RmaxAlt);
     113
     114    RminSkyRegion = MIN(RminSkyRegion, skylist[0].regions[i][0].Rmin);
     115    RmaxSkyRegion = MAX(RmaxSkyRegion, skylist[0].regions[i][0].Rmax);
     116    DminSkyRegion = MIN(DminSkyRegion, skylist[0].regions[i][0].Dmin);
     117    DmaxSkyRegion = MAX(DmaxSkyRegion, skylist[0].regions[i][0].Dmax);
     118  }
     119  // use the option which gives the smaller RA range
     120  if ((RmaxSkyRegionAlt - RminSkyRegionAlt) < (RmaxSkyRegion - RminSkyRegion)) {
     121    RminSkyRegion = RminSkyRegionAlt;
     122    RmaxSkyRegion = RmaxSkyRegionAlt;
     123  }
     124 
     125  double RmidSkyRegion = 0.5*(RminSkyRegion + RmaxSkyRegion);
    104126  MARKTIME("create sky region coords: %f sec\n", dtime);
    105127
Note: See TracChangeset for help on using the changeset viewer.