DP3
CalType.h
Go to the documentation of this file.
1 // Copyright (C) 2022 ASTRON (Netherlands Institute for Radio Astronomy)
2 // SPDX-License-Identifier: GPL-3.0-or-later
3 
4 #ifndef DP3_BASE_CALTYPE_H_
5 #define DP3_BASE_CALTYPE_H_
6 
7 #include <string>
8 
9 namespace dp3::base {
10 
11 enum class CalType {
12  kScalar,
15  kDiagonal,
18  kFullJones,
19  kTec,
23  kTecScreen,
25  kRotation,
27  kLeakage,
29 };
30 
32 CalType StringToCalType(const std::string& mode);
33 
35 std::string ToString(CalType caltype);
36 
37 constexpr size_t GetNPolarizations(CalType cal_type) {
38  switch (cal_type) {
39  case CalType::kDiagonal:
42  return 2;
45  case CalType::kRotation:
47  case CalType::kLeakage:
49  return 4;
50  case CalType::kScalar:
53  case CalType::kTec:
58  return 1;
59  }
60  return 0;
61 }
62 
63 } // namespace dp3::base
64 
65 #endif // DP3_CALTYPE_H
Definition: Apply.h:15
CalType StringToCalType(const std::string &mode)
Convert string to a CalType.
CalType
Definition: CalType.h:11
std::string ToString(CalType caltype)
Convert CalType to a string.
constexpr size_t GetNPolarizations(CalType cal_type)
Definition: CalType.h:37