LSSTApplications  11.0-24-g0a022a1,14.0+64,15.0,15.0+1,15.0-1-g14e9bfd,15.0-1-g1eca518,15.0-1-g499c38d,15.0-1-g60afb23,15.0-1-g6668b0b,15.0-1-g788a293,15.0-1-g82223af,15.0-1-ga91101e,15.0-1-gae1598d,15.0-1-gc45031d,15.0-1-gd076f1f,15.0-1-gf4f1c34,15.0-1-gfe1617d,15.0-16-g953e39cab,15.0-2-g2010ef9,15.0-2-g33d94b3,15.0-2-g5218728,15.0-2-g947dc0d,15.0-3-g9103c06,15.0-3-ga03b4ca,15.0-3-ga659d1f3,15.0-3-ga695220+2,15.0-3-gaec6799,15.0-3-gb7a597c,15.0-3-gd5b9ff95,15.0-4-g0478fed+2,15.0-4-g45f767a,15.0-4-gff20472+2,15.0-6-ge2d9597
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
lsst::afw::geom::RadialXYTransform Class Reference

A purely radial polynomial distortion, up to 6th order. More...

#include <XYTransform.h>

Inheritance diagram for lsst::afw::geom::RadialXYTransform:
lsst::afw::geom::XYTransform lsst::daf::base::Citizen

Public Types

typedef afw::geom::Point2D Point2D
 
typedef afw::geom::AffineTransform AffineTransform
 
enum  { magicSentinel = 0xdeadbeef }
 
typedef unsigned long memId
 Type of the block's ID. More...
 
typedef memId(* memNewCallback) (const memId cid)
 A function used to register a callback. More...
 
typedef memId(* memCallback) (const Citizen *ptr)
 

Public Member Functions

 RadialXYTransform (std::vector< double > const &coeffs)
 
 RadialXYTransform (RadialXYTransform const &)
 
 RadialXYTransform (RadialXYTransform &&)
 
RadialXYTransformoperator= (RadialXYTransform const &)
 
RadialXYTransformoperator= (RadialXYTransform &&)
 
 ~RadialXYTransform ()
 
virtual std::shared_ptr< XYTransformclone () const
 returns a deep copy More...
 
virtual std::shared_ptr< XYTransforminvert () const
 returns a "deep inverse" in this sense that the forward+inverse transforms do not share state default implementation; subclass may override More...
 
virtual Point2D forwardTransform (Point2D const &point) const
 virtuals for forward and reverse transforms More...
 
virtual Point2D reverseTransform (Point2D const &point) const
 
virtual AffineTransform linearizeForwardTransform (Point2D const &point) const
 linearized forward and reversed transforms More...
 
virtual AffineTransform linearizeReverseTransform (Point2D const &point) const
 default implementation; subclass may override More...
 
std::vector< double > getCoeffs () const
 
std::string repr () const
 Return a string representation of a Citizen. More...
 
void markPersistent (void)
 Mark a Citizen as persistent and not destroyed until process end. More...
 
memId getId () const
 Return the Citizen's ID. More...
 

Static Public Member Functions

static std::vector< double > polyInvert (std::vector< double > const &coeffs)
 These static member functions operate on polynomials represented by vector<double>. More...
 
static double polyEval (std::vector< double > const &coeffs, double x)
 
static Point2D polyEval (std::vector< double > const &coeffs, Point2D const &p)
 
static double polyEvalDeriv (std::vector< double > const &coeffs, double x)
 
static AffineTransform polyEvalJacobian (std::vector< double > const &coeffs, Point2D const &p)
 
static double polyEvalInverse (std::vector< double > const &coeffs, std::vector< double > const &icoeffs, double x)
 
static Point2D polyEvalInverse (std::vector< double > const &coeffs, std::vector< double > const &icoeffs, Point2D const &p)
 
static AffineTransform polyEvalInverseJacobian (std::vector< double > const &coeffs, std::vector< double > const &icoeffs, Point2D const &p)
 
static AffineTransform makeAffineTransform (double x, double y, double f, double g)
 
static bool hasBeenCorrupted ()
 Check all allocated blocks for corruption. More...
 
static memId getNextMemId ()
 Return the memId of the next object to be allocated. More...
 
static int init ()
 Called once when the memory system is being initialised. More...
 
Census

Provide a list of current Citizens

static int census (int, memId startingMemId=0)
 How many active Citizens are there? More...
 
static void census (std::ostream &stream, memId startingMemId=0)
 Print a list of all active Citizens to stream, sorted by ID. More...
 
static const std::vector< const Citizen * > * census ()
 Return a (newly allocated) std::vector of active Citizens sorted by ID. More...
 
callbackIDs

Set callback Ids.

The old Id is returned

static memId setNewCallbackId (memId id)
 Call the NewCallback when block is allocated. More...
 
static memId setDeleteCallbackId (memId id)
 Call the current DeleteCallback when block is deleted. More...
 
callbacks

Set the New/Delete callback functions; in each case the previously installed callback is returned.

These callback functions return a value which is Added to the previously registered id.

The default callback functions are called default{New,Delete}Callback; you may want to set a break point in these callbacks from your favourite debugger

static memNewCallback setNewCallback (memNewCallback func)
 Set the NewCallback function. More...
 
static memCallback setDeleteCallback (memCallback func)
 Set the DeleteCallback function. More...
 
static memCallback setCorruptionCallback (memCallback func)
 Set the CorruptionCallback function. More...
 

Protected Attributes

std::vector< double > _coeffs
 
std::vector< double > _icoeffs
 

Detailed Description

A purely radial polynomial distortion, up to 6th order.

Deprecated:
Deprecated in 14.0. Will be removed in 15.0; it is superseded by geom::makeRadialTransform.

forwardTransform(pt) = pt * scale where:

Warning
reverseTransform will fail if the polynomial is too far from linear (ticket #3152)
Exceptions
lsst::pex::exceptions::InvalidParameterErrorif coeffs.size() > 0 and any of the following are true: coeffs.size() == 1, coeffs[0] != 0 or coeffs[1] == 0

Definition at line 225 of file XYTransform.h.

Member Typedef Documentation

◆ AffineTransform

Definition at line 52 of file XYTransform.h.

◆ memCallback

typedef memId(* lsst::daf::base::Citizen::memCallback) (const Citizen *ptr)
inherited

Definition at line 59 of file Citizen.h.

◆ memId

typedef unsigned long lsst::daf::base::Citizen::memId
inherited

Type of the block's ID.

Definition at line 56 of file Citizen.h.

◆ memNewCallback

typedef memId(* lsst::daf::base::Citizen::memNewCallback) (const memId cid)
inherited

A function used to register a callback.

Definition at line 58 of file Citizen.h.

◆ Point2D

Definition at line 51 of file XYTransform.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
magicSentinel 

Definition at line 86 of file Citizen.h.

Constructor & Destructor Documentation

◆ RadialXYTransform() [1/3]

lsst::afw::geom::RadialXYTransform::RadialXYTransform ( std::vector< double > const &  coeffs)
Parameters
coeffsradial polynomial coefficients; if size == 0 then gives the identity transformation; otherwise must satisfy: size > 1, coeffs[0] == 0, and coeffs[1] != 0

Definition at line 37 of file RadialXYTransform.cc.

37  : XYTransform() {
38  if (coeffs.size() == 0) {
39  // constructor called with no arguments = identity transformation
40  _coeffs.resize(2);
41  _coeffs[0] = 0.0;
42  _coeffs[1] = 1.0;
43  } else {
44  if ((coeffs.size() == 1) || (coeffs[0] != 0.0) || (coeffs[1] == 0.0)) {
45  // Discontinuous or singular transformation; presumably unintentional so throw exception
47  "invalid parameters for radial distortion: need coeffs.size() != 1, "
48  "coeffs[0]==0, coeffs[1]!=0");
49  }
50  _coeffs = coeffs;
51  }
52 
54 }
std::vector< double > _coeffs
Definition: XYTransform.h:273
static std::vector< double > polyInvert(std::vector< double > const &coeffs)
These static member functions operate on polynomials represented by vector<double>.
T resize(T... args)
std::vector< double > _icoeffs
Definition: XYTransform.h:274
T size(T... args)
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46

◆ RadialXYTransform() [2/3]

lsst::afw::geom::RadialXYTransform::RadialXYTransform ( RadialXYTransform const &  )
default

◆ RadialXYTransform() [3/3]

lsst::afw::geom::RadialXYTransform::RadialXYTransform ( RadialXYTransform &&  )
default

◆ ~RadialXYTransform()

lsst::afw::geom::RadialXYTransform::~RadialXYTransform ( )
default

Member Function Documentation

◆ census() [1/3]

int lsst::daf::base::Citizen::census ( int  ,
memId  startingMemId = 0 
)
staticinherited

How many active Citizens are there?

Parameters
startingMemIdDon't print Citizens with lower IDs

Definition at line 261 of file Citizen.cc.

264  {
265  if (startingMemId == 0) { // easy
266  ReadGuard guard(citizenLock);
267  return _activeCitizens.size();
268  }
269 
270  int n = 0;
271  ReadGuard guard(citizenLock);
272  for (table::iterator cur = _activeCitizens.begin();
273  cur != _activeCitizens.end(); cur++) {
274  if (cur->first->_CitizenId >= startingMemId) {
275  n++;
276  }
277  }
278 
279  return n;
280 }
T end(T... args)
T size(T... args)
T begin(T... args)

◆ census() [2/3]

void lsst::daf::base::Citizen::census ( std::ostream stream,
memId  startingMemId = 0 
)
staticinherited

Print a list of all active Citizens to stream, sorted by ID.

Parameters
streamstream to print to
startingMemIdDon't print Citizens with lower IDs

Definition at line 284 of file Citizen.cc.

287  {
288  ReadGuard guard(citizenLock);
289 
291 
292  for (std::vector<Citizen const *>::const_iterator citizen = leaks->begin(), end = leaks->end();
293  citizen != end; ++citizen) {
294  if ((*citizen)->getId() >= startingMemId) {
295  stream << (*citizen)->repr() << "\n";
296  }
297  }
298 }
STL class.
STL class.
T begin(T... args)
int end
static const std::vector< const Citizen * > * census()
Return a (newly allocated) std::vector of active Citizens sorted by ID.
Definition: Citizen.cc:316

◆ census() [3/3]

std::vector< dafBase::Citizen const * > const * lsst::daf::base::Citizen::census ( )
staticinherited

Return a (newly allocated) std::vector of active Citizens sorted by ID.

You are responsible for deleting it; or you can say std::unique_ptr<std::vector<Citizen const*> const> leaks(Citizen::census()); and not bother (that becomes std::unique_ptr in C++11)

Definition at line 316 of file Citizen.cc.

316  {
319  ReadGuard guard(citizenLock);
320  vec->reserve(_activeCitizens.size());
321 
322  for (table::iterator cur = _activeCitizens.begin();
323  cur != _activeCitizens.end(); cur++) {
324  vec->push_back(dynamic_cast<Citizen const*>(cur->first));
325  }
326 
327  std::sort(vec->begin(), vec->end(), cmpId);
328 
329  return vec;
330 }
T end(T... args)
T push_back(T... args)
T size(T... args)
STL class.
T begin(T... args)
T sort(T... args)
T reserve(T... args)

◆ clone()

std::shared_ptr< XYTransform > lsst::afw::geom::RadialXYTransform::clone ( ) const
virtual

returns a deep copy

Implements lsst::afw::geom::XYTransform.

Definition at line 62 of file RadialXYTransform.cc.

62  {
63  return std::make_shared<RadialXYTransform>(_coeffs);
64 }
std::vector< double > _coeffs
Definition: XYTransform.h:273

◆ forwardTransform()

Point2D lsst::afw::geom::RadialXYTransform::forwardTransform ( Point2D const &  point) const
virtual

virtuals for forward and reverse transforms

These routines are responsible for throwing exceptions if the 'point' arg is outside the domain of the transform.

Implements lsst::afw::geom::XYTransform.

Definition at line 70 of file RadialXYTransform.cc.

70 { return polyEval(_coeffs, p); }
std::vector< double > _coeffs
Definition: XYTransform.h:273
static double polyEval(std::vector< double > const &coeffs, double x)

◆ getCoeffs()

std::vector<double> lsst::afw::geom::RadialXYTransform::getCoeffs ( ) const
inline

Definition at line 246 of file XYTransform.h.

246 { return _coeffs; }
std::vector< double > _coeffs
Definition: XYTransform.h:273

◆ getId()

dafBase::Citizen::memId lsst::daf::base::Citizen::getId ( ) const
inherited

Return the Citizen's ID.

Definition at line 218 of file Citizen.cc.

218  {
219  return _CitizenId;
220 }

◆ getNextMemId()

dafBase::Citizen::memId lsst::daf::base::Citizen::getNextMemId ( )
staticinherited

Return the memId of the next object to be allocated.

Definition at line 223 of file Citizen.cc.

223  {
224  return _nextMemId();
225 }

◆ hasBeenCorrupted()

bool lsst::daf::base::Citizen::hasBeenCorrupted ( )
staticinherited

Check all allocated blocks for corruption.

Definition at line 347 of file Citizen.cc.

347  {
348  ReadGuard guard(citizenLock);
349  for (table::iterator cur = _activeCitizens.begin();
350  cur != _activeCitizens.end(); cur++) {
351  if (cur->first->_hasBeenCorrupted()) {
352  return true;
353  }
354  }
355  for (table::iterator cur = _persistentCitizens.begin();
356  cur != _persistentCitizens.end(); cur++) {
357  if (cur->first->_hasBeenCorrupted()) {
358  return true;
359  }
360  }
361 
362  return false;
363 }
T end(T... args)
T begin(T... args)

◆ init()

int lsst::daf::base::Citizen::init ( )
staticinherited

Called once when the memory system is being initialised.

Definition at line 208 of file Citizen.cc.

208  {
209  volatile int dummy = 1;
210  return dummy;
211 }

◆ invert()

std::shared_ptr< XYTransform > lsst::afw::geom::RadialXYTransform::invert ( ) const
virtual

returns a "deep inverse" in this sense that the forward+inverse transforms do not share state default implementation; subclass may override

Reimplemented from lsst::afw::geom::XYTransform.

Definition at line 66 of file RadialXYTransform.cc.

66  {
67  return std::make_shared<RadialXYTransform>(_coeffs);
68 }
std::vector< double > _coeffs
Definition: XYTransform.h:273

◆ linearizeForwardTransform()

AffineTransform lsst::afw::geom::RadialXYTransform::linearizeForwardTransform ( Point2D const &  point) const
virtual

linearized forward and reversed transforms

Deprecated:
Deprecated in 14.0. Will be removed in 15.0; it is superseded by geom::linearizeTransform.

These are virtual but not pure virtual; there is a default implementation which calls forwardTransform() or reverseTransform() and takes finite differences with step size equal to one.

The following should always be satisfied for an arbitrary Point2D p (and analogously for the reverse transform) this->forwardTransform(p) == this->linearizeForwardTransform(p)(p);default implementation; subclass may override

Reimplemented from lsst::afw::geom::XYTransform.

Definition at line 76 of file RadialXYTransform.cc.

