# Bandpass Convention - What does flat mean

Nov 6 2017, Clem Pryke - Followup below Nov 20 2017

For CMB-S4 sims we have a table of bandpasses in CMB-S4 frequency bands v1.99 which specifies the lower/upper edges of assumed tophat bandpasses. In Tophat bands for Data Challenge (Nov 2 2016) Colin specified how to define "flat" tophat - he states "I define this tophat to be such that a single-moded antenna (AΩ scales as λ2) would have uniform response as a function of frequency to a beam-filling Rayleigh-Jeans source."

The Planck bandpass files are specified in units of (relative) spectral radiance (SR) although the WMAP ones are specified in RJ units.

PySM works in spectral radiance units (Jy/Sr) and it makes a lot of sense to do all astrophysics type modelling in these units.

When working in SR units the correct shape for a "flat" bandpass is not flat - it is nu^-2 because real detectors absorb more photons to lower frequencies. Sky models 00 and 05 did this in the creation step. However, apparently in the re-analysis presented in Maximum likelihood search results for Data Challenge 02 flat in SR was assumed and this may be all or part of the cause of the biases found in the results. (Raphael's re-analysis does not need to know the bandpasses.)

As part of the PySM documentation Ben Thorne offers this document - I am not fully able to tell but I think flat for him means flat in SR units? Can we please get confirmation what was assumed when generating the PySM files on NERSC?

Flavien Vansyngel said: "The monochromatic templates of both the dust and the synchrotron are produced in MJy/sr. They are integrated through bandpasses that are flat in MJy/sr (using their respective SED in those units). After integration, the maps are converted in K_CMB by dividing them by the following factor

where \nu_c is the central frequency of the band, f is the fractional bandpass and (K_CMB -> MJy/sr)(\nu) is the monochromatic conversation factor from K_CMB to MJy/sr."

Bottom line: The conclusions that I would like to get agreement on are:

1) When working with models in spectral radiance units (Jy/Sr) the most sensible thing to use for a "flat bandpass" is actually nu^-2 - because that is what an ideal physical detector would do.

2) Assuming one has taken the product of the source response and the bandpass as above the SR to T_CMB conversion factor then also needs to be a weighted mean over the bandpass.

Here is Colin's freq_scaling.m Matlab code which I believe does the right thing when fed a nu^-2 bandpass [1]

Below is a plot attempting to illustrate the situation. The top panel is the output of freq_scaling for vanilla sync and dust models. It shows the brightness in CMB calibrated maps relative to the brightness at 150GHz assuming delta function bandpasses. By "CMB calibrated" I mean maps which have been scaled by cross correlation with the known CMB pattern whose amplitude is frequency invariant. The middle panel shows the two sets of bandpasses input to frequency_scaling - either flat or nu^-2 in shape. The bottom panel compares the results for these relative to the delta function case for the sync and dust spectra. The bottom panel initially puzzled me but I think it makes sense. For any power law integrating across a flat bandpass always results in a higher number than the value at the center - the gain at the end of the bandpass where the signal is higher always more than offsets the loss at the end of the bandpass where the signal is lower. Only in the case of dust and the nu^-2 bandpass is this effect overcome in the higher freq bands - the dust brightness is rising fast enough across the band that the signal weighted with the falling bandpass is actually lower than the value at the band center.

Here is the (Matlab) code used to make the above plot:

% get the CMB-S4 bandpass center/width numbers

% for each band construct the bandpasses
for i=1:size(p,1)
% bp1 is delta function at center freq
bp1{i}=[p(i,1),1];
% bp is vector of frequencies from lower to upper edge
bp=linspace(p(i,1)-p(i,2)/2,p(i,1)+p(i,2)/2,100)';
bp=[bp(1,1);bp;bp(end,1)]; % cosmetic for plotting
% bp2 is tophat bandpass
bp2{i}=[bp,ones(size(bp))]; bp2{i}([1,end],2)=0;
% bp3 is nu^-2 bandpass
bp3{i}=[bp,(bp.^-2)./(p(i,1)^-2)]; bp3{i}([1,end],2)=0;
end

% get the dust brightness as seen through each set of bandpasses
d1=freq_scaling(bp1,1.6,19.6,150);
d2=freq_scaling(bp2,1.6,19.6,150);
d3=freq_scaling(bp3,1.6,19.6,150);

% get the sync brightness as seen through each set of bandpasses
s1=freq_scaling(bp1,-3.1,[],150);
s2=freq_scaling(bp2,-3.1,[],150);
s3=freq_scaling(bp3,-3.1,[],150);

% make the plot
clf;
subplot(3,1,1)
semilogy(p(:,1),s1,'r.-')
hold on
semilogy(p(:,1),d1,'b.-')
legend({'sync \nu^{-3.1}','dust \nu^{1.6},T=19.6K'});
ylabel('brightness in CMB cal. map rel. to 150 GHz');

subplot(3,1,2)
hold on
for i=1:size(p,1)
plot(bp1{i}(:,1),bp1{i}(:,2),'kx')
plot(bp2{i}(:,1),bp2{i}(:,2),'m');
plot(bp3{i}(:,1),bp3{i}(:,2),'c');
end
box on
ylabel('bandpasses')
legend({'delta','flat','\nu^{-2}'});

subplot(3,1,3)
plot(p(:,1),s2./s1,'r.-')
hold on
plot(p(:,1),d2./d1,'b.-')
plot(p(:,1),s3./s1,'r.--')
plot(p(:,1),d3./d1,'b.--')
hold off
grid
xlabel('freq (GHz)'); ylabel('Brightness rel. to delta bandpass in CMB cal. map');
legend({'sync flat','dust flat','sync \nu^{-2}','dust \nu^{-2}'});



### Followup notes added Nov 20 2017

Through an email exchange we appear to have reached agreement between Flavien Vansyngel, Ben Thorne and Colin Bischoff on points 1&2 above. Colin provided numbers from the freq_scaling code above and Ben was able to reproduce them when using a nu^-2 bandpass. So the conclusion is:

1) Everything is fine for the PySM models (01-03) generated so far except that they used bandpasses flat in SR units rather than falling as nu^-2. This needs to be known and taken into account when re-analyzing them, but so long as it is there will be no problem.

2) Flavien's newly provided model (09) uses nu^-2 bandpass.

3) The models made by Clem (00 and 05) did used nu^-2 bandpasses.

4) We recommend that all future models use nu^-2 bandpasses on the basis that this is the response of "an ideal detector".