33 #include "paramfile.h" 34 #include "healpix_data_io.h" 41 #include "fitshandle.h" 42 #include "levels_facilities.h" 43 #include "lsconstants.h" 50 template<
typename T>
void smoothing_cxx (paramfile ¶ms)
52 int nlmax = params.template find<int>(
"nlmax");
53 string infile = params.template find<string>(
"infile");
54 string outfile = params.template find<string>(
"outfile");
55 bool polarisation = params.template find<bool>(
"polarisation");
56 int num_iter = params.template find<int>(
"iter_order",0);
57 double fwhm = arcmin2rad*params.template find<double>(
"fwhm_arcmin");
59 cout <<
"NOTE: negative FWHM supplied, doing a deconvolution..." << endl;
60 bool do_pwgt = params.param_present(
"pixelweights");
61 planck_assert(!(params.param_present(
"ringweights")&&do_pwgt),
62 "both pixel and ring weights specified");
63 planck_assert((num_iter==0)||(!do_pwgt),
64 "iterative analysis cannot be done in combination with pixel weights");
73 cout <<
"WARNING: replaced " << nmod <<
74 " undefined map pixels with a value of 0" << endl;
81 auto pwgt = read_fullweights_from_fits(
82 params.template find<string>(
"pixelweights"), map.
Nside());
87 get_ring_weights (params,map.
Nside(),weight);
93 smoothWithGauss (alm, fwhm);
107 cout <<
"WARNING: replaced " << nmod <<
108 " undefined map pixels with a value of 0" << endl;
115 auto pwgt = read_fullweights_from_fits(
116 params.template find<string>(
"pixelweights"), mapT.
Nside());
123 get_ring_weights (params,mapT.
Nside(),weight);
125 Alm<xcomplex<T> > almT(nlmax,nlmax), almG(nlmax,nlmax), almC(nlmax,nlmax);
131 (mapT,mapQ,mapU,almT,almG,almC,num_iter,weight);
132 smoothWithGauss (almT, almG, almC, fwhm);
142 int smoothing_cxx_module (
int argc,
const char **argv)
144 module_startup (
"smoothing_cxx", argc, argv);
145 paramfile params (getParamsFromCmdline(argc,argv));
147 bool dp = params.find<
bool> (
"double_precision",
false);
148 dp ? smoothing_cxx<double>(params) : smoothing_cxx<float>(params);
void map2alm_pol_iter(const Healpix_Map< T > &mapT, const Healpix_Map< T > &mapQ, const Healpix_Map< T > &mapU, Alm< xcomplex< T > > &almT, Alm< xcomplex< T > > &almG, Alm< xcomplex< T > > &almC, int num_iter, const arr< double > &weight)
void apply_fullweights(Healpix_Map< T > &map, const std::vector< double > &wgt)
void read_Healpix_map_from_fits(fitshandle &inp, Healpix_Map< T > &map, int colnum)
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)
tsize replaceUndefWith0()
Healpix_Ordering_Scheme Scheme() const
void write_Healpix_map_to_fits(fitshandle &out, const Healpix_Map< T > &map, PDT datatype)
void map2alm_iter(const Healpix_Map< T > &map, Alm< xcomplex< T > > &alm, int num_iter, const arr< double > &weight)
void alm2map(const Alm< xcomplex< T > > &alm, Healpix_Map< T > &map, bool add_map)