33 #include "paramfile.h" 36 #include "fitshandle.h" 37 #include "levels_facilities.h" 42 int hotspots_cxx_module (
int argc,
const char **argv)
44 module_startup (
"hotspots_cxx", argc, argv);
45 paramfile params (getParamsFromCmdline(argc,argv));
47 string infile = params.find<
string>(
"infile");
48 string mapfile = params.find<
string>(
"outmap",
"");
49 bool have_mapfile = mapfile!=
"";
50 string minfile = params.find<
string>(
"minfile",
"");
51 bool have_minfile = minfile!=
"";
52 string maxfile = params.find<
string>(
"maxfile",
"");
53 bool have_maxfile = maxfile!=
"";
54 planck_assert (have_mapfile || have_minfile || have_maxfile,
55 "no output file specified");
62 ofstream minout, maxout;
63 if (have_minfile) minout.open(minfile.c_str());
64 if (have_maxfile) maxout.open(maxfile.c_str());
68 for (
int m=0; m<inmap.
Npix(); ++m)
70 float value = inmap[m];
74 bool ismax=
true, ismin=
true;
75 for (tsize n=0; n<nb.size(); ++n)
79 float nbval = inmap[nb[n]];
82 if (nbval>=value) ismax=
false;
83 if (nbval<=value) ismin=
false;
89 if (have_minfile && ismin) minout << m <<
" " << value << endl;
90 if (have_maxfile && ismax) maxout << m <<
" " << value << endl;
void Set(arr< T > &data, Healpix_Ordering_Scheme scheme)
void read_Healpix_map_from_fits(fitshandle &inp, Healpix_Map< T > &map, int colnum)
Healpix_Ordering_Scheme Scheme() const
void write_Healpix_map_to_fits(fitshandle &out, const Healpix_Map< T > &map, PDT datatype)
const double Healpix_undef
Healpix value representing "undefined".
void neighbors(I pix, fix_arr< I, 8 > &result) const