Alexandria
2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
SourceCatalog
src
lib
Photometry.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2012-2021 Euclid Science Ground Segment
3
*
4
* This library is free software; you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License as published by the Free
6
* Software Foundation; either version 3.0 of the License, or (at your option)
7
* any later version.
8
*
9
* This library is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12
* details.
13
*
14
* You should have received a copy of the GNU Lesser General Public License
15
* along with this library; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
26
#include "
SourceCatalog/SourceAttributes/Photometry.h
"
27
28
namespace
Euclid
{
29
namespace
SourceCatalog {
30
31
//-----------------------------------------------------------------------------
32
// find the value and error in the map for a specific filter name
33
// return a ptr to a ValuePair(value, error) and null pointer otherwise
34
std::unique_ptr<FluxErrorPair>
Photometry::find
(
const
std::string
&
filter_name
)
const
{
35
std::unique_ptr<FluxErrorPair>
flux_found_ptr
{};
36
auto
filter_iter
=
m_filter_name_vector_ptr
->
begin
();
37
auto
photometry_iter
=
m_value_vector
.begin();
38
while
(
filter_iter
!=
m_filter_name_vector_ptr
->
end
()) {
39
if
(*
filter_iter
==
filter_name
) {
40
break
;
41
}
42
++
filter_iter
;
43
++
photometry_iter
;
44
}
45
if
(
filter_iter
!=
m_filter_name_vector_ptr
->
end
()) {
46
flux_found_ptr
=
std::unique_ptr<FluxErrorPair>
{
new
FluxErrorPair
{*
photometry_iter
}};
47
}
48
49
return
flux_found_ptr
;
50
}
// Eof Photometry::find
51
52
const
std::shared_ptr<std::vector<std::string>
>&
Photometry::getFilterNames
()
const
{
53
return
m_filter_name_vector_ptr
;
54
}
55
56
}
// namespace SourceCatalog
57
}
// end of namespace Euclid
Photometry.h
std::string
std::vector::begin
T begin(T... args)
Euclid::SourceCatalog::Coordinates
Store the Right Ascension (Ra) and Delination (Dec) of a source in decimal degrees,...
Definition
Coordinates.h:41
Euclid::SourceCatalog::Photometry::m_filter_name_vector_ptr
std::shared_ptr< std::vector< std::string > > m_filter_name_vector_ptr
Shared pointer to the common list of filter names.
Definition
Photometry.h:226
Euclid::SourceCatalog::Photometry::m_value_vector
std::vector< FluxErrorPair > m_value_vector
The photometry map.
Definition
Photometry.h:229
Euclid::SourceCatalog::Photometry::find
std::unique_ptr< FluxErrorPair > find(const std::string &filter_name) const
Return a photometry measurement through the specified filter. The current implementation of this meth...
Definition
Photometry.cpp:34
Euclid::SourceCatalog::Photometry::getFilterNames
const std::shared_ptr< std::vector< std::string > > & getFilterNames() const
Definition
Photometry.cpp:52
std::vector::end
T end(T... args)
Euclid
Definition
index_sequence.h:27
std::shared_ptr
Euclid::SourceCatalog::FluxErrorPair
Definition
Photometry.h:41
std::unique_ptr
Generated by
1.9.8