Commit 2806250f authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

last

parent 9a3dc517
......@@ -74,20 +74,23 @@ void rm_lst_tmp (int nfile, string** arr){
string get_tmp_file (string str){
string tempdir = getenv("TMPDIR");
char* tempdir = getenv("TMPDIR");
if (tempdir==NULL)
tempdir = "/tmp";
char tplt[100];
sprintf(tplt, "%s/%sXXXXXX", tempdir, str);
sprintf(tplt, "%s/%s%d", tempdir, str.c_str(), rand());
string out = tplt;
return out;
}
void get_lst_tmp (int nfile, string str, string** arr){
(*arr) = new string[nfile];
string tempdir = getenv("TMPDIR");
char* tempdir = getenv("TMPDIR");
if (tempdir==NULL)
tempdir = "/tmp";
char tplt[100];
for (int i=0; i<nfile; i++) {
sprintf(tplt, "%s/%sXXXXXX", tempdir, str);
mkstemp(tplt);
sprintf(tplt, "%s/%s%d", tempdir, str.c_str(), rand());
(*arr)[i] = tplt;
}
}
......
infile = file1.fits file2.fits file3.fits
mixcol = 1 1 1
outfile = cmb.fits
\ No newline at end of file
outfile = cmb-fullsky.fits
\ No newline at end of file
infile = file1.fits file2.fits file3.fits
mixcol = 1 1 1
outfile = cmb.fits
outfile = cmb-grid.fits
zonefile = grid.fits
\ No newline at end of file
infile = file1.fits file2.fits file3.fits
mixcol = 1 1 1
outfile = cmb.fits
outfile = cmb-needlet.fits
zonefile = grid1.fits grid2.fits
bands = 0 256 512 1024
\ No newline at end of file
bands = 0 128 256 512
\ No newline at end of file
......@@ -30,6 +30,7 @@
int main(int argc ,const char** argv)
{
srand ( time(NULL) );
timeval start, end;
char** ptr ;
ptr = const_cast <char **> (argv);
......@@ -89,10 +90,8 @@ int main(int argc ,const char** argv)
string sbands = params.find<string> ("bands","");
string* stbands;
int nbands2 = parse_list (sbands, &stbands);
if (nbands2 == 0) {
if (nbands2 == 0)
pixel_based = true;
nbands = 1;
}
else if (nbands!=nbands2-2){
fprintf(stderr,"\nERROR!!! Can't parse 'bands' parameter. Found %d elements vs %d zones\n",nbands2,nbands);
return 1;
......@@ -162,14 +161,17 @@ int main(int argc ,const char** argv)
fprintf(stderr,"\nERROR!!! Missing 'nside' parameter\n");
return 1;
}
bool ztorm=false;
if (nbands==0){
get_lst_tmp (1, "zone", &zonefile);
MapExt<int> mask;
mask.SetNside(nside, RING);
mask.fill(0);
mask.fill(1);
fitshandle out;
out.create(zonefile[0]);
write_Healpix_map_to_fits (out, mask,planckType<int>());
ztorm=true;
}
arr<double> onearr(nbands);
onearr.fill(1);
......@@ -199,6 +201,8 @@ int main(int argc ,const char** argv)
combinezone<double> (infile, nbin, outfile, ilcfile,zonefile[0]);
rm_tmp_file(statfile);
rm_tmp_file(ilcfile);
if (ztorm)
rm_tmp_file(zonefile);
}
else{
......
infile = file1.fits file2.fits file3.fits
mixcol = 1 1 1
outfile = cmb.fits
outfile = cmb-patch.fits
zonefile = patch.fits
\ No newline at end of file
......@@ -193,13 +193,13 @@ void _make_grid_zone(double *tabmap, int npix , int nside_in){
MapExt<double> Out(arrmap, RING);
if (nside_in==0)
Out.fill(0);
Out.fill(1);
else
{
Healpix_Map<double> Mask ;
Mask.SetNside(nside_in, RING);
for (int pix=0; pix<Mask.Npix(); pix++)
Mask[pix] = pix;
Mask[pix] = pix+1;
Out.Import_upgrade(Mask);
}
arrmap = Out.Map();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment