Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
spherelib
Spherelib
Commits
2806250f
Commit
2806250f
authored
Jan 06, 2011
by
Maude Le Jeune
Browse files
last
parent
9a3dc517
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
16 deletions
+23
-16
include/fits_tool.h
include/fits_tool.h
+8
-5
nilc/fullsky.param
nilc/fullsky.param
+1
-1
nilc/grid.param
nilc/grid.param
+1
-1
nilc/needlet.param
nilc/needlet.param
+2
-2
nilc/nilc.cc
nilc/nilc.cc
+8
-4
nilc/patch.param
nilc/patch.param
+1
-1
python/spherelib/spherelib_map.cpp
python/spherelib/spherelib_map.cpp
+2
-2
No files found.
include/fits_tool.h
View file @
2806250f
...
...
@@ -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/%s
XXXXXX
"
,
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
;
}
}
...
...
nilc/fullsky.param
View file @
2806250f
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
nilc/grid.param
View file @
2806250f
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
nilc/needlet.param
View file @
2806250f
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
nilc/nilc.cc
View file @
2806250f
...
...
@@ -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
,
"
\n
ERROR!!! 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
,
"
\n
ERROR!!! 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
{
...
...
nilc/patch.param
View file @
2806250f
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
python/spherelib/spherelib_map.cpp
View file @
2806250f
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment