LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Types | Public Member Functions | List of all members
lsst::meas::extensions::trailedSources::VeresModel Class Referencefinal

Implementation of an axisymmetric 2D Gaussian convolved with a line – a model for a fast-moving, trailed-source (Veres et al. More...

#include <VeresModel.h>

Public Types

using ImageF = afw::image::Image< float >
 
using ExposureF = afw::image::Exposure< float >
 

Public Member Functions

 VeresModel (ExposureF const &data)
 Constructor for VeresModel. More...
 
 VeresModel (VeresModel const &)=default
 
 VeresModel (VeresModel &&)=default
 
VeresModeloperator= (VeresModel const &)=default
 
VeresModeloperator= (VeresModel &&)=default
 
 ~VeresModel ()=default
 
double operator() (std::vector< double > const &params) const
 Compute chi-squared of the model given the data. More...
 
std::vector< double > gradient (std::vector< double > const &params) const
 Compute the gradient of chi-squared of the model given the data. More...
 
double getSigma () const noexcept
 Return the PSF sigma. More...
 

Detailed Description

Implementation of an axisymmetric 2D Gaussian convolved with a line – a model for a fast-moving, trailed-source (Veres et al.

2012).

VeresModel is designed to compute the chi-squared of the model given an lsst::afw::image::Exposure.

Definition at line 47 of file VeresModel.h.

Member Typedef Documentation

◆ ExposureF

Definition at line 50 of file VeresModel.h.

◆ ImageF

Definition at line 49 of file VeresModel.h.

Constructor & Destructor Documentation

◆ VeresModel() [1/3]

lsst::meas::extensions::trailedSources::VeresModel::VeresModel ( ExposureF const &  data)
explicit

Constructor for VeresModel.

Parameters
dataExposure passed from the measurement task.

Definition at line 39 of file VeresModel.cc.

41  : _sigma(data.getPsf()->computeShape().getTraceRadius()),
42  _bbox(data.getBBox()),
43  _data(data.getMaskedImage().getImage()->getArray()),
44  _variance(data.getMaskedImage().getVariance()->getArray()) {}
char * data
Definition: BaseRecord.cc:61

◆ VeresModel() [2/3]

lsst::meas::extensions::trailedSources::VeresModel::VeresModel ( VeresModel const &  )
default

◆ VeresModel() [3/3]

lsst::meas::extensions::trailedSources::VeresModel::VeresModel ( VeresModel &&  )
default

◆ ~VeresModel()

lsst::meas::extensions::trailedSources::VeresModel::~VeresModel ( )
default

Member Function Documentation

◆ getSigma()

double lsst::meas::extensions::trailedSources::VeresModel::getSigma ( ) const
inlinenoexcept

Return the PSF sigma.

Definition at line 99 of file VeresModel.h.

99 { return _sigma; }

◆ gradient()

std::vector< double > lsst::meas::extensions::trailedSources::VeresModel::gradient ( std::vector< double > const &  params) const

Compute the gradient of chi-squared of the model given the data.

Parameters
paramsModel parameters.
Returns
The gradient of chi-squared of the model with respect to the model parameters.
Note
The params vector contains the following model parameters:
  • Centroid x: X-coordinate of the centroid in given image [pixels].
  • Centroid y: Y-coordinate of the centroid in given image [pixels].
  • Flux: Total flux in the trail [count].
  • Length: Length of the trail [pixels].
  • Angle: Angle from the +x-axis [radians].

Definition at line 70 of file VeresModel.cc.

70  {
71 
72  double xc = params[0]; // Centroid x
73  double yc = params[1]; // Centroid y
74  double flux = params[2]; // Flux
75  double length = params[3]; // Trail length
76  double theta = params[4]; // Angle from +x-axis
77 
78  // Compute gradients of the model and of chi-squared
79  std::vector<double> gradChiSq = {0.0,0.0,0.0,0.0,0.0};
80  for (int yIndex = 0, yp = _bbox.getBeginY(); yIndex < _bbox.getHeight(); ++yIndex, ++yp) {
81  ImageF::Array::Reference dataRow = _data[yIndex];
82  ImageF::Array::Reference varRow = _variance[yIndex];
83  for (int xIndex = 0, xp = _bbox.getBeginX(); xIndex < _bbox.getWidth(); ++xIndex, ++xp) {
84  double model = _computeModel(xp,yp,xc,yc,flux,length,theta);
85  double gradDiff = -2.0 * (dataRow[xIndex] - model) / varRow[xIndex];
86  std::array<double, 5> gradModel = _computeGradient(xp,yp,xc,yc,flux,length,theta);
87  for (int k=0; k<5; ++k) {
88  gradChiSq[k] += gradModel[k] * gradDiff;
89  }
90  }
91  }
92  return gradChiSq;
93 }
int getBeginX() const noexcept
Definition: Box.h:172
int getHeight() const noexcept
Definition: Box.h:188
int getWidth() const noexcept
Definition: Box.h:187
int getBeginY() const noexcept
Definition: Box.h:173

◆ operator()()

double lsst::meas::extensions::trailedSources::VeresModel::operator() ( std::vector< double > const &  params) const

Compute chi-squared of the model given the data.

Parameters
paramsModel parameters.
Returns
The chi-squared of the model.
Note
The params vector contains the following model parameters:
  • Centroid x: X-coordinate of the centroid in given image [pixels].
  • Centroid y: Y-coordinate of the centroid in given image [pixels].
  • Flux: Total flux in the trail [count].
  • Length: Length of the trail [pixels].
  • Angle: Angle from the +x-axis [radians].

Definition at line 46 of file VeresModel.cc.

46  {
47 
48  double xc = params[0]; // Centroid x
49  double yc = params[1]; // Centroid y
50  double flux = params[2]; // Flux
51  double length = params[3]; // Trail length
52  double theta = params[4]; // Angle from +x-axis
53 
54  // Compute model image and chi-squared
55  double chiSq = 0.0;
56  // Loop is adapted from lsst::afw::detection::Psf::computeKernelImage()
57  for (int yIndex = 0, yp = _bbox.getBeginY(); yIndex < _bbox.getHeight(); ++yIndex, ++yp) {
58  ImageF::Array::Reference dataRow = _data[yIndex];
59  ImageF::Array::Reference varRow = _variance[yIndex];
60  for (int xIndex = 0, xp = _bbox.getBeginX(); xIndex < _bbox.getWidth(); ++xIndex, ++xp) {
61  double model = _computeModel(xp,yp,xc,yc,flux,length,theta);
62  double diff = dataRow[xIndex] - model;
63  chiSq += diff*diff/varRow[xIndex];
64  }
65  }
66 
67  return chiSq;
68 }

◆ operator=() [1/2]

VeresModel& lsst::meas::extensions::trailedSources::VeresModel::operator= ( VeresModel &&  )
default

◆ operator=() [2/2]

VeresModel& lsst::meas::extensions::trailedSources::VeresModel::operator= ( VeresModel const &  )
default

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