Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xQML
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yunyang Li
xQML
Commits
fb1cc39c
Commit
fb1cc39c
authored
6 years ago
by
Matthieu Tristram
Browse files
Options
Downloads
Patches
Plain Diff
Update TestEsti.py
parent
e733935f
Branches
doctest
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
TestEsti.py
+3
-43
3 additions, 43 deletions
TestEsti.py
with
3 additions
and
43 deletions
TestEsti.py
+
3
−
43
View file @
fb1cc39c
...
...
@@ -57,11 +57,14 @@ Pl = Pl.reshape((nder)*(np.shape(Pl)[1]), 2*npix, 2*npix)
###################################### Compute spectra ######################################
esti
=
xqml
.
xQML
(
mask
,
ellbins
,
clth
,
Pl
=
Pl
,
fwhm
=
fwhm
)
esti
.
construct_esti
(
NoiseVar
,
NoiseVar
)
cl
=
esti
.
get_spectra
(
dm
,
dm
)
V
=
esti
.
get_covariance
()
###################################### Construct MC ######################################
allcl
=
[]
esti
=
xqml
.
xQML
(
mask
,
ellbins
,
clth
,
Pl
=
Pl
,
fwhm
=
fwhm
)
esti
.
construct_esti
(
NoiseVar
,
NoiseVar
)
...
...
@@ -73,49 +76,6 @@ for n in np.arange(100):
allcl
.
append
(
esti
.
get_spectra
(
dm
,
dm
))
###################################### Construct El, Wb ######################################
C
=
S
+
NoiseVar
invC
=
inv
(
C
)
#invS = inv(S)
El
=
xqml
.
El
(
invC
,
invC
,
Pl
)
Wb
=
xqml
.
CrossWindowFunction
(
El
,
Pl
)
invW
=
inv
(
Wb
)
###################################### Compute spectra ######################################
yl
=
xqml
.
yQuadEstimator
(
dm
.
ravel
(),
dm
.
ravel
(),
El
)
cl
=
xqml
.
ClQuadEstimator
(
invW
,
yl
).
reshape
(
nder
,
-
1
)
plot
(
clth
.
transpose
()[:
lmax
+
1
,:])
plot
(
ellval
,
cl
.
transpose
())
G
=
xqml
.
CrossGisherMatrix
(
El
,
S
)
V
=
xqml
.
CovAB
(
invW
,
G
)
###################################### Construct MC ######################################
allcl
=
[]
start
=
timeit
.
default_timer
()
for
n
in
np
.
arange
(
100
):
xqml
.
progress_bar
(
n
,
100
,
timeit
.
default_timer
()
-
start
)
cmb
=
hp
.
synfast
(
clth
,
nside
,
fwhm
=
deg2rad
(
fwhm
),
pixwin
=
True
,
new
=
True
,
verbose
=
False
)
dm
=
cmb
[
1
:,
mask
]
+
(
randn
(
2
*
npix
)
*
sqrt
(
varmap
)).
reshape
(
2
,
npix
)
yl
=
xqml
.
yQuadEstimator
(
dm
.
ravel
(),
dm
.
ravel
(),
El
)
allcl
.
append
(
xqml
.
ClQuadEstimator
(
invW
,
yl
).
reshape
(
nder
,
-
1
))
fits
.
writeto
(
"
allcl_Slmax%d.fits
"
%
Slmax
,
array
(
allcl
),
overwrite
=
True
)
figure
()
subplot
(
2
,
1
,
1
)
plot
(
lth
,
clth
.
transpose
()[
lth
,
1
:
3
],
'
k
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment