LSST Applications  21.0.0-147-g0e635eb1+1acddb5be5,22.0.0+052faf71bd,22.0.0+1ea9a8b2b2,22.0.0+6312710a6c,22.0.0+729191ecac,22.0.0+7589c3a021,22.0.0+9f079a9461,22.0.1-1-g7d6de66+b8044ec9de,22.0.1-1-g87000a6+536b1ee016,22.0.1-1-g8e32f31+6312710a6c,22.0.1-10-gd060f87+016f7cdc03,22.0.1-12-g9c3108e+df145f6f68,22.0.1-16-g314fa6d+c825727ab8,22.0.1-19-g93a5c75+d23f2fb6d8,22.0.1-19-gb93eaa13+aab3ef7709,22.0.1-2-g8ef0a89+b8044ec9de,22.0.1-2-g92698f7+9f079a9461,22.0.1-2-ga9b0f51+052faf71bd,22.0.1-2-gac51dbf+052faf71bd,22.0.1-2-gb66926d+6312710a6c,22.0.1-2-gcb770ba+09e3807989,22.0.1-20-g32debb5+b8044ec9de,22.0.1-23-gc2439a9a+fb0756638e,22.0.1-3-g496fd5d+09117f784f,22.0.1-3-g59f966b+1e6ba2c031,22.0.1-3-g849a1b8+f8b568069f,22.0.1-3-gaaec9c0+c5c846a8b1,22.0.1-32-g5ddfab5d3+60ce4897b0,22.0.1-4-g037fbe1+64e601228d,22.0.1-4-g8623105+b8044ec9de,22.0.1-5-g096abc9+d18c45d440,22.0.1-5-g15c806e+57f5c03693,22.0.1-7-gba73697+57f5c03693,master-g6e05de7fdc+c1283a92b8,master-g72cdda8301+729191ecac,w.2021.39
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: