-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOutputData.h
More file actions
executable file
·46 lines (35 loc) · 1.7 KB
/
Copy pathOutputData.h
File metadata and controls
executable file
·46 lines (35 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Created by Arkadiy on 21/03/2016.
//
#ifndef MEERKAT2_OUTPUTDATA_H
#define MEERKAT2_OUTPUTDATA_H
#include "misc.h"
#include "ReconstructionParameters.h"
class OutputData {
public:
OutputData(const ReconstructionParameters& par) :
size{par.number_of_pixels[0],par.number_of_pixels[1],par.number_of_pixels[2]},
rebinned_data(par.number_of_pixels[0]*par.number_of_pixels[1]*par.number_of_pixels[2]),
no_pixels_rebinned(par.number_of_pixels[0]*par.number_of_pixels[1]*par.number_of_pixels[2])
{
}
out_float_number& rebinned_data_at(int hi, int ki, int li) {return rebinned_data[hkli2i(hi,ki,li)];}
size_t& no_pixels_rebinned_at(int hi, int ki, int li) {return no_pixels_rebinned[hkli2i(hi,ki,li)];}
void save_data(string filename, ReconstructionParameters par);
size_t no_elements() {return size[0]*size[1]*size[2];}
private:
vector<out_float_number> rebinned_data;
vector<size_t> no_pixels_rebinned;
size_t size[3];
inline int hkli2i(int hi, int ki, int li) {return (hi*size[1]+ki)*size[2]+li;}
// In the simplest implementation is simply a NxMxL dataset
// Should allow to hold running sum of rebinned data and the number of pixels rebinned
// Parameterise over double or float, and different versions of INTS once we willl run in a situation
// when ints are not enough for reconstruction (possible?)
// Should know how to export results in an hdf5 file
// writing the reconstruction parameters
// In a fancier version should dynamically allocate data to save a bit of operating memory
// on the regions which are not reconstructed
// (are modulo operations here visibly slow??
};
#endif //MEERKAT2_OUTPUTDATA_H