import healpy as hp
import numpy as np
import matplotlib.pyplot as plt
from pysm3 import units as u
import pysm3 as pysm
%matplotlib inline
4) np.random.seed(
= 128 nside
= hp.synfast([0,1], lmax=1, nside=nside) * u.V dip
/home/zonca/zonca/p/software/healpy/healpy/sphtfunc.py:438: FutureChangeWarning: The order of the input cl's will change in a future release.
Use new=True keyword to start using the new order.
See documentation of healpy.synalm.
category=FutureChangeWarning,
/home/zonca/zonca/p/software/healpy/healpy/sphtfunc.py:824: UserWarning: Sigma is 0.000000 arcmin (0.000000 rad)
sigma * 60 * 180 / np.pi, sigma
/home/zonca/zonca/p/software/healpy/healpy/sphtfunc.py:829: UserWarning: -> fwhm is 0.000000 arcmin
sigma * 60 * 180 / np.pi * (2.0 * np.sqrt(2.0 * np.log(2.0)))
=dip.unit) hp.mollview(dip, unit
We measure the sky with out broadband instrument, we assume we only measure the CMB solar dipole, initially the units are arbitrary, for example Volts of our instrument.
Next we calibrate on the solar dipole, which is known to be 3.3 mK.
= 2 * 3.3 * u.mK_CMB / (dip.max() - dip.min()) calibration_factor
calibration_factor
\(3.486509 \; \mathrm{\frac{mK_{{CMB}}}{V}}\)
= hp.pix2ang(nside, np.arange(hp.nside2npix(nside))) theta, phi
= 2 * u.V
dust_amplitude_V = 20 * u.deg dust_latitude
= dust_amplitude_V * np.logical_and(theta > (90 * u.deg - dust_latitude).to_value(u.rad), theta < (90 * u.deg + dust_latitude).to_value(u.rad)) dust
+ dust, unit=dip.unit, title="CMB dipole + dust") hp.mollview(dip
= calibration_factor * dip calibrated_dip
For a delta frequency it is straightforward to compute the temperature of the dust in any unit:
= dust_amplitude_V * calibration_factor calibrated_dust_amplitude
calibrated_dust_amplitude
\(6.9730181 \; \mathrm{mK_{{CMB}}}\)
First we simplify and consider a delta-frequency instrument at 300 GHz
= 300 * u.GHz center_frequency
=u.cmb_equivalencies(center_frequency)) calibrated_dust_amplitude.to(u.mK_RJ, equivalencies
\(0.99846974 \; \mathrm{mK_{{RJ}}}\)
/u.sr, equivalencies=u.cmb_equivalencies(center_frequency)) calibrated_dust_amplitude.to(u.MJy
\(2.7608912 \; \mathrm{\frac{MJy}{sr}}\)
Broadband instrument
Next we assume instead that we have a broadband instrument, of 20% bandwidth, with uniform response in power (Spectral radiance) in that range. For simplicity, we only take 4 points.
= [270, 290, 310, 330] * u.GHz freq
= [1, 1, 1, 1] weights
/= np.trapz(weights, freq) weights
weights
\([0.016666667,~0.016666667,~0.016666667,~0.016666667] \; \mathrm{\frac{1}{GHz}}\)
The instrument bandpass is defined in power so we can transform our signal in MJy/sr at the 4 reference frequencies, then integrate.
Dust model
Let’s assume for the dust a power-law model with a spectral index of 2 (more realistic models use a modified black body), i.e.:
$I_{dust}()= A_{dust}(_0)( )^2 $
in the case of a delta-bandpass, $A_{dust}(_0)$ would coincide with the measured value:
= calibrated_dust_amplitude.to(u.MJy/u.sr, equivalencies=u.cmb_equivalencies(center_frequency)) A_dust_delta_bandpass
A_dust_delta_bandpass
\(2.7608912 \; \mathrm{\frac{MJy}{sr}}\)
${dust}()= A{dust}(_0)g() ( )^2 d$
${dust}()= A{dust}(_0)g() ( )^2 d$
\(\tilde{I}_{dust}(\nu)[K_{CMB}] = \dfrac{ A_{dust}(\nu_0)\left[\frac{MJy}{sr}\right] \int g(\nu) \left( \dfrac{\nu}{\nu_0} \right)^2 d\nu} { \int C_{K_{CMB}}^{Jy~sr^{-1}}(\nu) g(\nu) d\nu}\)
= A_dust_delta_bandpass * np.trapz(weights * (freq**2/center_frequency**2), freq) I_dust_bandpass
= u.MJy/u.sr SR
= ((1*SR).to(u.mK_CMB, equivalencies=u.cmb_equivalencies(freq)))/(1*SR) SR_to_K_CMB
SR_to_K_CMB
\([2.253665,~2.420677,~2.646055,~2.9379134] \; \mathrm{\frac{mK_{{CMB}}\,sr}{MJy}}\)
\(\int C_{K_{CMB}}^{Jy~sr^{-1}}(\nu) g(\nu) d\nu\)
= np.trapz(1/SR_to_K_CMB * weights, freq) SR_to_K_CMB_bandpassintegrated
= calibrated_dust_amplitude * SR_to_K_CMB_bandpassintegrated / np.trapz(weights * (freq**2/center_frequency**2), freq) A_dust_bandpass
A_dust_bandpass
\(2.7387177 \; \mathrm{\frac{MJy}{sr}}\)
/ A_dust_delta_bandpass).to(u.pct) (A_dust_bandpass
\(99.196874 \; \mathrm{\%}\)
Crosscheck starting from the dust model
integrate the model over the bandpass in SR
* np.trapz(weights * (freq**2/center_frequency**2), freq) A_dust_bandpass
\(2.7498755 \; \mathrm{\frac{MJy}{sr}}\)
Convert to \(K_{CMB}\), the conversion factor is tailored to the CMB, if we had a different calibration source, we would have different conversion factors:
/ SR_to_K_CMB_bandpassintegrated _
\(6.9730181 \; \mathrm{mK_{{CMB}}}\)