Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement consistency unit test for Websky #139

Open
zonca opened this issue Nov 21, 2022 · 0 comments
Open

Implement consistency unit test for Websky #139

zonca opened this issue Nov 21, 2022 · 0 comments
Assignees

Comments

@zonca
Copy link
Member

zonca commented Nov 21, 2022

I'd like to propose a sanity regression test for this. The middle CMB band is usually chosen to balance the power of the radio and CIB foreground components. Thus, it should have a similar power spectrum for the two components, and indeed this plot is how I found this bug. I think a very sensible unit test would be to simply compute the power spectra as below and then check that they are within i.e. two orders of magnitude.

import numpy as np
import matplotlib.pyplot as plt
import healpy as hp
from pysm3 import WebSkyCIB, WebSkyRadioGalaxies
import pysm3.units as u

model_cib = WebSkyCIB(nside=512)
m_cib = model_cib.get_emission(143*u.GHz)
cl_cib = hp.alm2cl(hp.map2alm(m_cib.value[0,:]))

model_radio = WebSkyRadioGalaxies(nside=512)
m_radio = model_radio.get_emission(143*u.GHz)
cl_radio = hp.alm2cl(hp.map2alm(m_radio.value[0,:]))

plt.plot(cl_cib, label="CIB")
plt.plot(cl_radio, label="Radio")
plt.legend()
plt.xscale("log"); plt.yscale("log")
plt.ylabel(r"$C_{\ell}$ [$\mu$K$^2]$ at 143 GHz")

image

Also here's the shot noise power for reference from Planck.
image

Originally posted by @xzackli in #138 (comment)

@zonca zonca self-assigned this Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant