99 "Import_nograde: maps have different nside");
101 for (
int m=0; m<npix_; ++m) map[m] = orig.map[m];
109 #pragma omp for schedule (dynamic,5000) 110 for (m=0; m<npix_; ++m) map[(this->*swapper)(m)] = orig.map[m];
121 planck_assert(nside_>orig.
nside_,
"Import_upgrade: this is no upgrade");
122 int fact = nside_/orig.
nside_;
123 planck_assert (nside_==orig.
nside_*fact,
124 "the larger Nside must be a multiple of the smaller one");
129 #pragma omp for schedule (dynamic,5000) 130 for (m=0; m<orig.npix_; ++m)
133 orig.pix2xyf(m,x,y,f);
134 for (
int j=fact*y; j<fact*(y+1); ++j)
135 for (
int i=fact*x; i<fact*(x+1); ++i)
137 int mypix = xyf2pix(i,j,f);
138 map[mypix] = orig.map[m];
153 void Import_degrade (
const Healpix_Map<T> &orig,
bool pessimistic=
false);
164 if (orig.
nside_ == nside_)
165 Import_nograde(orig);
166 else if (orig.
nside_ < nside_)
167 Import_upgrade(orig);
169 Import_degrade(orig,pessimistic);
173 const T &operator[] (
int pix)
const {
return map[pix]; }
175 T &operator[] (
int pix) {
return map[pix]; }
181 swapfunc swapper = (scheme_ ==
NEST) ?
184 arr<int> cycle=swap_cycles();
186 #pragma omp parallel for schedule(dynamic,1) 187 for (tsize m=0; m<cycle.size(); ++m)
189 int istart = cycle[m];
191 T pixbuf = map[istart];
192 int iold = istart, inew = (this->*swapper)(istart);
193 while (inew != istart)
195 map[iold] = map[inew];
197 inew = (this->*swapper)(inew);
206 const fix_arr<double,4> &wgt)
const 210 for (tsize i=0; i<4; ++i)
214 { res+=T(val*wgt[i]); wtot+=wgt[i]; }
222 fix_arr<double,4> wgt;
223 get_interpol (ptg, pix, wgt);
224 return interpolation (pix, wgt);
228 const arr<T> &
Map()
const {
return map; }
234 void minmax (T &Min, T &Max)
const;
246 kahan_adder<double> adder;
248 for (
int m=0; m<npix_; ++m)
250 { ++pix; adder.add(map[m]); }
257 for (
int m=0; m<npix_; ++m)
265 for (
int m=0; m<npix_; ++m)
278 for (
int m=0; m<npix_; ++m)
280 { ++pix; result+=map[m]*map[m]; }
290 for (
int m=0; m<npix_; ++m)
292 { result = max(result,abs(map[m])); }
299 for (
int m=0; m<npix_; ++m)
309 for (
int m=0; m<npix_; ++m)
311 { map[m]=0.; ++res; }
bool fullyDefined() const
void SetNside(int nside, Healpix_Ordering_Scheme scheme)
void swap(Healpix_Map &other)
void Set(arr< T > &data, Healpix_Ordering_Scheme scheme)
Healpix_Map(const arr< T > &data, Healpix_Ordering_Scheme scheme)
T interpolated_value(const pointing &ptg) const
void Import(const Healpix_Map< T > &orig, bool pessimistic=false)
tsize replaceUndefWith0()
void SetNside(I nside, Healpix_Ordering_Scheme scheme)
void swap(T_Healpix_Base &other)
void Set(int order, Healpix_Ordering_Scheme scheme)
void Set(int order, Healpix_Ordering_Scheme scheme)
static I npix2nside(I npix)
const double Healpix_undef
Healpix value representing "undefined".
Healpix_Map(int order, Healpix_Ordering_Scheme scheme)
void Import_nograde(const Healpix_Map< T > &orig)
T interpolation(const fix_arr< int, 4 > &pix, const fix_arr< double, 4 > &wgt) const
Healpix_Map(int nside, Healpix_Ordering_Scheme scheme, const nside_dummy)
const arr< T > & Map() const
void Import_upgrade(const Healpix_Map< T > &orig)
Healpix_Ordering_Scheme scheme_