LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
Public Member Functions | Private Member Functions | Private Attributes | List of all members
lsst::ap::RectangularRegion Class Reference

A rectangular region (in right ascension and declination) of the unit sphere. More...

#include <RectangularRegion.h>

Public Member Functions

 RectangularRegion ()
 
 RectangularRegion (double const minRa, double const maxRa, double const minDec, double const maxDec)
 
 RectangularRegion (double const cenRa, double const cenDec, double const radius)
 
 RectangularRegion (CircularRegion const &region)
 
double getMinRa () const
 Returns the minimum right ascension of points in the region. More...
 
double getMaxRa () const
 Returns the maximum right ascension of points in the region. More...
 
double getMinDec () const
 Returns the minimum declination of points in the region. More...
 
double getMaxDec () const
 Returns the maximum declination of points in the region. More...
 

Private Member Functions

void fromCircle (double const centerRa, double const centerDec, double const radius)
 

Private Attributes

double _minRa
 
double _maxRa
 
double _minDec
 
double _maxDec
 

Detailed Description

A rectangular region (in right ascension and declination) of the unit sphere.

Definition at line 43 of file RectangularRegion.h.

Constructor & Destructor Documentation

lsst::ap::RectangularRegion::RectangularRegion ( )
inline
lsst::ap::RectangularRegion::RectangularRegion ( double const  minRa,
double const  maxRa,
double const  minDec,
double const  maxDec 
)

Definition at line 42 of file RectangularRegion.cc.

47  :
48  _minRa(minRa),
49  _maxRa(maxRa),
50  _minDec(minDec),
51  _maxDec(maxDec)
52 {
53  if (minRa < 0.0 || minRa >= 360.0 || maxRa < 0.0 || maxRa >= 360.0) {
54  throw LSST_EXCEPT(ex::RangeError,
55  "right ascension must be in range [0, 360) degrees");
56  }
57  if (minDec < -90.0 || minDec > 90.0 || maxDec < -90.0 || maxDec > 90.0) {
58  throw LSST_EXCEPT(ex::RangeError,
59  "declination must be in range [-90, 90] degrees");
60  }
61  if (maxDec < minDec) {
62  throw LSST_EXCEPT(ex::InvalidParameterError,
63  "minimum declination greater than maximum declination");
64  }
65 }
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
lsst::ap::RectangularRegion::RectangularRegion ( double const  cenRa,
double const  cenDec,
double const  radius 
)

Definition at line 68 of file RectangularRegion.cc.

72  {
73  fromCircle(centerRa, centerDec, radius);
74 }
void fromCircle(double const centerRa, double const centerDec, double const radius)
lsst::ap::RectangularRegion::RectangularRegion ( CircularRegion const &  region)
explicit

Definition at line 77 of file RectangularRegion.cc.

77  {
78  fromCircle(region.getCenterRa(), region.getCenterDec(), region.getRadius());
79 }
void fromCircle(double const centerRa, double const centerDec, double const radius)

Member Function Documentation

void lsst::ap::RectangularRegion::fromCircle ( double const  centerRa,
double const  centerDec,
double const  radius 
)
private

Definition at line 82 of file RectangularRegion.cc.

86  {
87  if (ra < 0.0 || ra >= 360.0) {
88  throw LSST_EXCEPT(ex::RangeError,
89  "right ascension must be in range [0, 360) degrees");
90  }
91  if (dec < -90.0 || dec > 90.0) {
92  throw LSST_EXCEPT(ex::RangeError,
93  "declination must be in range [-90, 90] degrees");
94  }
95  if (radius < 0.0 || radius > 90.0) {
96  throw LSST_EXCEPT(ex::RangeError,
97  "circle radius must be in range [0, 90] degrees");
98  }
99  double alpha = maxAlpha(radius, dec);
100  _minRa = ra - alpha;
101  if (_minRa < 0.0) {
102  _minRa += 360.0;
103  }
104  _maxRa = ra + alpha;
105  if (_maxRa >= 360.0) {
106  _maxRa -= 360.0;
107  }
108  _minDec = dec - radius;
109  if (_minDec < -90.0) {
110  _minDec = -90.0;
111  }
112  _maxDec = dec + radius;
113  if (_maxDec > 90.0) {
114  _maxDec = 90.0;
115  }
116 }
double maxAlpha(double const theta, double const centerDec)
Definition: SpatialUtil.cc:279
#define LSST_EXCEPT(type,...)
Definition: Exception.h:46
double alpha(double const theta, double const centerDec, double const dec)
Definition: SpatialUtil.cc:248
double lsst::ap::RectangularRegion::getMaxDec ( ) const
inline

Returns the maximum declination of points in the region.

Definition at line 80 of file RectangularRegion.h.

80  {
81  return _maxDec;
82  }
double lsst::ap::RectangularRegion::getMaxRa ( ) const
inline

Returns the maximum right ascension of points in the region.

Definition at line 70 of file RectangularRegion.h.

70  {
71  return _maxRa;
72  }
double lsst::ap::RectangularRegion::getMinDec ( ) const
inline

Returns the minimum declination of points in the region.

Definition at line 75 of file RectangularRegion.h.

75  {
76  return _minDec;
77  }
double lsst::ap::RectangularRegion::getMinRa ( ) const
inline

Returns the minimum right ascension of points in the region.

Definition at line 65 of file RectangularRegion.h.

65  {
66  return _minRa;
67  }

Member Data Documentation

double lsst::ap::RectangularRegion::_maxDec
private

Definition at line 89 of file RectangularRegion.h.

double lsst::ap::RectangularRegion::_maxRa
private

Definition at line 87 of file RectangularRegion.h.

double lsst::ap::RectangularRegion::_minDec
private

Definition at line 88 of file RectangularRegion.h.

double lsst::ap::RectangularRegion::_minRa
private

Definition at line 86 of file RectangularRegion.h.


The documentation for this class was generated from the following files: