Skip to content

Commit

Permalink
Move FittedModel into GaussianCentroid.cc, detail/*Photometry.h into …
Browse files Browse the repository at this point in the history
…SincFlux.cc
  • Loading branch information
pgee committed Sep 10, 2014
1 parent e8bc2bc commit 87a03e7
Show file tree
Hide file tree
Showing 6 changed files with 515 additions and 637 deletions.
66 changes: 0 additions & 66 deletions include/lsst/meas/base/FittedModel.h

This file was deleted.

30 changes: 30 additions & 0 deletions include/lsst/meas/base/GaussianCentroid.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,43 @@
#ifndef LSST_MEAS_BASE_GaussianCentroid_h_INCLUDED
#define LSST_MEAS_BASE_GaussianCentroid_h_INCLUDED

#include <cmath>
#include <vector>
#include "lsst/pex/config.h"
#include "lsst/afw/image/Exposure.h"
#include "lsst/meas/base/Inputs.h"
#include "lsst/meas/base/ResultMappers.h"

namespace lsst { namespace meas { namespace base {

struct FittedModel {
enum { PEAK = 0, SKY, X0, Y0, SIGMA, NPARAM };

enum {
BAD_GUESS = -11,
TOO_FEW = -12,
CHI_SQUARED = -13,
RANGE = -14,
BAD_WIDTH = -15,
LOST = -16,
DIAGONAL = -17,
BAD_A = -18,
CONVERGE = 1,
ITERATE = 2,
ALMOST = 3,
POOR = 4
};

FittedModel(int status_, std::vector<double> params_, int iter_=0, double flamd_=0, double chnew_=0) :
status(status_), params(params_), iter(iter_), flamd(flamd_), chnew(chnew_) { }
int status;
std::vector<double> params;
int iter;
double flamd;
double chnew;
};


/**
* @brief A C++ control class to handle GaussianCentroidAlgorithm's configuration
*
Expand Down
128 changes: 0 additions & 128 deletions include/lsst/meas/base/detail/Photometry.h

This file was deleted.

50 changes: 0 additions & 50 deletions include/lsst/meas/base/detail/SincPhotometry.h

This file was deleted.

13 changes: 6 additions & 7 deletions src/GaussianCentroid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/
#include "ndarray/eigen.h"
#include "lsst/meas/base/GaussianCentroid.h"
#include "lsst/meas/base/FittedModel.h"

#include <algorithm>
#include "Eigen/Core"
Expand All @@ -45,7 +44,7 @@ struct Fit2d {
typedef Eigen::Matrix<double, FittedModel::NPARAM, 1> Vector;

template<typename PixelT>
explicit Fit2d(afwImage::Image<PixelT> const& im) : wide(32), rast(*new std::vector<Raster>(wide*wide)) {
explicit Fit2d(afw::image::Image<PixelT> const& im) : wide(32), rast(*new std::vector<Raster>(wide*wide)) {
ncols = im.getWidth();
nrows = im.getHeight();

Expand Down Expand Up @@ -326,7 +325,7 @@ static void cond2(Fit2d *fit) {
* First guess for 2-D Gaussian
*/
template<typename PixelT>
static void fg2(afwImage::Image<PixelT> const& im, ///< The image
static void fg2(afw::image::Image<PixelT> const& im, ///< The image
double x0, double y0, ///< Initial guess for the position
Fit2d *fit ///< Information needed for the fit
) {
Expand Down Expand Up @@ -458,7 +457,7 @@ static void fg2(afwImage::Image<PixelT> const& im, ///< The image
* Compute centroids with 2-D Gaussian fitter
*/
template<typename PixelT>
FittedModel twodg(afwImage::Image<PixelT> const& im, ///< The image to fit
FittedModel twodg(afw::image::Image<PixelT> const& im, ///< The image to fit
double x0, ///< Initial guess for position, column
double y0 ///< and row
) {
Expand Down Expand Up @@ -499,9 +498,9 @@ FittedModel twodg(afwImage::Image<PixelT> const& im, ///< The image to
#define MAKE_TWODG(IMAGE_T) \
template FittedModel twodg(IMAGE_T const& im, double x0, double y0)

MAKE_TWODG(afwImage::Image<float>);
MAKE_TWODG(afwImage::Image<double>);
MAKE_TWODG(afwImage::Image<int>);
MAKE_TWODG(afw::image::Image<float>);
MAKE_TWODG(afw::image::Image<double>);
MAKE_TWODG(afw::image::Image<int>);

} // end anonymous namespace

Expand Down

0 comments on commit 87a03e7

Please sign in to comment.