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

A list of ellipses, implemented using std::vector. More...

#include <EllipseTypes.h>

Inheritance diagram for lsst::ap::EllipseList< DataT >:

Public Member Functions

 EllipseList ()
 
 EllipseList (DataT *const begin, DataT *const end)
 
void prepareForMatch (ZoneStripeChunkDecomposition const &zsc)
 

Additional Inherited Members

- Public Attributes inherited from std::vector< T >
elements
 STL member. More...
 

Detailed Description

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

A list of ellipses, implemented using std::vector.

Supports the in-ellipse cross matching algorithms.

Definition at line 141 of file EllipseTypes.h.

Constructor & Destructor Documentation

template<typename DataT>
lsst::ap::EllipseList< DataT >::EllipseList ( )
inline

Definition at line 143 of file EllipseTypes.h.

143 : std::vector<Ellipse<DataT> >() {}
template<typename DataT >
lsst::ap::EllipseList< DataT >::EllipseList ( DataT *const  begin,
DataT *const  end 
)

Creates a list of ellipses from the given data objects.

Definition at line 81 of file EllipseTypes.cc.

82  : std::vector<Ellipse<DataT> >()
83 {
84  std::ptrdiff_t const n = end - begin;
85  for (std::ptrdiff_t i = 0; i < n; ++i) {
86  push_back(Ellipse<DataT>(begin[i]));
87  }
88 }

Member Function Documentation

template<typename DataT >
void lsst::ap::EllipseList< DataT >::prepareForMatch ( ZoneStripeChunkDecomposition const &  zsc)

Prepares the list of ellipses for matching against a list of positions – finds zone bounds for each ellipse and sorts them in order of minimum zone.

Definition at line 95 of file EllipseTypes.cc.

95  {
96  typedef typename std::vector<DataT>::size_type size_type;
97  size_type const sz = this->size();
98 
99  // find min and max zone for each ellipse
100  for (size_type i = 0; i < sz; ++i) {
101  Ellipse<DataT> & e = this->operator[](i);
102  double dec = e._data->getDec();
103  double smaa = e._data->getSemiMajorAxisLength();
104  // Note - this actually computes the min/max zone of the ellipses bounding circle
105  double d = dec - smaa;
106  e._minZone = zsc.decToZone(d <= -90.0 ? -90.0 : d);
107  d = dec + smaa;
108  e._maxZone = zsc.decToZone(d >= 90.0 ? 90.0 : d);
109  e._next = 0;
110  }
111 
112  if (sz > 1) {
113  // indirect sort on min zone
114  boost::scoped_array<Ellipse<DataT> *> pointers(new Ellipse<DataT> *[sz]);
115  for (size_type i = 0; i < sz; ++i) {
116  pointers[i] = &this->operator[](i);
117  }
118  std::sort(pointers.get(), pointers.get() + sz, EllipsePtrLessThan<DataT>());
119  // copy ellipses into new array in sorted order
120  std::vector<Ellipse<DataT> > ellipses;
121  ellipses.reserve(sz);
122  for (size_type i = 0; i < sz; ++i) {
123  ellipses.push_back(*pointers[i]);
124  }
125  // replace old array with new sorted one
126  this->swap(ellipses);
127  }
128 }
void swap(Ellipse< DataT > &a, Ellipse< DataT > &b)
Definition: EllipseTypes.h:90
int d
Definition: KDTree.cc:89

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