33 #include "paramfile.h" 34 #include "planck_rng.h" 40 #include "fitshandle.h" 41 #include "levels_facilities.h" 42 #include "lsconstants.h" 49 template<
typename T>
void syn_alm_cxx (paramfile ¶ms)
51 int nlmax = params.template find<int>(
"nlmax");
52 int nmmax = params.template find<int>(
"nmmax",nlmax);
53 planck_assert(nmmax<=nlmax,
"nmmax must not be larger than nlmax");
54 string infile = params.template find<string>(
"infile");
55 string outfile = params.template find<string>(
"outfile");
56 int rand_seed = params.template find<int>(
"rand_seed");
57 double fwhm = arcmin2rad*params.template find<double>(
"fwhm_arcmin",0.);
58 bool polarisation = params.template find<bool>(
"polarisation");
59 bool full_ps = params.template find<bool>(
"full_ps",
false);
62 int nspecs = polarisation ? (full_ps ? 6 : 4 ) : 1;
64 powspec.smoothWithGauss(fwhm);
66 planck_rng rng(rand_seed);
71 almT(nlmax,nmmax), almG(nlmax,nmmax), almC(nlmax,nmmax);
85 int syn_alm_cxx_module (
int argc,
const char **argv)
87 module_startup (
"syn_alm_cxx", argc, argv);
88 paramfile params (getParamsFromCmdline(argc,argv));
90 bool dp = params.find<
bool> (
"double_precision",
false);
91 dp ? syn_alm_cxx<double>(params) : syn_alm_cxx<float>(params);
void write_Alm_to_fits(fitshandle &out, const Alm< xcomplex< T > > &alms, int lmax, int mmax, PDT datatype)
void create_alm_pol(const PowSpec &ps, Alm< xcomplex< T > > &almT, Alm< xcomplex< T > > &almG, Alm< xcomplex< T > > &almC, planck_rng &rng)
void read_powspec_from_fits(fitshandle &inp, PowSpec &powspec, int nspecs, int lmax)
void create_alm(const PowSpec &powspec, Alm< xcomplex< T > > &alm, planck_rng &rng)