SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
AperturePhotometryArray.h
Go to the documentation of this file.
1
17/*
18 * AperturePhotometryArray.h
19 *
20 * Created on: Nov 23, 2018
21 * Author: Alejandro Alvarez Ayllon
22 */
23
24#ifndef _SEIMPLEMENTATION_PLUGIN_APERTUREPHOTOMETRY_APERTUREPHOTOMETRYARRAY_H_
25#define _SEIMPLEMENTATION_PLUGIN_APERTUREPHOTOMETRY_APERTUREPHOTOMETRYARRAY_H_
26
27#include "AlexandriaKernel/memory_tools.h"
29#include "NdArray/NdArray.h"
30#include <memory>
31#include <cassert>
32
33
34namespace SourceXtractor {
35
41public:
42 template<typename T>
44
48 virtual ~AperturePhotometryArray() = default;
49
52
53 assert(measurements.size() > 0);
54 size_t nentries = measurements.size();
55 size_t napertures = measurements.front().getFlags().size();
56 std::vector<size_t> shape{nentries, napertures};
57
63
64 for (size_t entry_idx = 0; entry_idx < nentries; ++entry_idx) {
65 const auto& entry = measurements[entry_idx];
66 for (size_t ap_idx = 0; ap_idx < napertures; ++ap_idx) {
67 m_fluxes->at(entry_idx, ap_idx) = entry.getFluxes()[ap_idx];
68 m_flux_errors->at(entry_idx, ap_idx) = entry.getFluxErrors()[ap_idx];
69 m_mags->at(entry_idx, ap_idx) = entry.getMags()[ap_idx];
70 m_mag_errors->at(entry_idx, ap_idx) = entry.getMagErrors()[ap_idx];
71 m_flags->at(entry_idx, ap_idx) = flags2long(entry.getFlags()[ap_idx]);
72 }
73 }
74 }
75
76 const NdArray<SeFloat> &getFluxes() const {
77 return *m_fluxes;
78 }
79
81 return *m_flux_errors;
82 }
83
84 const NdArray<SeFloat> &getMags() const {
85 return *m_mags;
86 }
87
89 return *m_mag_errors;
90 }
91
92 const NdArray<int64_t> &getFlags() const {
93 return *m_flags;
94 }
95
96private:
102};
103
104} /* namespace SourceXtractor */
105
106#endif /* _SEIMPLEMENTATION_PLUGIN_APERTUREPHOTOMETRY_APERTUREPHOTOMETRY_H_ */
const NdArray< SeFloat > & getFluxErrors() const
virtual ~AperturePhotometryArray()=default
Destructor.
std::unique_ptr< NdArray< SeFloat > > m_flux_errors
std::unique_ptr< NdArray< SeFloat > > m_mags
const NdArray< SeFloat > & getMags() const
AperturePhotometryArray(const std::vector< AperturePhotometry > &measurements)
std::unique_ptr< NdArray< SeFloat > > m_fluxes
const NdArray< SeFloat > & getMagErrors() const
const NdArray< int64_t > & getFlags() const
std::unique_ptr< NdArray< SeFloat > > m_mag_errors
std::unique_ptr< NdArray< int64_t > > m_flags
const NdArray< SeFloat > & getFluxes() const
Base class for all Properties. (has no actual content).
Definition Property.h:33
T front(T... args)
std::unique_ptr< T > make_unique(Args &&... args)
constexpr int64_t flags2long(const Flags &a)
Definition SourceFlags.h:90
T size(T... args)