SourceXtractorPlusPlus
0.15
Please provide a description of the project.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SEImplementation
SEImplementation
Image
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
"
29
#include "
ModelFitting/Image/PsfTraits.h
"
30
#include "
SEFramework/Image/VectorImage.h
"
31
#include "
SEFramework/Image/ProcessedImage.h
"
32
#include "
SEFramework/Convolution/Convolution.h
"
33
34
35
namespace
SourceXtractor {
36
37
class
ImagePsf
:
public
DFTConvolution
<SeFloat, PaddedImage<SeFloat, Reflect101Coordinates>> {
38
private
:
39
typedef
DFTConvolution<SeFloat, PaddedImage<SeFloat, Reflect101Coordinates>
>
base_t
;
40
41
public
:
42
43
ImagePsf
(
double
pixel_scale
,
std::shared_ptr
<
const
VectorImage<SeFloat>
> image)
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
65
std::shared_ptr<VectorImage<SourceXtractor::SeFloat>
>
getScaledKernel
(
SeFloat
scale)
const
{
66
return
VectorImage<SeFloat>::create
(*
MultiplyImage<SourceXtractor::SeFloat>::create
(
getKernel
(), scale));
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> {
83
using
context_t
=
typename
std::unique_ptr<SourceXtractor::ImagePsf::ConvolutionContext>
;
84
static
constexpr
bool
has_context
=
true
;
85
};
86
87
}
// end of ModelFitting
88
89
90
#endif
/* _SEIMPLEMENTATION_IMAGE_IMAGEPSF_H_ */
std::shared_ptr
SourceXtractor::ImagePsf::base_t
DFTConvolution< SeFloat, PaddedImage< SeFloat, Reflect101Coordinates > > base_t
Definition:
ImagePsf.h:39
SourceXtractor::ImagePsf
Definition:
ImagePsf.h:37
SourceXtractor::DFTConvolution
Definition:
DFT.h:46
SourceXtractor::SeFloat
SeFloat32 SeFloat
Definition:
Types.h:32
SourceXtractor::VectorImage::create
static std::shared_ptr< VectorImage< T > > create(Args &&...args)
Definition:
VectorImage.h:100
std::size_t
SourceXtractor::ImagePsf::getScaledKernel
std::shared_ptr< VectorImage< SourceXtractor::SeFloat > > getScaledKernel(SeFloat scale) const
Definition:
ImagePsf.h:65
Convolution.h
ProcessedImage.h
SourceXtractor::VectorImage
Image implementation which keeps the pixel values in memory.
Definition:
VectorImage.h:52
VectorImage.h
SourceXtractor::ImagePsf::~ImagePsf
virtual ~ImagePsf()=default
memory_tools.h
SourceXtractor::ImagePsf::getPixelScale
double getPixelScale() const
Definition:
ImagePsf.h:57
SourceXtractor::ImagePsf::ImagePsf
ImagePsf(double pixel_scale, std::shared_ptr< const VectorImage< SeFloat >> image)
Definition:
ImagePsf.h:43
SourceXtractor::ImagePsf::getSize
std::size_t getSize() const
Definition:
ImagePsf.h:61
std::unique_ptr
STL class.
Elements::Exception
ModelFitting::PsfTraits< SourceXtractor::ImagePsf >::context_t
typename std::unique_ptr< SourceXtractor::ImagePsf::ConvolutionContext > context_t
Definition:
ImagePsf.h:83
SourceXtractor::ImagePsf::m_pixel_scale
double m_pixel_scale
Definition:
ImagePsf.h:70
PsfTraits.h
SourceXtractor::DFTConvolution< SeFloat, PaddedImage< SeFloat, Reflect101Coordinates > >::getKernel
std::shared_ptr< const Image< SeFloat > > getKernel() const
Definition:
DFT.h:216
Exception.h
pixel_scale
const double pixel_scale
Definition:
TestImage.cpp:74
SourceXtractor::DFTConvolution< SeFloat, PaddedImage< SeFloat, Reflect101Coordinates > >::getWidth
std::size_t getWidth() const
Definition:
DFT.h:84
ModelFitting::PsfTraits::has_context
static constexpr bool has_context
Definition:
PsfTraits.h:39
SourceXtractor::ProcessedImage
Processes two images to create a third combining them by using any function.
Definition:
ProcessedImage.h:36
ModelFitting::PsfTraits
Definition:
PsfTraits.h:37
Generated by
1.8.5