SourceXtractorPlusPlus  0.12
Please provide a description of the project.
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 
33 
34 
35 namespace SourceXtractor {
36 
37 class ImagePsf: public DFTConvolution<SeFloat, PaddedImage<SeFloat, Reflect101Coordinates>> {
38 private:
40 
41 public:
42 
44  : base_t{image}, m_pixel_scale{pixel_scale} {
45  if (image->getWidth() != image->getHeight()) {
46  throw Elements::Exception() << "PSF kernel must be square but was "
47  << image->getWidth() << " x " << image->getHeight();
48  }
49  if (image->getWidth() % 2 == 0) {
50  throw Elements::Exception() << "PSF kernel must have odd size, but got "
51  << image->getWidth();
52  }
53  }
54 
55  virtual ~ImagePsf() = default;
56 
57  double getPixelScale() const {
58  return m_pixel_scale;
59  }
60 
61  std::size_t getSize() const {
62  return getWidth();
63  }
64 
67  }
68 
69 private:
70  double m_pixel_scale;
71 
72 };
73 
74 } // end of SourceXtractor
75 
76 namespace ModelFitting {
77 
81 template<>
82 struct PsfTraits<SourceXtractor::ImagePsf> {
84  static constexpr bool has_context = true;
85 };
86 
87 } // end of ModelFitting
88 
89 
90 #endif /* _SEIMPLEMENTATION_IMAGE_IMAGEPSF_H_ */
std::size_t getSize() const
Definition: ImagePsf.h:61
DFTConvolution< SeFloat, PaddedImage< SeFloat, Reflect101Coordinates > > base_t
Definition: ImagePsf.h:39
SeFloat32 SeFloat
Definition: Types.h:32
Image implementation which keeps the pixel values in memory.
Definition: VectorImage.h:53
static std::shared_ptr< VectorImage< T > > create(Args &&... args)
Definition: VectorImage.h:89
virtual ~ImagePsf()=default
double getPixelScale() const
Definition: ImagePsf.h:57
ImagePsf(double pixel_scale, std::shared_ptr< const VectorImage< SeFloat >> image)
Definition: ImagePsf.h:43
std::shared_ptr< VectorImage< SourceXtractor::SeFloat > > getScaledKernel(SeFloat scale) const
Definition: ImagePsf.h:65
STL class.
typename std::unique_ptr< SourceXtractor::ImagePsf::ConvolutionContext > context_t
Definition: ImagePsf.h:83
const double pixel_scale
Definition: TestImage.cpp:75
static constexpr bool has_context
Definition: PsfTraits.h:39
Processes two images to create a third combining them by using any function.