-
Notifications
You must be signed in to change notification settings - Fork 0
/
visualize_covmat.csh
executable file
·62 lines (49 loc) · 1.69 KB
/
visualize_covmat.csh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /bin/csh -f
# This shell script processes a fits format covariance matrix
# and produces gif plots of the correlation of pixel # 0
# (NESTED scheme)
#
# The script requires
# - plot_pixel_covariance
# - map2gif
#
# March 5th 2008 Reijo Keskitalo
if ($#argv < 3) then
echo "usage: $0 <covmat_file> <nside> <nstokes> [<pixel>]"
else
set covmat = $1
set nside = $2
set nstokes = $3
if ($#argv == 4) then
set pixel = $4
else
set pixel = 0
endif
echo " Reading from $covmat"
echo ""
echo " Using Nside = $nside"
echo " nstokes = $nstokes"
echo " #pixel = $pixel"
# Get the fits maps corresponding to the specified column (pixel).
# Store the corresponding pixel numbers in 'rows' array
set rows = `plot_pixel_covariance $covmat $nside $nstokes $pixel | \
awk '/row #/ {print $4}'`
set file_root = ` echo $covmat | sed 's/.fits//g' `
# Clean the filenames of obsolete suffixes (.dat, .fits)
foreach srow ( $rows )
mv -f ${file_root}.fits_row_$srow.fits ${file_root}_row_$srow.fits
end
# plot the maps in gif files
map2gif -inp ${file_root}_row_$rows[1].fits \
-out \!${file_root}_row_$rows[1].II.gif -bar .true.
map2gif -inp ${file_root}_row_$rows[1].fits \
-out \!${file_root}_row_$rows[1].IQ.gif -sig 2 -bar .true.
map2gif -inp ${file_root}_row_$rows[1].fits \
-out \!${file_root}_row_$rows[1].IU.gif -sig 3 -bar .true.
map2gif -inp ${file_root}_row_$rows[2].fits \
-out \!${file_root}_row_$rows[2].QQ.gif -sig 2 -bar .true.
map2gif -inp ${file_root}_row_$rows[2].fits \
-out \!${file_root}_row_$rows[2].QU.gif -sig 3 -bar .true.
map2gif -inp ${file_root}_row_$rows[3].fits \
-out \!${file_root}_row_$rows[3].UU.gif -sig 3 -bar .true.
endif # master loop