import healpy as hp
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt
import astropy.units as u
hp.disable_warnings()
In this second notebook, we will handle a case of partial sky coverage.
# Number based on Simons Observatory SAT UHF1 array of detectors
= 10. * u.Unit("uK * sqrt(s)") net
5 years with a efficiency of 20%:
= 5 * u.year * .2 integration_time_total
Download a hitmap
We can download a simulated hitmap for a Simons Observatory band, for now however, we assume a uniform coverage.
= "https://portal.nersc.gov/project/sobs/so_mapsims_data/v0.2/healpix/ST0_UHF1_01_of_20.nominal_telescope_all_time_all_hmap.fits.gz" hitmap_url
!wget $hitmap_url
--2020-12-11 10:32:00-- https://portal.nersc.gov/project/sobs/so_mapsims_data/v0.2/healpix/ST0_UHF1_01_of_20.nominal_telescope_all_time_all_hmap.fits.gz
Resolving portal.nersc.gov (portal.nersc.gov)... 128.55.206.24, 128.55.206.26
Connecting to portal.nersc.gov (portal.nersc.gov)|128.55.206.24|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3212515 (3.1M) [application/x-gzip]
Saving to: ‘ST0_UHF1_01_of_20.nominal_telescope_all_time_all_hmap.fits.gz.8’
ST0_UHF1_01_of_20.n 100%[===================>] 3.06M 3.12MB/s in 1.0s
2020-12-11 10:32:06 (3.12 MB/s) - ‘ST0_UHF1_01_of_20.nominal_telescope_all_time_all_hmap.fits.gz.8’ saved [3212515/3212515]
= hp.read_map("ST0_UHF1_01_of_20.nominal_telescope_all_time_all_hmap.fits.gz") hitmap
= hitmap > 0 hitmap
hp.mollview(hitmap)
Uniform partial sky survey
As a reference, let’s first start with the trivial case of uniform full sky coverage, i.e. we spend the same amount of observation time in each pixel.
= 512
nside = hp.nside2npix(nside)
npix = hitmap.sum() npix_hit
= (net / np.sqrt(integration_time_total/npix_hit)).decompose() standard_deviation_per_pixel
standard_deviation_per_pixel
\(1.9596849 \times 10^{-6} \; \mathrm{K}\)
= np.nan * np.ones(npix, dtype=np.double) * standard_deviation_per_pixel.unit m
= np.random.normal(scale = standard_deviation_per_pixel.value, size=npix_hit) * standard_deviation_per_pixel.unit m[hitmap]
= m.to(u.uK) m
= hp.UNSEEN m.value[np.isnan(m)]
=m.unit, title="White noise map") hp.mollview(m, unit
Power spectrum
= np.mean(hitmap) sky_fraction
= hp.anafast(m) / sky_fraction cl
100:].mean() cl[
1.5205726153293572e-05
m[hitmap].std()
\(1.9595938 \; \mathrm{\mu K}\)
= hp.nside2pixarea(nside) pixel_area
= (standard_deviation_per_pixel**2 * pixel_area).to(u.uK**2) white_noise_cl
white_noise_cl
\(1.5341266 \times 10^{-5} \; \mathrm{\mu K^{2}}\)
= 3.9820426e-5 * u.uK**2 white_noise_cl_full_sky
=(6,4))
plt.figure(figsize="Map power spectrum", alpha=.7)
plt.loglog(cl, label0, len(cl), color="blue",
plt.hlines(white_noise_cl.value, ="White noise level")
label0, len(cl),
plt.hlines(white_noise_cl_full_sky.value, ="White noise level full sky")
label"Fullsky white noise spectrum")
plt.title(
plt.legend()"$\ell$")
plt.xlabel("$C_\ell [\mu K ^ 2]$"); plt.ylabel(
/ white_noise_cl_full_sky white_noise_cl
\(0.38526121 \; \mathrm{}\)
sky_fraction
0.38526121775309247