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
f5adceda
Commit
f5adceda
authored
Jun 16, 2010
by
Maude Le Jeune
Browse files
unbeam cov ok
parent
fde32660
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletion
+37
-1
python/spherelib/__init__.py
python/spherelib/__init__.py
+1
-0
python/spherelib/cov.py
python/spherelib/cov.py
+36
-1
No files found.
python/spherelib/__init__.py
View file @
f5adceda
...
...
@@ -29,3 +29,4 @@ from fitsfunc2 import *
from
bin
import
*
from
alm
import
*
from
utils
import
*
from
cov
import
*
python/spherelib/cov.py
View file @
f5adceda
...
...
@@ -17,7 +17,42 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see http://www.gnu.org/licenses/gpl.html
from
pylab
import
*
import
bin
def
unbeamcov
(
cov
,
beams
,
max_inv
=
10000
):
""" Correct covariance matrices from beam effect
Parameters
----------
cov: 3D array, symetric covariance matrices
beams: vector, beam fwhm in arcmin
max_inv: upper limit for inversion
"""
nin
=
shape
(
cov
)[
0
]
lmax
=
shape
(
cov
)[
2
]
-
1
;
ib
=
zeros
((
nin
,
lmax
+
1
))
for
m
in
range
(
nin
):
ib
[
m
,:]
=
squeeze
(
1
/
bin
.
gaussbeam
(
beams
[
m
],
lmax
))
ib
[
m
,[
ib
[
m
,:]
>
max_inv
]]
=
max_inv
for
ell
in
range
(
lmax
+
1
):
cov
[:,:,
ell
]
=
dot
(
dot
(
diag
(
ib
[:,
ell
]),
cov
[:,:,
ell
]),
diag
(
ib
[:,
ell
]))
def
plotautocov
(
cov
,
figfile
=
None
,
leg
=
None
):
"""
"""
pass
nmap
=
shape
(
cov
)[
0
]
figure
()
for
m
in
range
(
nmap
):
semilogy
(
squeeze
(
cov
[
m
,
m
,:]))
if
leg
is
not
None
:
legend
(
leg
)
if
figfile
is
None
:
show
()
else
:
savefig
(
figfile
)
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