34 #include "healpix_data_io.h" 42 #include "levels_facilities.h" 51 template<
typename T>
void alm2map_cxx (
paramfile ¶ms)
53 int nlmax = params.template find<int>(
"nlmax");
54 int nmmax = params.template find<int>(
"nmmax",nlmax);
55 planck_assert(nmmax<=nlmax,
"nmmax must not be larger than nlmax");
56 string infile = params.template find<string>(
"infile");
57 string outfile = params.template find<string>(
"outfile");
58 int nside = params.template find<int>(
"nside");
59 double fwhm = arcmin2rad*params.template find<double>(
"fwhm_arcmin",0);
60 int cw_lmin=-1, cw_lmax=-1;
63 cw_lmin = params.template find<int>(
"cw_lmin");
64 cw_lmax = params.template find<int>(
"cw_lmax");
68 get_pixwin (params,nlmax,temp,pol);
70 bool deriv = params.template find<bool>(
"derivatives",
false);
75 if (fwhm>0) smoothWithGauss (alm, fwhm);
76 if (cw_lmin>=0) applyCosineWindow(alm, cw_lmin, cw_lmax);
78 mapdth(nside,
RING,SET_NSIDE),
79 mapdph(nside,
RING,SET_NSIDE);
82 double offset = alm(0,0).real()/sqrt(fourpi);
90 bool polarisation = params.template find<bool>(
"polarisation");
96 if (fwhm>0) smoothWithGauss (alm, fwhm);
97 if (cw_lmin>=0) applyCosineWindow(alm, cw_lmin, cw_lmax);
101 double offset = alm(0,0).real()/sqrt(fourpi);
107 planck_rng rng(params.template find<int>(
"rand_seed",42));
108 double rms = params.template find<double>(
"regnoiseT");
109 for (
int i=0; i<map.Npix(); ++i)
118 if (fwhm>0) smoothWithGauss (almT, almG, almC, fwhm);
119 if (cw_lmin>=0) applyCosineWindow(almT, almG, almC, cw_lmin, cw_lmax);
121 mapU(nside,
RING,SET_NSIDE);
125 double offset = almT(0,0).real()/sqrt(fourpi);
131 planck_rng rng(params.template find<int>(
"rand_seed",42));
132 double rmsT = params.template find<double>(
"regnoiseT"),
133 rmsQU = params.template find<double>(
"regnoiseQU");
134 for (
int i=0; i<mapT.Npix(); ++i)
147 int alm2map_cxx_module (
int argc,
const char **argv)
152 bool dp = params.
find<
bool> (
"double_precision",
false);
153 dp ? alm2map_cxx<double>(params) : alm2map_cxx<float>(params);
void alm2map_der1(const Alm< xcomplex< T > > &alm, Healpix_Map< T > &map, Healpix_Map< T > &mapdth, Healpix_Map< T > &mapdph)
void ScaleL(const arr< T2 > &factor)
void read_Alm_from_fits(fitshandle &inp, Alm< xcomplex< T > > &alms, int lmax, int mmax)
T find(const std::string &key) const
void alm2map_pol(const Alm< xcomplex< T > > &almT, const Alm< xcomplex< T > > &almG, const Alm< xcomplex< T > > &almC, Healpix_Map< T > &mapT, Healpix_Map< T > &mapQ, Healpix_Map< T > &mapU, bool add_map)
paramfile getParamsFromCmdline(int argc, const char **argv, bool verbose=true)
void module_startup(const std::string &name, bool argc_valid, const std::string &usage, bool verbose=true)
bool param_present(const std::string &key) const
void write_Healpix_map_to_fits(fitshandle &out, const Healpix_Map< T > &map, PDT datatype)
void alm2map(const Alm< xcomplex< T > > &alm, Healpix_Map< T > &map, bool add_map)
#define planck_assert(testval, msg)