32 #include "healpix_data_io.h" 34 #include "fitshandle.h" 35 #include "paramfile.h" 36 #include "string_utils.h" 42 void read_wring (
const string &weightfile,
int nside, arr<double> &weight)
47 planck_assert(nside==inp.get_key<
int>(
"NSIDE"),
"incorrect Nside parameter");
48 inp.read_entire_column(1,weight);
49 planck_assert(weight.size()==size_t(2*nside),
50 "incorrect number of weights in ring weight file");
55 void read_weight_ring (
const string &dir,
int nside, arr<double> &weight)
57 read_wring(dir+
"/weight_ring_n"+intToString(nside,5)+
".fits", nside, weight);
60 void get_ring_weights (paramfile ¶ms,
int nside, arr<double> &weight)
62 string weightfile = params.find<
string>(
"ringweights",
"");
63 weight.alloc (2*nside);
66 read_wring (weightfile, nside, weight);
67 for (tsize m=0; m<weight.size(); ++m) weight[m]+=1;
73 vector<double> read_fullweights_from_fits(
const std::string &weightfile,
79 planck_assert(inp.colname(1)==
"COMPRESSED PIXEL WEIGHTS",
"wrong column name");
80 planck_assert(inp.get_key<
int>(
"NSIDE")==nside,
"incorrect NSIDE parameter");
82 inp.read_entire_column(1,res);
86 void read_pixwin (
const string &file, arr<double> &temp)
92 inp.read_entire_column(1,temp);
94 inp.read_column(1,temp);
96 void read_pixwin (
const string &file, arr<double> &temp, arr<double> &pol)
102 inp.read_entire_column(1,temp);
104 inp.read_column(1,temp);
106 inp.read_entire_column(2,pol);
108 inp.read_column(2,pol);
111 void get_pixwin (paramfile ¶ms,
int lmax, arr<double> &pixwin)
113 string windowfile = params.find<
string>(
"windowfile",
"");
114 pixwin.alloc(lmax+1);
117 read_pixwin (windowfile,pixwin);
119 void get_pixwin (paramfile ¶ms,
int lmax, arr<double> &pixwin,
120 arr<double> &pixwin_pol)
122 string windowfile = params.find<
string>(
"windowfile",
"");
123 pixwin.alloc(lmax+1);
125 pixwin_pol.alloc(lmax+1);
128 read_pixwin (windowfile,pixwin,pixwin_pol);