Bandpass Convention - What does flat mean
Nov 6 2017, Clem Pryke
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 
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 integrated over the falling bandpass is actually lower than the value at the band center.