Last active
June 24, 2019 13:26
-
-
Save zonca/56ff738c3d163ee17e3378c34e17a0c3 to your computer and use it in GitHub Desktop.
Script to generate the expected outputs for TOAST unit tests, requires PySM 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pysm | |
import numpy as np | |
for smoothing in [False, True]: | |
nside = 64 if smoothing else 8 | |
config = {} | |
config["synchrotron"] = pysm.nominal.s1(nside=nside) | |
config["freefree"] = pysm.nominal.f1(nside=nside) | |
config["ame"] = pysm.nominal.a1(nside=nside) | |
bandpasses = { | |
"1a": (np.linspace(20, 25, 10), np.ones(10)), | |
"1b": (np.linspace(21, 26, 10), np.ones(10)), | |
"2a": (np.linspace(18, 23, 10), np.ones(10)), | |
"2b": (np.linspace(19, 24, 10), np.ones(10)), | |
} | |
sky = pysm.Sky(config) | |
pysm_instrument_config = { | |
"beams": np.ones(4)*600., | |
"nside": nside, | |
"use_bandpass": True, | |
"channels": list(bandpasses.values()), | |
"channel_names": list(bandpasses.keys()), | |
"add_noise": False, | |
"output_units": "uK_RJ", | |
"use_smoothing": smoothing, | |
"pixel_indices": None, | |
} | |
inst = pysm.Instrument(pysm_instrument_config) | |
m, m_noise = inst.observe(sky, write_outputs=False) | |
print(m[0, :, :3]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current output is: