SourceXtractorPlusPlus  0.11
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::shared_ptr
STL class.
SourceXtractor::ImagePsf
Definition: ImagePsf.h:37
SourceXtractor::SeFloat
SeFloat32 SeFloat
Definition: Types.h:32
Convolution.h
SourceXtractor::ProcessedImage
Processes two images to create a third combining them by using any function.
Definition: ProcessedImage.h:37
SourceXtractor::ImagePsf::base_t
DFTConvolution< SeFloat, PaddedImage< SeFloat, Reflect101Coordinates > > base_t
Definition: ImagePsf.h:39
SourceXtractor::DFTConvolution< SeFloat, PaddedImage< SeFloat, Reflect101Coordinates > >::getWidth
std::size_t getWidth() const
Definition: DFT.h:84
SourceXtractor::DFTConvolution
Definition: DFT.h:46
SourceXtractor::ImagePsf::getPixelScale
double getPixelScale() const
Definition: ImagePsf.h:57
VectorImage.h
PsfTraits.h
SourceXtractor
Definition: Aperture.h:30
pixel_scale
const double pixel_scale
Definition: TestImage.cpp:75
Exception.h
SourceXtractor::DFTConvolution< SeFloat, PaddedImage< SeFloat, Reflect101Coordinates > >::getKernel
std::shared_ptr< const Image< SeFloat > > getKernel() const
Definition: DFT.h:216
ModelFitting::PsfTraits< SourceXtractor::ImagePsf >::context_t
typename std::unique_ptr< SourceXtractor::ImagePsf::ConvolutionContext > context_t
Definition: ImagePsf.h:83
ModelFitting::PsfTraits
Definition: PsfTraits.h:37
SourceXtractor::VectorImage::create
static std::shared_ptr< VectorImage< T > > create(Args &&... args)
Definition: VectorImage.h:89
Elements::Exception
ProcessedImage.h
SourceXtractor::ImagePsf::~ImagePsf
virtual ~ImagePsf()=default
SourceXtractor::ImagePsf::m_pixel_scale
double m_pixel_scale
Definition: ImagePsf.h:70
SourceXtractor::ImagePsf::ImagePsf
ImagePsf(double pixel_scale, std::shared_ptr< const VectorImage< SeFloat >> image)
Definition: ImagePsf.h:43
SourceXtractor::VectorImage< SeFloat >
ModelFitting::PsfTraits::has_context
static constexpr bool has_context
Definition: PsfTraits.h:39
std::size_t
SourceXtractor::ImagePsf::getSize
std::size_t getSize() const
Definition: ImagePsf.h:61
SourceXtractor::ImagePsf::getScaledKernel
std::shared_ptr< VectorImage< SourceXtractor::SeFloat > > getScaledKernel(SeFloat scale) const
Definition: ImagePsf.h:65
std::unique_ptr
STL class.
ModelFitting
Definition: AsinhChiSquareComparator.h:30
memory_tools.h