fits2cl

This IDL facility provides a means to read from a FITS file an ascii or binary table extension containing power spectrum ($C(\ell)$) or spherical harmonics ($a_{\ell m}$) coefficients, and returns the corresponding power spectrum ( $C(\ell) = \sum_m a_{\ell m}a^*_{\ell m} / (2\ell+1)$). Reads primary and extension headers if required. The facility is intended to enable the user to read the output from the HEALPix facility anafast.

Location in HEALPix directory tree: src/idl/fits/fits2cl.pro 


FORMAT

IDL> fits2cl, cl_array, [fitsfile, EXTENSION= , HDR= , /HELP, /INTERACTIVE, LLFACTOR=, MULTIPOLES=, /PLANCK1=, /PLANCK2=, /PLANCK3=, /RSHOW, /SHOW, /SILENT=, /WMAP1=, /WMAP5=, /WMAP7=, XHDR=]


QUALIFIERS

cl_array
real array of $C_\ell$ coefficients read or computed from the file. The output dimension depends on the contents of the file. This has dimension either (lmax+1,9) given in the sequence T E B TxE TxB ExB ExT BxT BxE or (lmax+1,6) given in the sequence T E B TxE TxB ExB or (lmax+1,4) for T E B TxE or (lmax+1) for T alone.
The convention for the power spectrum is that it is not normalised by the Harrison-Zeldovich (flat) spectrum.
fitsfile
String containing the name of the FITS file to be read. The file contains either $C(\ell)$ power spectra or $a_{\ell m}$ coefficients. In either cases, $C(\ell)$ is returned. If fitsfile is not set, then /PLANCK1, /PLANCK2, /PLANCK3, /WMAP1, /WMAP5 or /WMAP7 must be set.


KEYWORDS

EXTENSION=
extension unit to be read from FITS file: either its 0-based ID number (ie, 0 for first extension after primary array) or the case-insensitive value of its EXTNAME keyword.
HDR =
String array containing on output the primary header read from the FITS file.
/HELP
If set, produces an extended help message (using the doc_library IDL command).
/INTERACTIVE
If set, the plots generated by /SHOW and /RSHOW options are produced using iPlot routine, allowing for interactive cropping, zooming and annotation of the plots. This requires IDL 6.4 or newer to work properly.
LLFACTOR =
vector containing on output the factor $\ell(\ell+1)/2\pi$ which is often applied to $C(\ell)$ to flatten it for plotting purposes
MULTIPOLES =
vector containing on output the multipoles $\ell$ for which the power spectra are provided. They are either
- read from the file (1st column in the Planck format),
- or generated by the routine (assuming that all multipoles from 0 to lmax included are provided).
/PLANCK1
If set, and fitsfile is not provided, then a Planck 2013+external data best fit model (!healpix.path.test+'planck2013ext_lcdm_cl_v1.fits' which matches !healpix.path.test+'cl_planck1.fits') defined up to lmax=4500, is read.
See !healpix.path.test+'README' for details
/PLANCK2
If set, and fitsfile is not provided, then a Planck 2015 data best fit model (!healpix.path.test+'planck2015_lcdm_cl_v2.fits' which matches !healpix.path.test+'cl_planck2.fits') defined up to lmax=4900, is read.
See !healpix.path.test+'README' for details
/PLANCK3
If set, and fitsfile is not provided, then a Planck 2018 data best fit model (!healpix.path.test+'planck2018_lcdm_cl_v3.fits' which matches !healpix.path.test+'cl_planck3.fits') defined up to lmax=5000, is read.
See !healpix.path.test+'README' for details

/RSHOW
If set, the raw power spectra $C(\ell)$ read from the file are plotted
/SHOW
If set, the rescaled power spectra $\ell(\ell+1)C(\ell)/2\pi$ are plotted
/SILENT
If set, no message is issued during normal execution
/WMAP1
If set, and fitsfile is not provided, then one WMAP-1yr best fit model (!healpix.path.test+'wmap_lcdm_pl_model_yr1_v1.fits' which currently matches !healpix.path.test+'cl.fits') defined up to lmax=3000, is read.
See !healpix.path.test+'README' for details
/WMAP5
If set, and fitsfile is not provided, then one WMAP-5yr best fit model (!healpix.path.test+'wmap_lcdm_sz_lens_wmap5_cl_v3.fits' which matches !healpix.path.test+'cl_wmap5.fits') defined up to lmax=2000, is read.
See !healpix.path.test+'README' for details
/WMAP7
If set, and fitsfile is not provided, then one WMAP-7yr best fit model (!healpix.path.test+'wmap_lcdm_sz_lens_wmap7_cl_v4.fits' which matches !healpix.path.test+'cl_wmap7.fits') defined up to lmax=3726, is read.
Note: As opposed to the other WMAP spectra mentionned above, it includes a non-vanishing B (or CURL) power spectrum induced by lensing of E (or GRAD) polarization.
See !healpix.path.test+'README' for details
XHDR =
String array containing on output the extension header read from the FITS file.


DESCRIPTION

fits2cl reads the power spectrum coefficients from a FITS file containing an ascii table extension. Descriptive headers conforming to the FITS convention can also be read from the input file.


RELATED ROUTINES

This section lists the routines related to fits2cl

idl
version 6.4 or more is necessary to run fits2cl.
bin_llcl
facility to bin a spectrum read with fits2cl.
bl2fits
facility to write a window function into a FITS file.
cl2fits
provides the complimentary routine to write a power spectrum to a FITS file.
fits2alm, alm2fits
routines to read and write $a_{\ell m}$ coefficients
ianafast
IDL routine computing $C(\ell)$ files that can be read by fits2cl.
anafast
F90 facility computing $C(\ell)$ files that can be read by fits2cl.


EXAMPLE:

fits2cl, pwrsp, '$HEALPIX/test/cl.fits', $
HDR=hdr, XHDR=xhdr, MULTI=l, LLFACT=fll
plot, l, powrsp[*,0]*fll
fits2cl reads a power spectrum $C(\ell)$ from the input FITS file $HEALPIX/test/cl.fits into the variable pwrsp, with optional headers passed by the string variables hdr and xhdr. The multipoles $\ell$ and factors $\ell(\ell+1)/2\pi$ are read into l and fll respectively. $\ell(\ell+1)C(\ell)/2\pi$ vs $\ell$ is then plotted.

Version 3.83, 2024-11-13