76  {
77  return polyEvalJacobian(_coeffs, p);
78 }
std::vector< double > _coeffs
Definition: XYTransform.h:273
static AffineTransform polyEvalJacobian(std::vector< double > const &coeffs, Point2D const &p)

◆ linearizeReverseTransform()

AffineTransform lsst::afw::geom::RadialXYTransform::linearizeReverseTransform ( Point2D const &  point) const
virtual

default implementation; subclass may override

Reimplemented from lsst::afw::geom::XYTransform.

Definition at line 80 of file RadialXYTransform.cc.

80  {
82 }
std::vector< double > _coeffs
Definition: XYTransform.h:273
std::vector< double > _icoeffs
Definition: XYTransform.h:274
static AffineTransform polyEvalInverseJacobian(std::vector< double > const &coeffs, std::vector< double > const &icoeffs, Point2D const &p)

◆ makeAffineTransform()

AffineTransform lsst::afw::geom::RadialXYTransform::makeAffineTransform ( double  x,
double  y,
double  f,
double  g 
)
static

Definition at line 220 of file RadialXYTransform.cc.

220  {
221  double r = ::hypot(x, y);
222 
223  if (r <= 0.0) {
224  AffineTransform ret;
225  ret[0] = ret[3] = rderiv; // ret = rderiv * (identity)
226  return ret;
227  }
228 
229  //
230  // Note: calculation of "t" is numerically unstable as r->0, since p'(r) and p(r)/r will be
231  // nearly equal. However, detailed analysis shows that this is actually OK. The numerical
232  // instability means that the roundoff error in t is O(10^{-17}) even though t is formally O(r).
233  //
234  // Propagating through the formulas below, the AffineTransform is
235  // [rderiv*I + O(r) + O(10^{-17})] which is fine (assuming rderiv is nonzero as r->0).
236  //
237  double t = rderiv - rnew / r;
238 
239  AffineTransform ret;
240  ret[0] = (rderiv * x * x + rnew / r * y * y) / (r * r); // a00
241  ret[1] = ret[2] = t * x * y / (r * r); // a01 == a10 for this transform
242  ret[3] = (rderiv * y * y + rnew / r * x * x) / (r * r); // a11
243  ret[4] = -t * x; // v0
244  ret[5] = -t * y; // v1
245  return ret;
246 }
int y
Definition: SpanSet.cc:43
afw::geom::AffineTransform AffineTransform
Definition: XYTransform.h:52
double x

◆ markPersistent()

void lsst::daf::base::Citizen::markPersistent ( void  )
inherited

Mark a Citizen as persistent and not destroyed until process end.

Definition at line 248 of file Citizen.cc.

248  {
249  WriteGuard guard(citizenLock);
250  _persistentCitizens[this] = _activeCitizens[this];
251  _activeCitizens.erase(this);
252 }
T erase(T... args)

◆ operator=() [1/2]

RadialXYTransform & lsst::afw::geom::RadialXYTransform::operator= ( RadialXYTransform const &  )
default

◆ operator=() [2/2]

RadialXYTransform & lsst::afw::geom::RadialXYTransform::operator= ( RadialXYTransform &&  )
default

◆ polyEval() [1/2]

double lsst::afw::geom::RadialXYTransform::polyEval ( std::vector< double > const &  coeffs,
double  x 
)
static

Definition at line 136 of file RadialXYTransform.cc.

136  {
137  int n = coeffs.size();
138 
139  double ret = 0.0;
140  for (int i = n - 1; i >= 0; i--) ret = ret * x + coeffs[i];
141 
142  return ret;
143 }
double x
T size(T... args)

◆ polyEval() [2/2]

Point2D lsst::afw::geom::RadialXYTransform::polyEval ( std::vector< double > const &  coeffs,
Point2D const &  p 
)
static

Definition at line 145 of file RadialXYTransform.cc.

