SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
PsfTaskFactory.cpp
Go to the documentation of this file.
1
17/*
18 * PsfTaskFactory.h
19 *
20 * Created on: Jun 25, 2018
21 * Author: Alejandro Álvarez Ayllón
22 */
23
26
27namespace SourceXtractor {
28
33
35 auto psf_config = manager.getConfiguration<PsfPluginConfig>();
36 auto measurement_config = manager.getConfiguration<MeasurementImageConfig>();
37
38 const auto& default_psf = psf_config.getPsf();
39 const auto& image_infos = manager.getConfiguration<MeasurementImageConfig>().getImageInfos();
40
41 for (unsigned int i = 0; i < image_infos.size(); i++) {
42 if (!image_infos[i].m_psf_path.empty()) {
43 m_vpsf[image_infos[i].m_id] = PsfPluginConfig::readPsf(image_infos[i].m_psf_path, image_infos[i].m_psf_hdu);
44 }
45 else if (default_psf) {
47 }
48 }
49}
50
52 auto instance = property_id.getIndex();
53
54 if (m_vpsf.find(instance) == m_vpsf.end()) {
55 throw Elements::Exception() << "Missing PSF. Make sure every frame has a PSF";
56 }
57
58 try {
60 } catch (const std::out_of_range&) {
61 return nullptr;
62 }
63}
64
65} // 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::map< int, std::shared_ptr< Psf > > m_vpsf
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.
void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.