IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30649


Ignore:
Timestamp:
Feb 16, 2011, 11:47:40 AM (15 years ago)
Author:
eugene
Message:

update comments to be more consistent with relastro

File:
1 edited

Legend:

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

    r30616 r30649  
    3333  struct timeval start, stop;
    3434 
    35   double RmaxSkyRegion, RminSkyRegion, DminSkyRegion, DmaxSkyRegion, RmidSkyRegion;
     35  double RmaxSkyRegion, RminSkyRegion, RmidSkyRegion, DminSkyRegion, DmaxSkyRegion;
    3636
    3737  double *RmaxSky;
     
    131131    }
    132132
    133     /* define image corners */
    134     Xi[0] = 0;            Yi[0] = 0;
    135     Xi[1] = timage[i].NX; Yi[1] = 0;
    136     Xi[2] = timage[i].NX; Yi[2] = timage[i].NY;
    137     Xi[3] = 0;            Yi[3] = timage[i].NY;
    138     Xi[4] = 0;            Yi[4] = 0;
     133    /* define image corners - note the DIS images (mosaic phu) are special */
     134    if (!strcmp(&timage[i].coords.ctype[4], "-DIS")) {
     135      Xi[0] = -0.5*timage[i].NX; Yi[0] = -0.5*timage[i].NY;
     136      Xi[1] = +0.5*timage[i].NX; Yi[1] = -0.5*timage[i].NY;
     137      Xi[2] = +0.5*timage[i].NX; Yi[2] = +0.5*timage[i].NY;
     138      Xi[3] = -0.5*timage[i].NX; Yi[3] = +0.5*timage[i].NY;
     139      Xi[4] = -0.5*timage[i].NX; Yi[4] = -0.5*timage[i].NY;
     140    } else {
     141      Xi[0] = 0;            Yi[0] = 0;
     142      Xi[1] = timage[i].NX; Yi[1] = 0;
     143      Xi[2] = timage[i].NX; Yi[2] = timage[i].NY;
     144      Xi[3] = 0;            Yi[3] = timage[i].NY;
     145      Xi[4] = 0;            Yi[4] = 0;
     146    }
    139147    found = FALSE;
    140148
    141     /* transform corners to ra,dec -- costs ~3sec for 3M images */
     149    /* transform corners to ra,dec -- costs ~3sec for 3M images (pikake) */
    142150    double RminImage = 360.0;
    143151    double RmaxImage =   0.0;
     
    147155      XY_to_RD (&Ri[j], &Di[j], Xi[j], Yi[j], &timage[i].coords);
    148156      Ri[j] = ohana_normalize_angle_to_midpoint (Ri[j], RmidSkyRegion);
    149      
     157
    150158      RminImage = MIN(RminImage, Ri[j]);
    151159      RmaxImage = MAX(RmaxImage, Ri[j]);
     
    158166        RminImage = tmp - 360.0;
    159167    }
    160    
     168
    161169    // check that this image is even in range of the searched region
    162170    if (DminImage > DmaxSkyRegion) continue;
     
    182190      tcoords.crval2 = skycoords[m].Dc;
    183191
    184       /* transform to ra,dec */
     192      /* transform corner coords to X,Y in this catalog system */
    185193      InRange = TRUE;
    186194      for (j = 0; (j < 5) && InRange; j++) {
     
    352360  return (Nlo);
    353361}
    354 
    355 off_t getRegionStopByRA (double R, double *Rref, off_t Nregions) {
    356 
    357   // use bisection to find the overlapping mosaic
    358 
    359   off_t Nlo, Nhi, N;
    360 
    361   // find the last mosaic before start
    362   Nlo = 0; Nhi = Nregions;
    363   while (Nhi - Nlo > 10) {
    364     N = 0.5*(Nlo + Nhi);
    365     if (Rref[N] < R) {
    366       Nlo = MAX(N, 0);
    367     } else {
    368       Nhi = MIN(N, Nregions);
    369     }
    370   }
    371   return (Nlo);
    372 }
Note: See TracChangeset for help on using the changeset viewer.