explicit_mapmaking
 All Classes Files Pages
data_manager.hpp
Go to the documentation of this file.
1 
8 #ifndef EXPLICIT_MAPMAKING_DATA_MANAGER_HPP_
9 #define EXPLICIT_MAPMAKING_DATA_MANAGER_HPP_
10 
11 #include "ces.hpp"
12 #include <mpi.h>
13 #include <vector>
14 #include <list>
15 #include <boost/filesystem.hpp>
16 
17 namespace fs = boost::filesystem;
18 
19 namespace mapmaking {
20 
21 class DataManager {
22  public:
23  DataManager(const std::vector<int>& obspix, const MPI_Comm comm,
24  char stokes, int n_poly);
25  void SetNCESHitThreshold(int n_ces_hits, int max_n_pixel);
26  int n_pixel() const { return obspix_.size(); };
27  char stokes() const { return stokes_; };
28  std::vector<int> obspix() const { return obspix_; }
29  CES& AddCES(int n_sample) { ceses_.emplace_back(n_sample, filters_); return ceses_.back(); }
30  std::list<CES>& ceses() { return ceses_; }
31  void CompressCESes();
32  void RemovePathologicalPixels(double threshold);
33  void WhiteNoise();
34  void SetObspix(fs::path obspix_filename);
35  void SaveObspix(fs::path obspix_filename);
36  void ComputeCcCsSsNhits();
37  void SaveCcCsSsNhitsWeigths(fs::path filename);
38 
39  private:
40  std::vector<double> cc_; // Root only >
41  std::vector<double> cs_;
42  std::vector<double> ss_;
43  std::vector<double> weights_;
44  std::vector<int> nhits_; // Root only <
45  std::vector<int> obspix_;
46  Filters filters_;
47  int my_rank_;
48  int n_proc_;
49  char stokes_;
50  const MPI_Comm comm_;
51  std::list<CES> ceses_;
52  void MaskPixels(std::vector<int> mask); // mask[p] = 0 => pixel p is rejected
53 };
54 }
55 
56 #endif // EXPLICIT_MAPMAKING_DATA_MANAGER_HPP_
Definition: data_manager.hpp:21
Definition: filters.hpp:17
Definition: atfa.hpp:18
Data storage and accessing.
Definition: ces.hpp:34