145  {
146  double r = p.asEigen().norm();
147 
148  if (r > 0.0) {
149  double rnew = polyEval(coeffs, r);
150  return Point2D(rnew * p.getX() / r, rnew * p.getY() / r);
151  }
152 
153  if (coeffs.size() == 0 || coeffs[0] != 0.0) {
154  throw LSST_EXCEPT(pexEx::InvalidParameterError, "invalid parameters for radial distortion");
155  }
156 
157  return Point2D(0, 0);
158 }
static double polyEval(std::vector< double > const &coeffs, double x)
T size(T... args)
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
afw::geom::Point2D Point2D
Definition: XYTransform.h:51

◆ polyEvalDeriv()

double lsst::afw::geom::RadialXYTransform::polyEvalDeriv ( std::vector< double > const &  coeffs,
double  x 
)
static

Definition at line 160 of file RadialXYTransform.cc.

160  {
161  int n = coeffs.size();
162 
163  double ret = 0.0;
164  for (int i = n - 1; i >= 1; i--) ret = ret * x + i * coeffs[i];
165 
166  return ret;
167 }
double x
T size(T... args)

◆ polyEvalInverse() [1/2]

double lsst::afw::geom::RadialXYTransform::polyEvalInverse ( std::vector< double > const &  coeffs,
std::vector< double > const &  icoeffs,
double  x 
)
static

Definition at line 176 of file RadialXYTransform.cc.

177  {
178  static const int maxIter = 1000;
179  double tolerance = 1.0e-14 * x;
180 
181  double r = polyEval(icoeffs, x); // initial guess
182  int iter = 0;
183 
184  for (;;) {
185  double dx = x - polyEval(coeffs, r); // residual
186  if (fabs(dx) <= tolerance) return r;
187  if (iter++ > maxIter) {
189  "max iteration count exceeded in RadialXYTransform::polyEvalInverse");
190  }
191  r += dx / polyEvalDeriv(coeffs, r); // Newton-Raphson iteration
192  }
193 }
static double polyEvalDeriv(std::vector< double > const &coeffs, double x)
static double polyEval(std::vector< double > const &coeffs, double x)
T fabs(T... args)
double x
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46

◆ polyEvalInverse() [2/2]

Point2D lsst::afw::geom::RadialXYTransform::polyEvalInverse ( std::vector< double > const &  coeffs,
std::vector< double > const &  icoeffs,
Point2D const &  p 
)
static

Definition at line 195 of file RadialXYTransform.cc.

196  {
197  double r = p.asEigen().norm();
198 
199  if (r > 0.0) {
200  double rnew = polyEvalInverse(coeffs, icoeffs, r);
201  return Point2D(rnew * p.getX() / r, rnew * p.getY() / r);
202  }
203 
204  if (coeffs.size() == 0 || coeffs[0] != 0.0) {
205  throw LSST_EXCEPT(pexEx::InvalidParameterError, "invalid parameters for radial distortion");
206  }
207 
208  return Point2D(0, 0);
209 }
T size(T... args)
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
static double polyEvalInverse(std::vector< double > const &coeffs, std::vector< double > const &icoeffs, double x)
afw::geom::Point2D Point2D
Definition: XYTransform.h:51

◆ polyEvalInverseJacobian()

AffineTransform lsst::afw::geom::RadialXYTransform::polyEvalInverseJacobian ( std::vector< double > const &  coeffs,
std::vector< double > const &  icoeffs,
Point2D const &  p 
)
static

Definition at line 211 of file RadialXYTransform.cc.

213  {
214  double r = p.asEigen().norm();
215  double rnew = polyEvalInverse(coeffs, icoeffs, r);
216  double rderiv = 1.0 / polyEvalDeriv(coeffs, rnew);
217  return makeAffineTransform(p.getX(), p.getY(), rnew, rderiv);
218 }
static double polyEvalDeriv(std::vector< double > const &coeffs, double x)
static AffineTransform makeAffineTransform(double x, double y, double f, double g)
static double polyEvalInverse(std::vector< double > const &coeffs, std::vector< double > const &icoeffs, double x)

