35 #include "paramfile.h" 37 #include "lsconstants.h" 39 #include "fitshandle.h" 41 #include "string_utils.h" 44 #include "planck_rng.h" 49 int main(
int argc,
const char** argv)
51 module_startup (
"alice3", argc, argv);
52 paramfile params (getParamsFromCmdline(argc,argv));
60 int nside = params.find<
int>(
"nside");
61 int steps = params.find<
int>(
"steps",100);
62 double step_radian=arcmin2rad*params.find<
double>(
"step_arcmin",10.);
63 int kernel_steps = params.find<
int>(
"kernel_steps",50);
64 double polmin = params.find<
double>(
"polmin",-1e30),
65 polmax = params.find<
double>(
"polmax",1e30);
66 string out = params.find<
string>(
"out");
69 if (params.param_present(
"texture"))
73 planck_rng rng(params.find<
int>(
"rand_seed",42));
74 if (params.param_present(
"ell"))
76 int ell = params.find<
int>(
"ell");
77 if (ell<0) ell=2*nside;
80 cout <<
"Background texture using ell = " << ell << endl;
82 a(ell,0)=fcomplex(rng.rand_gauss(),0.);
83 for (
int m=0; m<=ell; m++)
84 { a(ell,m).real(rng.rand_gauss()); a(ell,m).imag(rng.rand_gauss()); }
89 for (
int i=0; i<th.Npix(); i++)
90 th[i] = rng.rand_uni() - 0.5;
95 tex(nside,
RING,SET_NSIDE),
96 mag(nside,
RING,SET_NSIDE);
99 PolarizationHolder ph;
103 for (
int i=0; i<mag.Npix(); i++)
104 tex[i] = th.interpolated_value(mag.pix2ang(i));
108 lic_main(Q, U, th, hit, tex, mag, steps, kernel_steps, step_radian, polmin, polmax);
void lic_main(const Healpix_Map< double > &Q, const Healpix_Map< double > &U, const Healpix_Map< double > &th, Healpix_Map< double > &hit, Healpix_Map< double > &tex, Healpix_Map< double > &mag, int steps, int kernel_steps, double step_radian, double polmin, double polmax)
void read_Healpix_map_from_fits(fitshandle &inp, Healpix_Map< T > &map, int colnum)
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)