explicit_mapmaking
 All Classes Files Pages
eigenstructure.hpp
Go to the documentation of this file.
1 
8 #ifndef EXPLICIT_MAPMAKING_EIGENSTRUCTURE_HPP_
9 #define EXPLICIT_MAPMAKING_EIGENSTRUCTURE_HPP_
10 
11 #include "grid.hpp"
12 #include "matrix.hpp"
13 #include <stdio.h>
14 #include <boost/filesystem.hpp>
15 
16 namespace fs = boost::filesystem;
17 
18 namespace mapmaking {
20 
21  public:
22  Eigenstructure(Grid* grid, fs::path folder);
23  Eigenstructure(Grid* grid, int n_row, int n_col) :
24  grid_(grid), vectors_(grid, n_row, n_col), values_(grid, n_row, 1) {}
25  Matrix ModesAmplitude(Matrix& map);
26  void WeightModes(Matrix* map, std::function<double(double mode_amplitude, double eigenvalue)> weighting_function);
27  void ThresholdModes(Matrix* map, double relative_threshold);
28  void InvertEigenvalues();
29  Matrix WhiteNoiseMap(double relative_threshold);
30  void Save(fs::path folder, const std::vector<int>& obspix);
31  void Save(fs::path folder, fs::path obspix_file);
32 
33  protected:
34  Matrix vectors_;
35  Matrix values_;
36  Grid* grid_;
37  double max_eigenvalue_ = 0;
38  std::vector<double>* vectors() { return vectors_.local_part(); }
39  void SetEigenvalues(std::vector<double>& values, int root_proc);
40  void SetMaxEigenvalue();
41 
42  private:
43  friend class AtFA;
44 };
45 }
46 
47 #endif // EXPLICIT_MAPMAKING_EIGENSTRUCTURE_HPP_
Distributed matrix (see scalapack)
Definition: grid.hpp:16
Definition: atfa.hpp:18
Definition: atfa.hpp:19
Handle a scalapack grid of processors.
Definition: eigenstructure.hpp:19
Definition: matrix.hpp:22