SourceXtractorPlusPlus
1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
SEImplementation
Image
DownSampledImagePsf.h
Go to the documentation of this file.
1
17
/*
18
* DownSampledImagePsf.h
19
*
20
* Created on: Nov 5, 2021
21
* Author: mschefer
22
*/
23
24
#ifndef _SEIMPLEMENTATION_IMAGE_DOWNSAMPLEDIMAGEPSF_H_
25
#define _SEIMPLEMENTATION_IMAGE_DOWNSAMPLEDIMAGEPSF_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
#include "
SEImplementation/Image/ImagePsf.h
"
35
36
namespace
SourceXtractor
{
37
38
/*
39
* Encapsulates ImagePsf to provide a downscaled version for performance
40
*/
41
class
DownSampledImagePsf
{
42
public
:
43
44
DownSampledImagePsf
(
double
pixel_scale
,
std::shared_ptr
<
VectorImage<SeFloat>
> image,
45
double
down_scaling=1.0,
bool
normalize_psf =
true
);
46
47
virtual
~DownSampledImagePsf
() =
default
;
48
49
double
getPixelScale
()
const
;
50
51
std::size_t
getSize
()
const
;
52
std::shared_ptr<VectorImage<SourceXtractor::SeFloat>
>
getScaledKernel
(
SeFloat
scale)
const
;
53
void
convolve
(
std::shared_ptr
<
WriteableImage<float>
> image)
const
;
54
55
// For ConvolutionContext optimization
56
std::unique_ptr<DFTConvolution<SeFloat>::ConvolutionContext
>
prepare
(
const
std::shared_ptr
<
const
Image<SeFloat>
>& model_ptr)
const
;
57
void
convolve
(
std::shared_ptr
<
WriteableImage<float>
> image,
std::unique_ptr
<
DFTConvolution<SeFloat>::ConvolutionContext
>& context)
const
;
58
59
private
:
60
double
m_down_scaling
;
61
std::shared_ptr<ImagePsf>
m_psf
;
62
bool
m_normalize_psf
{
true
};
63
};
64
65
}
// end of SourceXtractor
66
67
namespace
ModelFitting
{
68
72
template
<>
73
struct
PsfTraits
<
SourceXtractor
::DownSampledImagePsf> {
74
using
context_t
=
typename
std::unique_ptr<SourceXtractor::ImagePsf::ConvolutionContext>
;
75
static
constexpr
bool
has_context
=
true
;
76
};
77
78
}
// end of ModelFitting
79
80
#endif
/* _SEIMPLEMENTATION_IMAGE_DOWNSAMPLEDIMAGEPSF_H_ */
Convolution.h
ImagePsf.h
ProcessedImage.h
PsfTraits.h
pixel_scale
const double pixel_scale
Definition
TestImage.cpp:74
VectorImage.h
SourceXtractor::DownSampledImagePsf::m_psf
std::shared_ptr< ImagePsf > m_psf
Definition
DownSampledImagePsf.h:61
SourceXtractor::DownSampledImagePsf::getPixelScale
double getPixelScale() const
Definition
DownSampledImagePsf.cpp:78
SourceXtractor::DownSampledImagePsf::m_down_scaling
double m_down_scaling
Definition
DownSampledImagePsf.h:60
SourceXtractor::DownSampledImagePsf::DownSampledImagePsf
DownSampledImagePsf(double pixel_scale, std::shared_ptr< VectorImage< SeFloat > > image, double down_scaling=1.0, bool normalize_psf=true)
Definition
DownSampledImagePsf.cpp:32
SourceXtractor::DownSampledImagePsf::getScaledKernel
std::shared_ptr< VectorImage< SourceXtractor::SeFloat > > getScaledKernel(SeFloat scale) const
Definition
DownSampledImagePsf.cpp:94
SourceXtractor::DownSampledImagePsf::prepare
std::unique_ptr< DFTConvolution< SeFloat >::ConvolutionContext > prepare(const std::shared_ptr< const Image< SeFloat > > &model_ptr) const
Definition
DownSampledImagePsf.cpp:108
SourceXtractor::DownSampledImagePsf::~DownSampledImagePsf
virtual ~DownSampledImagePsf()=default
SourceXtractor::DownSampledImagePsf::m_normalize_psf
bool m_normalize_psf
Definition
DownSampledImagePsf.h:62
SourceXtractor::DownSampledImagePsf::convolve
void convolve(std::shared_ptr< WriteableImage< float > > image) const
Definition
DownSampledImagePsf.cpp:102
SourceXtractor::DownSampledImagePsf::getSize
std::size_t getSize() const
Definition
DownSampledImagePsf.cpp:86
SourceXtractor::Image
Interface representing an image.
Definition
Image.h:44
SourceXtractor::VectorImage
Image implementation which keeps the pixel values in memory.
Definition
VectorImage.h:52
SourceXtractor::WriteableImage
Definition
WriteableImage.h:33
ModelFitting
Definition
DataVsModelResiduals.icpp:23
SourceXtractor
Definition
Aperture.h:30
SourceXtractor::SeFloat
SeFloat32 SeFloat
Definition
Types.h:32
std::shared_ptr
std::size_t
ModelFitting::PsfTraits< SourceXtractor::DownSampledImagePsf >::has_context
static constexpr bool has_context
Definition
DownSampledImagePsf.h:75
ModelFitting::PsfTraits< SourceXtractor::DownSampledImagePsf >::context_t
typename std::unique_ptr< SourceXtractor::ImagePsf::ConvolutionContext > context_t
Definition
DownSampledImagePsf.h:74
ModelFitting::PsfTraits
Definition
PsfTraits.h:37
SourceXtractor::DFTConvolution::ConvolutionContext
Definition
DFT.h:57
std::unique_ptr
Generated by
1.14.0