SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
AperturePhotometryTaskFactory.cpp
Go to the documentation of this file.
1
17/*
18 * AperturePhotometryTaskFactory.cpp
19 *
20 * Created on: Sep 23, 2016
21 * Author: mschefer
22 */
23
24#include <sstream>
25
28
40
41namespace SourceXtractor {
42
44 auto instance = property_id.getIndex();
45
46 if (property_id.getTypeId() == typeid(AperturePhotometry)) {
52 );
53 } else if (property_id.getTypeId() == typeid(AperturePhotometryArray)) {
57 );
58 } else if (property_id == PropertyId::create<ApertureFlag>()) {
60 }
61 return nullptr;
62}
63
68
70 auto& array_id = aggregated_ap.first;
71
73
74 flux_instances.emplace_back(std::make_pair(name + "_flux", array_id));
75 flux_err_instances.emplace_back(std::make_pair(name + "_flux_err", array_id));
76 mag_instances.emplace_back(std::make_pair(name + "_mag", array_id));
77 mag_err_instances.emplace_back(std::make_pair(name + "_mag_err", array_id));
78 flags_instances.emplace_back(std::make_pair(name + "_flags", array_id));
79 }
80
81 registry.registerPropertyInstances<AperturePhotometryArray>("aperture_flux", flux_instances);
82 registry.registerPropertyInstances<AperturePhotometryArray>("aperture_flux_err", flux_err_instances);
83 registry.registerPropertyInstances<AperturePhotometryArray>("aperture_mag", mag_instances);
84 registry.registerPropertyInstances<AperturePhotometryArray>("aperture_mag_err", mag_err_instances);
85 registry.registerPropertyInstances<AperturePhotometryArray>("aperture_flags", flags_instances);
86}
87
89 manager.registerConfiguration<MagnitudeConfig>();
90 manager.registerConfiguration<WeightImageConfig>();
91 manager.registerConfiguration<AperturePhotometryConfig>();
92 manager.registerConfiguration<MeasurementImageConfig>();
93}
94
96 auto& measurement_config = manager.getConfiguration<MeasurementImageConfig>();
97 auto& aperture_config = manager.getConfiguration<AperturePhotometryConfig>();
98
99 const auto& image_infos = measurement_config.getImageInfos();
100
101 m_aperture_config = aperture_config.getApertures();
102 m_magnitude_zero_point = manager.getConfiguration<MagnitudeConfig>().getMagnitudeZeroPoint();
103 m_symmetry_usage = manager.getConfiguration<WeightImageConfig>().symmetryUsage();
104
105 for (unsigned int i = 0; i < image_infos.size(); ++i) {
106 for (auto a : aperture_config.getAperturesForImage(image_infos[i].m_id)) {
109 }
110 }
111 }
112
113 auto outputs = aperture_config.getImagesToOutput();
114 unsigned i = 0;
115 for (auto j = outputs.begin(); j != outputs.end(); ++i, ++j) {
116 m_col_prefix[i] = j->first;
117 m_apertures_per_output[i] = j->second;
118 }
119}
120
121}
122
T at(T... args)
T begin(T... args)
Merges all AperturePhotometries into a multidimensional property.
std::shared_ptr< Task > createTask(const PropertyId &property_id) const override
Returns a Task producing a Property corresponding to the given PropertyId.
void configure(Euclid::Configuration::ConfigManager &manager) override
Method which should initialize the object.
std::map< unsigned, std::vector< float > > m_aperture_config
std::map< unsigned, std::vector< unsigned > > m_apertures_per_output
void reportConfigDependencies(Euclid::Configuration::ConfigManager &manager) const override
Registers all the Configuration dependencies.
Aperture photometry fluxes and magnitudes.
Identifier used to set and retrieve properties.
Definition PropertyId.h:40
T emplace_back(T... args)
T end(T... args)
T find(T... args)
T make_pair(T... args)