Citlali
Loading...
Searching...
No Matches
toltec_io.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <map>
5
6#include <Eigen/Core>
7
8namespace engine_utils {
9
10class toltecIO {
11public:
12 // data type
13 enum DataType {
14 toltec = 0,
15 apt = 1,
16 ppt = 2,
17 source = 3
18 };
19
20 // product type
21 enum ProdType {
22 map = 0,
23 noise = 1,
24 psd = 2,
25 hist = 3,
28 stats = 6
29 };
30
31 // raw or filtered
33 raw = 0,
35 };
36
37 std::map<Eigen::Index, Eigen::Index> nw_to_array_map = {
38 {0, 0},
39 {1, 0},
40 {2, 0},
41 {3, 0},
42 {4, 0},
43 {5, 0},
44 {6, 0},
45 {7, 1},
46 {8, 1},
47 {9, 1},
48 {10, 1},
49 {11, 2},
50 {12, 2},
51 };
52
53 // map from array index to array name
54 std::map<Eigen::Index, std::string> array_name_map = {
55 {0,"a1100"},
56 {1,"a1400"},
57 {2,"a2000"},
58 };
59
60 // map from array index to array wavelength
61 std::map<Eigen::Index, double> array_wavelength_map = {
62 {0,1.1},
63 {1,1.4},
64 {2,2.0},
65 };
66
67 // map from array index to array frequencies
68 std::map<Eigen::Index, double> array_freq_map = {
69 {0,c_m_s/(1.1/1000)},
70 {1,c_m_s/(1.4/1000)},
71 {2,c_m_s/(2.0/1000)},
72 };
73
74 // expected fwhms
75 std::map<Eigen::Index, double> array_fwhm_arcsec = {
76 {0, 5.0},
77 {1, 6.3},
78 {2, 9.5},
79 };
80
81 template <toltecIO::DataType data_t, toltecIO::ProdType prod_t, toltecIO::FilterType filter_t>
82 std::string create_filename(const std::string, const std::string, std::string, std::string, const bool);
83};
84
85template <toltecIO::DataType data_t, toltecIO::ProdType prod_t, toltecIO::FilterType filter_t>
86std::string toltecIO::create_filename(const std::string filepath, const std::string redu_type,
87 std::string array_name, std::string obsnum, const bool simu_obs) {
88 std::string filename = filepath;
89
90 // data type
91 if constexpr (data_t == toltec) filename += "toltec";
92 else if constexpr (data_t == apt) filename += "apt";
93 else if constexpr (data_t == ppt) filename += "ppt";
94 else if constexpr (data_t == source) filename += "source";
95
96 // real data or simulation
97 filename += simu_obs ? "_simu" : "_commissioning";
98
99 // add array name, redu_type, and obsnum if they are not empty
100 if (!array_name.empty()) filename += "_" + array_name;
101 if (!redu_type.empty()) filename += "_" + redu_type;
102 if (!obsnum.empty()) filename += "_" + obsnum;
103
104 // product type
105 if constexpr (prod_t == noise) filename += "_noise";
106 else if constexpr (prod_t == psd) filename += "_psd";
107 else if constexpr (prod_t == hist) filename += "_hist";
108 else if constexpr (prod_t == rtc_timestream) filename += "_rtc_timestream";
109 else if constexpr (prod_t == ptc_timestream) filename += "_ptc_timestream";
110 else if constexpr (prod_t == stats) filename += "_stats";
111
112 if constexpr (filter_t == filtered) {
113 filename += "_filtered";
114 }
115
116 // filtered map or add pipeline to maps or noise maps
117 if constexpr (prod_t == map || prod_t == noise) {
118 filename += "_citlali";
119 }
120
121 return filename;
122}
123
124} // namespace engine utils
Definition toltec_io.h:10
ProdType
Definition toltec_io.h:21
@ map
Definition toltec_io.h:22
@ hist
Definition toltec_io.h:25
@ stats
Definition toltec_io.h:28
@ ptc_timestream
Definition toltec_io.h:27
@ rtc_timestream
Definition toltec_io.h:26
@ noise
Definition toltec_io.h:23
@ psd
Definition toltec_io.h:24
std::map< Eigen::Index, std::string > array_name_map
Definition toltec_io.h:54
std::map< Eigen::Index, double > array_freq_map
Definition toltec_io.h:68
std::map< Eigen::Index, double > array_wavelength_map
Definition toltec_io.h:61
DataType
Definition toltec_io.h:13
@ source
Definition toltec_io.h:17
@ apt
Definition toltec_io.h:15
@ toltec
Definition toltec_io.h:14
@ ppt
Definition toltec_io.h:16
FilterType
Definition toltec_io.h:32
@ filtered
Definition toltec_io.h:34
@ raw
Definition toltec_io.h:33
std::map< Eigen::Index, Eigen::Index > nw_to_array_map
Definition toltec_io.h:37
std::string create_filename(const std::string, const std::string, std::string, std::string, const bool)
Definition toltec_io.h:86
std::map< Eigen::Index, double > array_fwhm_arcsec
Definition toltec_io.h:75
#define c_m_s
Definition constants.h:12
Definition fitting.h:11