SourceXtractorPlusPlus  0.19
SourceXtractor++, the next generation SExtractor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MoffatCheckImage.cpp
Go to the documentation of this file.
1 
17 /*
18  * MoffatCheckImage.cpp
19  *
20  * Created on: 2019 M02 5
21  * Author: mschefer
22  */
23 
24 
29 
33 
35 
36 namespace SourceXtractor {
37 
38 using namespace ModelFitting;
39 
41  auto hdu_index = group.cbegin()->getProperty<DetectionFrameInfo>().getHduIndex();
42  auto check_image = CheckImages::getInstance().getMoffatImage(hdu_index);
43  ImageAccessor<SeFloat> check_accessor(check_image);
44 
45  if (check_image != nullptr) {
46  for (auto& source : group) {
47  auto& model = source.getProperty<MoffatModelEvaluator>();
48 
49  if (model.getIterations() == 0) {
50  continue;
51  }
52 
53  for (int y=0; y<check_image->getHeight(); y++) {
54  for (int x=0; x<check_image->getWidth(); x++) {
55  check_image->setValue(x, y, check_accessor.getValue(x, y) + model.getValue(x - 0.5, y - 0.5));
56  }
57  }
58  }
59  }
60 }
61 
62 }
63 
64 
65 
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
void handleMessage(const SourceGroupInterface &group) override
static CheckImages & getInstance()
Definition: CheckImages.h:150
virtual const_iterator cbegin() const =0
Defines the interface used to group sources.
std::shared_ptr< WriteableImage< SeFloat > > getMoffatImage(size_t index) const
Definition: CheckImages.h:104