◆ polyEvalJacobian()

AffineTransform lsst::afw::geom::RadialXYTransform::polyEvalJacobian ( std::vector< double > const &  coeffs,
Point2D const &  p 
)
static

Definition at line 169 of file RadialXYTransform.cc.

169  {
170  double r = p.asEigen().norm();
171  double rnew = polyEval(coeffs, r);
172  double rderiv = polyEvalDeriv(coeffs, r);
173  return makeAffineTransform(p.getX(), p.getY(), rnew, rderiv);
174 }
static double polyEvalDeriv(std::vector< double > const &coeffs, double x)
static AffineTransform makeAffineTransform(double x, double y, double f, double g)
static double polyEval(std::vector< double > const &coeffs, double x)

◆ polyInvert()

std::vector< double > lsst::afw::geom::RadialXYTransform::polyInvert ( std::vector< double > const &  coeffs)
static

These static member functions operate on polynomials represented by vector<double>.

They are intended mainly as helpers for the virtual member functions above, but are declared public since there are also some unit tests which call them.

Definition at line 95 of file RadialXYTransform.cc.

95  {
96  static const unsigned int maxN = 7; // degree of output polynomial + 1
97 
98  //
99  // Some sanity checks. The formulas for the inversion below assume c0 == 0 and c1 != 0
100  //
101  if (coeffs.size() <= 1 || coeffs.size() > maxN || coeffs[0] != 0.0 || coeffs[1] == 0.0)
103  "invalid parameters in RadialXYTransform::polyInvert");
104 
105  std::vector<double> c = coeffs;
106  c.resize(maxN, 0.0);
107 
108  std::vector<double> ic(maxN);
109 
110  ic[0] = 0.0;
111 
112  ic[1] = 1.0;
113  ic[1] /= c[1];
114 
115  ic[2] = -c[2];
116  ic[2] /= std::pow(c[1], 3);
117 
118  ic[3] = 2.0 * c[2] * c[2] - c[1] * c[3];
119  ic[3] /= std::pow(c[1], 5);
120 
121  ic[4] = 5.0 * c[1] * c[2] * c[3] - 5.0 * c[2] * c[2] * c[2] - c[1] * c[1] * c[4];
122  ic[4] /= std::pow(c[1], 7);
123 
124  ic[5] = 6.0 * c[1] * c[1] * c[2] * c[4] + 3.0 * c[1] * c[1] * c[3] * c[3] - c[1] * c[1] * c[1] * c[5] +
125  14.0 * std::pow(c[2], 4) - 21.0 * c[1] * c[2] * c[2] * c[3];
126  ic[5] /= std::pow(c[1], 9);
127 
128  ic[6] = 7.0 * c[1] * c[1] * c[1] * c[2] * c[5] + 84.0 * c[1] * c[2] * c[2] * c[2] * c[3] +
129  7.0 * c[1] * c[1] * c[1] * c[3] * c[4] - 28.0 * c[1] * c[1] * c[2] * c[3] * c[3] -
130  std::pow(c[1], 4) * c[6] - 28.0 * c[1] * c[1] * c[2] * c[2] * c[4] - 42.0 * std::pow(c[2], 5);
131  ic[6] /= std::pow(c[1], 11);
132 
133  return ic;
134 }
T resize(T... args)
T size(T... args)
#define LSST_EXCEPT(type,...)
Create an exception with a given type and message and optionally other arguments (dependent on the ty...
Definition: Exception.h:46
T pow(T... args)

◆ repr()

std::string lsst::daf::base::Citizen::repr ( ) const
inherited

Return a string representation of a Citizen.

Definition at line 239 of file Citizen.cc.

239  {
240  return boost::str(boost::format("%d: %08x %s")
241  % _CitizenId
242  % this
243  % lsst::utils::demangleType(_typeName)
244  );
245 }
std::string demangleType(std::string const _typeName)
Definition: Demangle.cc:113
def format(config, name=None, writeSourceLine=True, prefix="", verbose=False)
Definition: history.py:134

◆ reverseTransform()

Point2D lsst::afw::geom::RadialXYTransform::reverseTransform ( Point2D const &  point) const
virtual

Implements lsst::afw::geom::XYTransform.

Definition at line 72 of file RadialXYTransform.cc.

72  {
73  return polyEvalInverse(_coeffs, _icoeffs, p);
74 }
std::vector< double > _coeffs
Definition: XYTransform.h:273
std::vector< double > _icoeffs
Definition: XYTransform.h:274
static double polyEvalInverse(std::vector< double > const &coeffs, std::vector< double > const &icoeffs, double x)

◆ setCorruptionCallback()

dafBase::Citizen::memCallback lsst::daf::base::Citizen::setCorruptionCallback ( Citizen::memCallback  func)
staticinherited

Set the CorruptionCallback function.

Parameters
funcfunction be called when block is found to be corrupted

Definition at line 426 of file Citizen.cc.

428  {
429  Citizen::memCallback old = _corruptionCallback;
430  _corruptionCallback = func;
431 
432  return old;
433 }
memId(* memCallback)(const Citizen *ptr)
Definition: Citizen.h:59

◆ setDeleteCallback()

dafBase::Citizen::memCallback lsst::daf::base::Citizen::setDeleteCallback ( Citizen::memCallback  func)
staticinherited

Set the DeleteCallback function.

Parameters
funcfunction be called when desired block is deleted

Definition at line 416 of file Citizen.cc.

418  {
419  Citizen::memCallback old = _deleteCallback;
420  _deleteCallback = func;
421 
422  return old;
423 }
memId(* memCallback)(const Citizen *ptr)
Definition: Citizen.h:59

◆ setDeleteCallbackId()

dafBase::Citizen::memId lsst::daf::base::Citizen::setDeleteCallbackId ( Citizen::memId  id)
staticinherited

Call the current DeleteCallback when block is deleted.

Parameters
idDesired ID

Definition at line 381 of file Citizen.cc.

383  {
384  WriteGuard guard(citizenLock);
385  Citizen::memId oldId = _deleteId;
386  _deleteId = id;
387 
388  return oldId;
389 }
unsigned long memId
Type of the block&#39;s ID.
Definition: Citizen.h:56
int id
Definition: CR.cc:155

◆ setNewCallback()

dafBase::Citizen::memNewCallback lsst::daf::base::Citizen::setNewCallback ( Citizen::memNewCallback  func)
staticinherited

Set the NewCallback function.

Parameters
funcThe new function to be called when a designated block is allocated

Definition at line 406 of file Citizen.cc.

408  {
409  Citizen::memNewCallback old = _newCallback;
410  _newCallback = func;
411 
412  return old;
413 }
memId(* memNewCallback)(const memId cid)
A function used to register a callback.
Definition: Citizen.h:58

◆ setNewCallbackId()

dafBase::Citizen::memId lsst::daf::base::Citizen::setNewCallbackId ( Citizen::memId  id)
staticinherited

Call the NewCallback when block is allocated.

Parameters
idDesired ID

Definition at line 370 of file Citizen.cc.

372  {
373  WriteGuard guard(citizenLock);
374  Citizen::memId oldId = _newId;
375  _newId = id;
376 
377  return oldId;
378 }
unsigned long memId
Type of the block&#39;s ID.
Definition: Citizen.h:56
int id
Definition: CR.cc:155

Member Data Documentation

◆ _coeffs

std::vector<double> lsst::afw::geom::RadialXYTransform::_coeffs
protected

Definition at line 273 of file XYTransform.h.

◆ _icoeffs

std::vector<double> lsst::afw::geom::RadialXYTransform::_icoeffs
protected

Definition at line 274 of file XYTransform.h.


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