SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
27#include "ElementsKernel/Exception.h"
28#include "AlexandriaKernel/memory_tools.h"
33
34
35namespace SourceXtractor {
36
37class ImagePsf: public DFTConvolution<SeFloat, PaddedImage<SeFloat, Reflect101Coordinates>> {
38private:
40
41public:
42
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
62 return getWidth();
63 }
64
68
69private:
71
72};
73
74} // end of SourceXtractor
75
76namespace ModelFitting {
77
81template<>
82struct PsfTraits<SourceXtractor::ImagePsf> {
84 static constexpr bool has_context = true;
85};
86
87} // end of ModelFitting
88
89
90#endif /* _SEIMPLEMENTATION_IMAGE_IMAGEPSF_H_ */
const double pixel_scale
Definition TestImage.cpp:74
std::size_t getSize() const
Definition ImagePsf.h:61
std::shared_ptr< VectorImage< SourceXtractor::SeFloat > > getScaledKernel(SeFloat scale) const
Definition ImagePsf.h:65
ImagePsf(double pixel_scale, std::shared_ptr< const VectorImage< SeFloat > > image)
Definition ImagePsf.h:43
virtual ~ImagePsf()=default
double getPixelScale() const
Definition ImagePsf.h:57
DFTConvolution< SeFloat, PaddedImage< SeFloat, Reflect101Coordinates > > base_t
Definition ImagePsf.h:39
static std::shared_ptr< VectorImage< T > > create(Args &&... args)
typename std::unique_ptr< SourceXtractor::ImagePsf::ConvolutionContext > context_t
Definition ImagePsf.h:83
static constexpr bool has_context
Definition PsfTraits.h:39