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 | Public Attributes | List of all members
lsst::ap::Ellipse< DataT > Class Template Reference

Contains spatial information for a single ellipse on the unit sphere (sky). More...

#include <EllipseTypes.h>

Public Member Functions

 Ellipse (DataT &data)
 
bool contains (double const x, double const y, double const z) const
 Returns true if the ellipse contains the given unit vector. More...
 

Public Attributes

DataT * _data
 pointer to data object (not owned by this object!) More...
 
Ellipse_next
 pointer to next active ellipse in search More...
 
int _minZone
 minimum zone of ellipse bounding-box More...
 
int _maxZone
 maximum zone of ellipse bounding-box More...
 
boost::uint32_t _ra
 right ascension of ellipse center More...
 
boost::uint32_t _deltaRa
 width (in right ascension) of ellipse More...
 
boost::int32_t _minDec
 minimum declination of ellipse bounding-box More...
 
boost::int32_t _maxDec
 maximum declination of ellipse bounding-box More...
 
double _sinDec
 sine of ellipse center dec More...
 
double _cosDec
 cosine of ellipse center dec More...
 
double _sinRa
 sine of ellipse center ra More...
 
double _cosRa
 cosine of ellipse center ra More...
 
double _sinPa
 sine of ellipse position angle More...
 
double _cosPa
 cosine of ellipse position angle More...
 
double _invMinor2
 1/(smia*smia), where smia is the ellipse semi-minor axis length (rad) More...
 
double _invMajor2
 1/(smaa*smaa), where smaa is the ellipse semi-major axis length (rad) More...
 

Detailed Description

template<typename DataT>
class lsst::ap::Ellipse< DataT >

Contains spatial information for a single ellipse on the unit sphere (sky).

A pointer to the actual data object gives access to ancillary fields.

Definition at line 52 of file EllipseTypes.h.

Constructor & Destructor Documentation

template<typename DataT >
lsst::ap::Ellipse< DataT >::Ellipse ( DataT &  data)
explicit

Definition at line 47 of file EllipseTypes.cc.

47  {
48  double ra = data.getRa();
49  double dec = data.getDec();
50  double pa = data.getPositionAngle();
51  double smia = data.getSemiMinorAxisLength()/3600.0;
52  double smaa = data.getSemiMajorAxisLength()/3600.0;
53  _data = &data;
54  _next = 0;
55  _ra = raToScaledInteger(ra);
57  // Note - this actually computes the min/max dec of the ellipses bounding circle
58  double d = dec - smaa;
59  _minDec = decToScaledInteger(d <= -90.0 ? -90.0 : d);
60  d = dec + smaa;
61  _maxDec = decToScaledInteger(d >= 90.0 ? 90.0 : d);
62  ra = radians(ra);
63  dec = radians(dec);
64  pa = radians(pa);
65  _sinDec = std::sin(dec);
66  _cosDec = std::cos(dec);
67  _sinRa = std::sin(ra);
68  _cosRa = std::cos(ra);
69  _sinPa = std::sin(pa);
70  _cosPa = std::cos(pa);
71  smia = radians(smia);
72  smaa = radians(smaa);
73  _invMinor2 = 1.0/(smia*smia);
74  _invMajor2 = 1.0/(smaa*smaa);
75 }
double _cosDec
cosine of ellipse center dec
Definition: EllipseTypes.h:66
double _sinRa
sine of ellipse center ra
Definition: EllipseTypes.h:67
boost::uint32_t deltaRaToScaledInteger(double const delta)
Definition: SpatialUtil.h:258
AngleUnit const radians
constant with units of radians
Definition: Angle.h:91
boost::uint32_t _deltaRa
width (in right ascension) of ellipse
Definition: EllipseTypes.h:61
boost::int32_t _minDec
minimum declination of ellipse bounding-box
Definition: EllipseTypes.h:62
double _sinDec
sine of ellipse center dec
Definition: EllipseTypes.h:65
boost::uint32_t raToScaledInteger(double const ra)
Definition: SpatialUtil.h:251
double _sinPa
sine of ellipse position angle
Definition: EllipseTypes.h:69
boost::int32_t decToScaledInteger(double const dec)
Definition: SpatialUtil.h:264
int d
Definition: KDTree.cc:89
boost::uint32_t _ra
right ascension of ellipse center
Definition: EllipseTypes.h:60
DataT * _data
pointer to data object (not owned by this object!)
Definition: EllipseTypes.h:55
double maxAlpha(double const theta, double const centerDec)
Definition: SpatialUtil.cc:279
double _invMajor2
1/(smaa*smaa), where smaa is the ellipse semi-major axis length (rad)
Definition: EllipseTypes.h:72
Ellipse * _next
pointer to next active ellipse in search
Definition: EllipseTypes.h:56
boost::int32_t _maxDec
maximum declination of ellipse bounding-box
Definition: EllipseTypes.h:63
double _invMinor2
1/(smia*smia), where smia is the ellipse semi-minor axis length (rad)
Definition: EllipseTypes.h:71
double _cosPa
cosine of ellipse position angle
Definition: EllipseTypes.h:70
double _cosRa
cosine of ellipse center ra
Definition: EllipseTypes.h:68

