LSSTApplications  8.0.0.0+107,8.0.0.1+13,9.1+18,9.2,master-g084aeec0a4,master-g0aced2eed8+6,master-g15627eb03c,master-g28afc54ef9,master-g3391ba5ea0,master-g3d0fb8ae5f,master-g4432ae2e89+36,master-g5c3c32f3ec+17,master-g60f1e072bb+1,master-g6a3ac32d1b,master-g76a88a4307+1,master-g7bce1f4e06+57,master-g8ff4092549+31,master-g98e65bf68e,master-ga6b77976b1+53,master-gae20e2b580+3,master-gb584cd3397+53,master-gc5448b162b+1,master-gc54cf9771d,master-gc69578ece6+1,master-gcbf758c456+22,master-gcec1da163f+63,master-gcf15f11bcc,master-gd167108223,master-gf44c96c709
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: