Fastcc: fast colour corrections for broadband radio telescope data

Broadband receiver data need colour corrections applying to correct for the different source spectra across their wide bandwidths. The full integration over a receiver bandpass may be computationally expensive and redundant when repeated many times. Colour corrections can be applied, however, using a simple quadratic fit based on the full integration instead. Here we describe fastcc and interpcc, quick Python and IDL codes that return, respectively, colour correction coefficients for different power-law spectral indices and modified black bodies for various Cosmic Microwave Background related experiments. The codes are publicly available, and can be easily extended to support additional telescopes.


BACKGROUND
Cosmic Microwave Background (CMB) observations require telescopes using high sensitivity receivers with wide bandwidths that are a large fraction of the observing frequency. For example, the 28.4 GHz channel of the Planck satellite was sensitive to photons at frequencies between ∼ 24−34 GHz (see Fig. 1), a fractional bandwidth (i.e., ∆ν/ν) of ∼35 %. With such high fractional bandwidths, the measured flux density of an astronomical source depends on the convolution of the observing spectral bandpass with the source spectrum. For example, a bandpass that is most sensitive at low frequencies will result in an increase in the measured flux density of a steep spectrum radio source compared to a flatter spectrum source. Colour corrections avoid these effects by correcting the flux density to that which a monochromatic receiver operating at a reference frequency ν 0 would have measured.
The colour correction thus depends on the spectral index of the source, and if the value for this changes (e.g., while fitting a model with multiple spectral components, or when adding new observations), then the colour correction also changes. For this reason, raw flux densities are published without colour corrections, but colour corrections are applied for any scientific analysis and for the inclusion of data in data visualization and subsequent analysis.
The fastcc and interpcc codes provide fast colour corrections for CMB datasets, particularly in MCMC fitting techniques.

FORMALISM
We follow and expand on the formalism from Planck Collaboration (2016). When the source spectrum is described by a power-law, S ∝ ν α , the colour correction is the ratio of integrals over frequency ν, with the numerator integrating over the bandpass g(ν) (if measured in temperature units) and the spectrum the data is calibrated to, δ, and the denominator integrating over the combination of the bandpass and the source spectrum with spectral index α, as where ν 0 is the reference frequency. If the instrument bandpass has been measured in intensity units, τ (ν), this becomes: For instruments calibrated in CMB thermodynamic units, this becomes: where η ∆T (ν) = x 2 e x /(e x −1) 2 , with x = hν/(k B T CMB ) to adjust for the CMB spectrum in Rayleigh-Jeans temperature units, with Planck constant h, Boltzmann constant k B , and CMB temperature T CMB = 2.7255 K. However, the ratio of η ∆T is usually small, only becoming important when ν 0 is far from the centre of the bandpass. The resulting colour corrections are very smooth (see Fig. 1, right), and can be fitted with a quadratic function: The source flux density is then corrected as: The colour corrections for thermal dust spectra can be calculated using the same equations as for power laws, but changing the source spectrum for a grey body, with the dust temperature T dust and spectral index β dust as input parameters. For equations, see the fastcc explanatory supplement. A quadratic fit becomes increasingly different from the colour corrections at extreme values. As such, we also include interpcc, which uses interpolation over a set of cached colour correction values.
There are two equivalent approaches to colour correction: either change the flux density of the source at a fixed reference frequency, or change the reference frequency for the observations. When characterising multiple sources within a survey, the analysis is normally simpler if all sources are at the same frequency with corrected flux density. Alternatively, effective frequencies ν eff , for which C(ν eff , α) = 1, can be calculated from the colour corrections (in thermodynamic units: convert to intensity at ν eff ) via: The code takes input α for fastcc, or T dust , and β dust for interpcc, and returns the factor that the measured flux density must be multiplied to obtain the corrected flux density. We include both Python and IDL versions of fastcc, and interpcc in Python. Test/example scripts are also included for both fastcc and interpcc. The code is available at https://github.com/mpeel/fastcc and https://doi.org/10.5281/zenodo.7376510, along with a more detailed explanatory supplement. An IDL version for Planck LFI only was released in the Planck Legacy Archive. 1 While no dependencies are required for fastcc, interpcc and the colour correction calculations use Astropy (Astropy Collaboration et al. 2018), Numpy (Harris et al. 2020), and scipy (Virtanen et al. 2020).