SourceXtractorPlusPlus
0.11
Please provide a description of the project.
SEImplementation
SEImplementation
Plugin
CoreThresholdPartition
CoreThresholdPartitionTask.h
Go to the documentation of this file.
1
24
#ifndef _SEIMPLEMENTATION_PLUGIN_CORETHRESHOLDTASK_H_
25
#define _SEIMPLEMENTATION_PLUGIN_CORETHRESHOLDTASK_H_
26
27
#include "
NCorePixel.h
"
28
#include "
SEFramework/Property/DetectionFrame.h
"
29
#include "
SEImplementation/Property/PixelCoordinateList.h
"
30
31
#include "
SEFramework/Task/SourceTask.h
"
32
#include "
SEImplementation/Plugin/DetectionFramePixelValues/DetectionFramePixelValues.h
"
33
34
#include "
SEImplementation/Measurement/MultithreadedMeasurement.h
"
35
36
namespace
SourceXtractor
{
37
38
class
CoreThresholdPartitionTask
:
public
SourceTask
{
39
40
public
:
41
CoreThresholdPartitionTask
(
double
snr_level):
m_snr_level
(snr_level) {};
42
43
virtual
~CoreThresholdPartitionTask
() =
default
;
44
45
virtual
void
computeProperties
(
SourceInterface
& source)
const
{
46
std::lock_guard<std::recursive_mutex>
lock
(
MultithreadedMeasurement::g_global_mutex
);
47
48
long
int
n_snr_level=0;
49
50
// get the detection frame and the SNR image
51
const
auto
& snr_image = source.
getProperty
<
DetectionFrame
>().getFrame()->getSnrImage();
52
53
// go over all pixels
54
for
(
auto
pixel_coord : source.
getProperty
<
PixelCoordinateList
>().
getCoordinateList
()) {
55
// enhance the counter if the SNR is above the level
56
if
(snr_image->getValue(pixel_coord.m_x, pixel_coord.m_y) >=
m_snr_level
)
57
n_snr_level += 1;
58
}
59
60
// set the property
61
source.
setProperty
<
NCorePixel
>(n_snr_level);
62
};
63
64
private
:
65
double
m_snr_level
;
66
67
};
// End of CoreThresholdTask class
68
}
// namespace SExtractor
69
70
#endif
/* _SEIMPLEMENTATION_PLUGIN_SNRLEVELSOURCETASK_H_ */
71
72
73
PixelCoordinateList.h
NCorePixel.h
SourceXtractor::SourceInterface::setProperty
void setProperty(Args... args)
Definition:
SourceInterface.h:72
SourceXtractor::CoreThresholdPartitionTask
Definition:
CoreThresholdPartitionTask.h:38
SourceXtractor::PixelCoordinateList
Definition:
PixelCoordinateList.h:31
SourceXtractor::SourceTask
A Task that acts on a Source to compute one or more properties.
Definition:
SourceTask.h:36
SourceXtractor::DetectionFrame
Definition:
DetectionFrame.h:33
SourceTask.h
SourceXtractor::CoreThresholdPartitionTask::CoreThresholdPartitionTask
CoreThresholdPartitionTask(double snr_level)
Definition:
CoreThresholdPartitionTask.h:41
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition:
SourceInterface.h:57
SourceXtractor::CoreThresholdPartitionTask::m_snr_level
double m_snr_level
Definition:
CoreThresholdPartitionTask.h:62
std::lock
T lock(T... args)
SourceXtractor::CoreThresholdPartitionTask::~CoreThresholdPartitionTask
virtual ~CoreThresholdPartitionTask()=default
DetectionFrame.h
DetectionFramePixelValues.h
std::lock_guard
SourceXtractor::MultithreadedMeasurement::g_global_mutex
static std::recursive_mutex g_global_mutex
Definition:
MultithreadedMeasurement.h:54
SourceXtractor::NCorePixel
Definition:
NCorePixel.h:44
SourceXtractor::CoreThresholdPartitionTask::computeProperties
virtual void computeProperties(SourceInterface &source) const
Computes one or more properties for the Source.
Definition:
CoreThresholdPartitionTask.h:45
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition:
SourceInterface.h:46
SourceXtractor::PixelCoordinateList::getCoordinateList
const std::vector< PixelCoordinate > & getCoordinateList() const
Definition:
PixelCoordinateList.h:41
MultithreadedMeasurement.h
Generated by
1.8.14