Alexandria  2.18
Please provide a description of the project.
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 
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
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 
54 }
55 
56 } // namespace SourceCatalog
57 } // end of namespace Euclid
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:218
std::string
STL class.
std::shared_ptr
STL class.
Euclid::SourceCatalog::FluxErrorPair
Definition: Photometry.h:41
Photometry.h
Euclid::SourceCatalog::Photometry::getFilterNames
const std::shared_ptr< std::vector< std::string > > & getFilterNames() const
Definition: Photometry.cpp:52
Euclid::SourceCatalog::Photometry::m_value_vector
std::vector< FluxErrorPair > m_value_vector
The photometry map.
Definition: Photometry.h:221
std::vector::begin
T begin(T... args)
std::vector::end
T end(T... args)
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
std::unique_ptr
STL class.
Euclid
Definition: InstOrRefHolder.h:29