33 #include "paramfile.h" 34 #include "healpix_data_io.h" 40 #include "fitshandle.h" 41 #include "levels_facilities.h" 42 #include "lsconstants.h" 49 template<
typename T>
void mult_alm (paramfile ¶ms)
51 string infile = params.template find<string>(
"infile");
52 string outfile = params.template find<string>(
"outfile");
53 string pixwin_in = params.template find<string>(
"pixwin_in",
"");
54 string pixwin_out = params.template find<string>(
"pixwin_out",
"");
55 string cl_in = params.template find<string>(
"cl_in",
"");
56 string cl_out = params.template find<string>(
"cl_out",
"");
57 double fwhm_in = arcmin2rad*params.template find<double>(
"fwhm_arcmin_in",0);
58 planck_assert (fwhm_in>=0,
"fwhm_arcmin_in must be >= 0");
59 double fwhm_out = arcmin2rad*params.template find<double>(
"fwhm_arcmin_out",0);
60 planck_assert (fwhm_out>=0,
"fwhm_arcmin_out must be >= 0");
61 int cw_lmin=-1, cw_lmax=-1;
62 if (params.param_present(
"cw_lmin"))
64 cw_lmin = params.template find<int>(
"cw_lmin");
65 cw_lmax = params.template find<int>(
"cw_lmax");
68 bool polarisation = params.template find<bool>(
"polarisation");
75 if (fwhm_in>0) smoothWithGauss (alm, -fwhm_in);
76 arr<double> temp(nlmax+1);
80 read_pixwin(pixwin_in,temp);
81 for (
int l=0; l<=nlmax; ++l)
88 for (
int l=0; l<=nlmax; ++l)
89 temp[l] = 1./sqrt(tps.
tt(l));
94 read_pixwin(pixwin_out,temp);
100 for (
int l=0; l<=nlmax; ++l)
101 temp[l] = sqrt(tps.
tt(l));
104 if (fwhm_out>0) smoothWithGauss (alm, fwhm_out);
105 if (cw_lmin>=0) applyCosineWindow(alm, cw_lmin, cw_lmax);
114 if (fwhm_in>0) smoothWithGauss (almT, almG, almC, -fwhm_in);
115 arr<double> temp(nlmax+1), pol(nlmax+1);
118 read_pixwin(pixwin_in,temp,pol);
119 for (
int l=0; l<=nlmax; ++l)
120 { temp[l] = 1/temp[l];
if (pol[l]!=0.) pol[l] = 1/pol[l]; }
124 planck_fail (
"power spectra not (yet) supported with polarisation");
127 read_pixwin(pixwin_out,temp,pol);
131 planck_fail (
"power spectra not (yet) supported with polarisation");
132 if (fwhm_out>0) smoothWithGauss (almT, almG, almC, fwhm_out);
133 if (cw_lmin>=0) applyCosineWindow(almT, almG, almC, cw_lmin, cw_lmax);
140 int mult_alm_module (
int argc,
const char **argv)
142 module_startup (
"mult_alm", argc, argv);
143 paramfile params (getParamsFromCmdline(argc,argv));
145 bool dp = params.find<
bool> (
"double_precision",
false);
146 dp ? mult_alm<double>(params) : mult_alm<float>(params);
void write_Alm_to_fits(fitshandle &out, const Alm< xcomplex< T > > &alms, int lmax, int mmax, PDT datatype)
void ScaleL(const arr< T2 > &factor)
void read_Alm_from_fits(fitshandle &inp, Alm< xcomplex< T > > &alms, int lmax, int mmax)
const arr< double > & tt() const
void get_almsize_pol(const std::string &filename, int &lmax, int &mmax)
void read_powspec_from_fits(fitshandle &inp, PowSpec &powspec, int nspecs, int lmax)
void get_almsize(fitshandle &inp, int &lmax, int &mmax)