42 unsigned int healpix_repcount (
tsize npix)
44 if (npix<1024)
return 1;
45 if ((npix%1024)==0)
return 1024;
46 return isqrt (npix/12);
52 string polcconv=inp.
get_key<
string>(
"POLCCONV");
53 planck_assert((polcconv==
"COSMO")||(polcconv==
"IAU"),
"bad POLCCONV keyword");
54 return (polcconv==
"IAU");
64 int64 nside = inp.
get_key<
int>(
"NSIDE");
66 string(
"mismatch between number of map pixels (" 68 map.
Set (myarr, string2HealpixScheme(inp.
get_key<
string>(
"ORDERING")));
94 (
const string &filename,
Healpix_Map<T> &map,
int colnum,
int hdunum)
110 (
const string &filename,
int colnum,
int hdunum)
118 (
const string &filename,
int colnum,
int hdunum);
120 (
const string &filename,
int colnum,
int hdunum);
122 (
const string &filename,
int colnum,
int hdunum);
128 int64 nside = inp.
get_key<
int>(
"NSIDE");
130 = string2HealpixScheme(inp.
get_key<
string>(
"ORDERING"));
135 inp.
nelems(3)),
"mismatch between number of map pixels and Nside");
138 while(cm.getNext(offset,ppix))
145 for (
int i=0; i<mapU.
Npix(); ++i)
177 vector<fitscolumn> cols;
178 int repcount = healpix_repcount (base.
Npix());
180 cols.push_back (
fitscolumn (colname[m],
"unknown",repcount, datatype));
182 out.
set_key (
"PIXTYPE",
string(
"HEALPIX"),
"HEALPIX pixelisation");
183 string ordering = (base.
Scheme()==
RING) ?
"RING" :
"NESTED";
184 out.
set_key (
"ORDERING",ordering,
185 "Pixel ordering scheme, either RING or NESTED");
186 out.
set_key (
"NSIDE",base.
Nside(),
"Resolution parameter for HEALPIX");
187 out.
set_key (
"FIRSTPIX",0,
"First pixel # (0 based)");
188 out.
set_key (
"LASTPIX",base.
Npix()-1,
"Last pixel # (0 based)");
189 out.
set_key (
"INDXSCHM",
string(
"IMPLICIT"),
190 "Indexing: IMPLICIT or EXPLICIT");
197 colname[0] =
"TEMPERATURE";
215 colname[0] =
"TEMPERATURE";
216 colname[1] =
"Q_POLARISATION";
217 colname[2] =
"U_POLARISATION";
219 out.
set_key (
"POLCCONV",
string(
"COSMO"));
222 while(cm.getNext(offset,ppix))
void SetNside(int nside, Healpix_Ordering_Scheme scheme)
int64 nelems(int i) const
void get_key(const std::string &name, T &value) const
void open(const std::string &fname)
int64 efficientChunkSize(int i) const
void insert_bintab(const std::vector< fitscolumn > &cols, const std::string &extname="xtension")
void Set(arr< T > &data, Healpix_Ordering_Scheme scheme)
void read_column_raw(int colnum, T *data, int64 num, int64 offset=0) const
void write_column(int colnum, const arr< T > &data, int64 offset=0)
void read_Healpix_map_from_fits(fitshandle &inp, Healpix_Map< T > &map, int colnum)
void set_key(const std::string &name, const T &value, const std::string &comment="")
void write_column_raw(int colnum, const T *data, int64 num, int64 offset=0)
Healpix_Ordering_Scheme Scheme() const
void write_Healpix_map_to_fits(fitshandle &out, const Healpix_Map< T > &map, PDT datatype)
void prepare_Healpix_fitsmap(fitshandle &out, const Healpix_Base &base, PDT datatype, const arr< std::string > &colname)
std::string dataToString(const T &x)
#define planck_assert(testval, msg)
void read_entire_column(int colnum, arr< T > &data) const
bool key_present(const std::string &name) const
const arr< T > & Map() const