Skip to content

Instantly share code, notes, and snippets.

@zonca
Created October 2, 2012 18:24
Show Gist options
  • Select an option

  • Save zonca/3822039 to your computer and use it in GitHub Desktop.

Select an option

Save zonca/3822039 to your computer and use it in GitHub Desktop.
angular power spectrum white noise
nside = 128
import healpy as hp
import numpy as np
tmap = np.random.normal(scale=1, size=12*nside**2)
qmap = np.random.normal(scale=1.2, size=12*nside**2)
umap = np.random.normal(scale=.8, size=12*nside**2)
cltt, clee, clbb, clte, cleb, cltb = hp.anafast( [tmap, qmap, umap], lmax=2*nside )
exp = 4.*np.pi/12./nside**2
print "expect = ", exp
print " cltt av = ", cltt[2:].mean()
print " cltt rat = ", cltt[2:].mean() / exp * 100
var = (1.2**2 + .8**2) /2
print "expect = ", exp * var
print " clee av = ", clee[2:].mean()
print " clee rat = ", clee[2:].mean() / exp / var * 100
@zonca

zonca commented Oct 2, 2012

Copy link
Copy Markdown
Author
run noise
expect =  6.39158661619e-05
   cltt av =  6.44932359861e-05
   cltt rat =  100.903327857
expect =  6.64725008084e-05
   clee av =  6.67002934228e-05
   clee rat =  100.342686993

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment