regionator.cc
// Computes the bounding box for the given coordinate range of the subimage.
Computes the bounding box for the given coordinate range of the subimage.
Computes the bounding box for the given coordinate range of the subimage .
void Regionator::ComputeBoundingBox(int x1, int y1, int x2, int y2,
                                    double *north, double *south, double *east,
                                    double *west) const {
  *north = dec_upper_left_ + y1 * dec_pixel_scale_;
  *south = dec_upper_left_ + y2 * dec_pixel_scale_;
  double ra = ra_upper_left_ + x1 * ra_pixel_scale_;
  double ra2 = ra_upper_left_ + x2 * ra_pixel_scale_;
  double ra_wrap = ra;
  double ra_wrap2 = ra2;
  WrapAround::RestoreWrapAround(&ra_wrap);
  WrapAround::RestoreWrapAround(&ra_wrap2);
  if (ra > ra2) {
    *east = ra_wrap - 180.0;
    *west = ra_wrap2 - 180.0;
  } else {
    *east = ra_wrap2 - 180.0;
    *west = ra - 180.0;
  }
  if (*east < *west) {
    *west -= 360.0;
  }
}
void Regionator :: ComputeBoundingBox ( int x1 , int y1 , int x2 , int y2 , double * north , double * south , double * east , double * west ) const { * north = dec_upper_left_ + y1 * dec_pixel_scale_ ; * south = dec_upper_left_ + y2 * dec_pixel_scale_ ; double ra = ra_upper_left_ + x1 * ra_pixel_scale_ ; double ra2 = ra_upper_left_ + x2 * ra_pixel_scale_ ; double ra_wrap = ra ; double ra_wrap2 = ra2 ; WrapAround :: RestoreWrapAround ( & ra_wrap ) ; WrapAround :: RestoreWrapAround ( & ra_wrap2 ) ; if ( ra > ra2 ) { * east = ra_wrap - 180.0 ; * west = ra_wrap2 - 180.0 ; } else { * east = ra_wrap2 - 180.0 ; * west = ra - 180.0 ; } if ( * east < * west ) { * west -= 360.0 ; } }
Computes the bounding box for the given coordinate range of the subimage.
Computes the bounding box for the given coordinate range of the subimage .