SourceXtractorPlusPlus  0.11
Please provide a description of the project.
CoreThresholdPartitionStep.cpp
Go to the documentation of this file.
1 
27 
28 namespace SourceXtractor {
29 
30 CoreThresholdPartitionStep::CoreThresholdPartitionStep(double snr_level, unsigned int min_pixel_count) :
31  m_snr_level(snr_level), m_min_pixel_count(min_pixel_count) {
32 }
33 
35  long int n_snr_level(0);
36  // SNR Image accesses the underlying detection image, which may be a buffered image
38 
39  // get the SNR image
40  const auto& snr_image = source->getProperty<DetectionFrame>().getFrame()->getSnrImage();
41 
42  // go over all pixels
43  for (auto pixel_coord : source->getProperty<PixelCoordinateList>().getCoordinateList())
44  // enhance the counter if the SNR is above the level
45  if (snr_image->getValue(pixel_coord.m_x, pixel_coord.m_y) >= m_snr_level)
46  n_snr_level += 1;
47 
48  // check whether the pixel # is above the threshold
49  if (n_snr_level < m_min_pixel_count) {
50  return {};
51  } else {
52  return { source };
53  }
54 }
55 
56 } // SEImplementation namespace
57 
PixelCoordinateList.h
SourceXtractor::PixelCoordinateList
Definition: PixelCoordinateList.h:31
std::lock
T lock(T... args)
SourceXtractor::CoreThresholdPartitionStep::partition
virtual std::vector< std::shared_ptr< SourceInterface > > partition(std::shared_ptr< SourceInterface > source) const override
Definition: CoreThresholdPartitionStep.cpp:34
std::shared_ptr
STL class.
std::vector
STL class.
DetectionFrame.h
std::lock_guard
STL class.
SourceXtractor::MultithreadedMeasurement::g_global_mutex
static std::recursive_mutex g_global_mutex
Definition: MultithreadedMeasurement.h:54
SourceXtractor::PixelCoordinateList::getCoordinateList
const std::vector< PixelCoordinate > & getCoordinateList() const
Definition: PixelCoordinateList.h:41
SourceXtractor
Definition: Aperture.h:30
SourceXtractor::CoreThresholdPartitionStep::CoreThresholdPartitionStep
CoreThresholdPartitionStep(double snr_level, unsigned int min_pixel_count)
Constructor.
Definition: CoreThresholdPartitionStep.cpp:30
SourceXtractor::DetectionFrame
Definition: DetectionFrame.h:33
SourceXtractor::CoreThresholdPartitionStep::m_min_pixel_count
unsigned int m_min_pixel_count
Definition: CoreThresholdPartitionStep.h:50
MultithreadedMeasurement.h
CoreThresholdPartitionStep.h
SourceXtractor::CoreThresholdPartitionStep::m_snr_level
double m_snr_level
Definition: CoreThresholdPartitionStep.h:49