Member Function Documentation

template<typename DataT>
bool lsst::ap::Ellipse< DataT >::contains ( double const  x,
double const  y,
double const  z 
) const
inline

Returns true if the ellipse contains the given unit vector.

Definition at line 77 of file EllipseTypes.h.

77  {
78  // get coords of input point in (N,E) basis
79  double xne = _cosDec*z - _sinDec*(_sinRa*y + _cosRa*x);
80  double yne = _cosRa*y - _sinRa*x;
81  // rotate by negated position angle
82  double xr = _sinPa*yne + _cosPa*xne;
83  double yr = _cosPa*yne - _sinPa*xne;
84  // now in position to use standard 2D axis-aligned formulation for an ellipse
85  return (xr*xr*_invMajor2 + yr*yr*_invMinor2 <= 1.0);
86  }
int y
double _cosDec
cosine of ellipse center dec
Definition: EllipseTypes.h:66
double _sinRa
sine of ellipse center ra
Definition: EllipseTypes.h:67
double _sinDec
sine of ellipse center dec
Definition: EllipseTypes.h:65
double _sinPa
sine of ellipse position angle
Definition: EllipseTypes.h:69
double _invMajor2
1/(smaa*smaa), where smaa is the ellipse semi-major axis length (rad)
Definition: EllipseTypes.h:72
int x
double _invMinor2
1/(smia*smia), where smia is the ellipse semi-minor axis length (rad)
Definition: EllipseTypes.h:71
double _cosPa
cosine of ellipse position angle
Definition: EllipseTypes.h:70
double _cosRa
cosine of ellipse center ra
Definition: EllipseTypes.h:68

Member Data Documentation

template<typename DataT>
double lsst::ap::Ellipse< DataT >::_cosDec

cosine of ellipse center dec

Definition at line 66 of file EllipseTypes.h.

template<typename DataT>
double lsst::ap::Ellipse< DataT >::_cosPa

cosine of ellipse position angle

Definition at line 70 of file EllipseTypes.h.

template<typename DataT>
double lsst::ap::Ellipse< DataT >::_cosRa

cosine of ellipse center ra

Definition at line 68 of file EllipseTypes.h.

template<typename DataT>
DataT* lsst::ap::Ellipse< DataT >::_data

pointer to data object (not owned by this object!)

Definition at line 55 of file EllipseTypes.h.

template<typename DataT>
boost::uint32_t lsst::ap::Ellipse< DataT >::_deltaRa

width (in right ascension) of ellipse

Definition at line 61 of file EllipseTypes.h.

template<typename DataT>
double lsst::ap::Ellipse< DataT >::_invMajor2

1/(smaa*smaa), where smaa is the ellipse semi-major axis length (rad)

Definition at line 72 of file EllipseTypes.h.

template<typename DataT>
double lsst::ap::Ellipse< DataT >::_invMinor2

1/(smia*smia), where smia is the ellipse semi-minor axis length (rad)

Definition at line 71 of file EllipseTypes.h.

template<typename DataT>
boost::int32_t lsst::ap::Ellipse< DataT >::_maxDec

maximum declination of ellipse bounding-box

Definition at line 63 of file EllipseTypes.h.

template<typename DataT>
int lsst::ap::Ellipse< DataT >::_maxZone

maximum zone of ellipse bounding-box

Definition at line 59 of file EllipseTypes.h.

template<typename DataT>
boost::int32_t lsst::ap::Ellipse< DataT >::_minDec

minimum declination of ellipse bounding-box

Definition at line 62 of file EllipseTypes.h.

template<typename DataT>
int lsst::ap::Ellipse< DataT >::_minZone

minimum zone of ellipse bounding-box

Definition at line 58 of file EllipseTypes.h.

template<typename DataT>
Ellipse* lsst::ap::Ellipse< DataT >::_next

pointer to next active ellipse in search

Definition at line 56 of file EllipseTypes.h.

template<typename DataT>
boost::uint32_t lsst::ap::Ellipse< DataT >::_ra

right ascension of ellipse center

Definition at line 60 of file EllipseTypes.h.

template<typename DataT>
double lsst::ap::Ellipse< DataT >::_sinDec

sine of ellipse center dec

Definition at line 65 of file EllipseTypes.h.

template<typename DataT>
double lsst::ap::Ellipse< DataT >::_sinPa

sine of ellipse position angle

Definition at line 69 of file EllipseTypes.h.

template<typename DataT>
double lsst::ap::Ellipse< DataT >::_sinRa

sine of ellipse center ra

Definition at line 67 of file EllipseTypes.h.


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