SourceXtractorPlusPlus  0.8
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ImagePsf.h
Go to the documentation of this file.
1 
17 /*
18  * ImagePsf.h
19  *
20  * Created on: Sep 19, 2017
21  * Author: mschefer
22  */
23 
24 #ifndef _SEIMPLEMENTATION_IMAGE_IMAGEPSF_H_
25 #define _SEIMPLEMENTATION_IMAGE_IMAGEPSF_H_
26 
28 
32 #include "ModelFitting/utils.h"
33 
35 
36 
37 namespace SourceXtractor {
38 
39 class ImagePsf: public DFTConvolution<SeFloat, PaddedImage<SeFloat, Reflect101Coordinates>> {
40 private:
42 
43 public:
44 
46  : base_t{image}, m_pixel_scale{pixel_scale} {
47  if (image->getWidth() != image->getHeight()) {
48  throw Elements::Exception() << "PSF kernel must be square but was "
49  << image->getWidth() << " x " << image->getHeight();
50  }
51  if (image->getWidth() % 2 == 0) {
52  throw Elements::Exception() << "PSF kernel must have odd size, but got "
53  << image->getWidth();
54  }
55  }
56 
57  virtual ~ImagePsf() = default;
58 
59  double getPixelScale() const {
60  return m_pixel_scale;
61  }
62 
63  std::size_t getSize() const {
64  return getWidth();
65  }
66 
69  }
70 
71 private:
72  double m_pixel_scale;
73 
74 };
75 
76 } // end of SourceXtractor
77 
78 namespace ModelFitting {
79 
83 template<>
84 struct PsfTraits<SourceXtractor::ImagePsf> {
86  static constexpr bool has_context = true;
87 };
88 
89 } // end of ModelFitting
90 
91 
92 #endif /* _SEIMPLEMENTATION_IMAGE_IMAGEPSF_H_ */
DFTConvolution< SeFloat, PaddedImage< SeFloat, Reflect101Coordinates > > base_t
Definition: ImagePsf.h:41
SeFloat32 SeFloat
Definition: Types.h:32
static std::shared_ptr< VectorImage< T > > create(Args &&...args)
Definition: VectorImage.h:89
std::shared_ptr< VectorImage< SourceXtractor::SeFloat > > getScaledKernel(SeFloat scale) const
Definition: ImagePsf.h:67
Image implementation which keeps the pixel values in memory.
Definition: VectorImage.h:53
virtual ~ImagePsf()=default
double getPixelScale() const
Definition: ImagePsf.h:59
ImagePsf(double pixel_scale, std::shared_ptr< const VectorImage< SeFloat >> image)
Definition: ImagePsf.h:45
std::size_t getSize() const
Definition: ImagePsf.h:63
STL class.
typename std::unique_ptr< SourceXtractor::ImagePsf::ConvolutionContext > context_t
Definition: ImagePsf.h:85
const double pixel_scale
Definition: TestImage.cpp:72
static constexpr bool has_context
Definition: PsfTraits.h:39
Processes two images to create a third combining them by using any function.