SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourcePsfTaskFactory.cpp
Go to the documentation of this file.
1
20
21namespace SourceXtractor {
22
27
29 auto psf_config = manager.getConfiguration<PsfPluginConfig>();
30 auto measurement_config = manager.getConfiguration<MeasurementImageConfig>();
31
32 const auto& default_psf = psf_config.getPsf();
33 const auto& image_infos = manager.getConfiguration<MeasurementImageConfig>().getImageInfos();
34
35 for (unsigned int i = 0; i < image_infos.size(); i++) {
36 if (!image_infos[i].m_psf_path.empty()) {
37 m_vpsf[image_infos[i].m_id] = PsfPluginConfig::readPsf(image_infos[i].m_psf_path, image_infos[i].m_psf_hdu);
38 }
39 else if (default_psf) {
41 }
42 }
43}
44
46 auto instance = property_id.getIndex();
47
48 if (m_vpsf.find(instance) == m_vpsf.end()) {
49 throw Elements::Exception() << "Missing PSF. Make sure every frame has a PSF";
50 }
51
52 try {
54 } catch (const std::out_of_range&) {
55 return nullptr;
56 }
57}
58
59} // end SourceXtractor
Identifier used to set and retrieve properties.
Definition PropertyId.h:40
static std::shared_ptr< Psf > readPsf(const std::string &filename, int hdu_number=1)
std::shared_ptr< Task > createTask(const PropertyId &property_id) const override
Returns a Task producing a Property corresponding to the given PropertyId.
void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
std::map< int, std::shared_ptr< Psf > > m_vpsf
void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.