cl2fits


This IDL facility provides a means to write into a FITS file as an ascii table extension the power spectrum coefficients passed to the routine . Adds additional headers if required. The facility is primarily intended to allow the user to write a theoretical power spectrum into a FITS file in the correct format to be ingested by the HEALPix simulation facility synfast.


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


FORMAT

IDL> CL2FITS, cl_array, fitsfile, [HDR = , XHDR = , CMBFAST = ]


QUALIFIERS


cl_array
real array of Cl coefficients to be written to file. This has dimension either (lmax+1,4) given in the sequence 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 file to be written.


KEYWORDS


HDR =
String array containing the (non-trivial) primary header for the FITS file.
XHDR =
String array containing the (non-trivial) extension header for the FITS file.
CMBFAST =
if set, the routine will add the keyword 'POLNORM = CMBFAST' in the FITS header, meaning that the polarization power spectra have the same convention as CMBFAST (and Healpix 1.2). If this keyword is not present in the input FITS file, synfast will issue a warning when simulating a polarization map from that power spectrum, but no attempt to renormalize the power spectra will be made. To actually perform the renormalization, see convert_oldhpx2cmbfast
NOTE: optional header strings should NOT include the header keywords explicitly written by this routine.


DESCRIPTION


cl2fits writes the input power spectrum coefficients into a FITS file containing an ascii table extension. Optional headers conforming to the FITS convention can also be written to the output file. All required FITS header keywords (like SIMPLE, BITPIX, ...) are automatically generated by the routine and should NOT be duplicated in the optional header inputs (they would be ignored anyway). The four columns are automatically named TEMPERATURE, GRAD, CURL and T-G respectively. The current implementation is much faster than the one available in Healpix 1.10 thanks to replacing an internal loop by vector operations.


RELATED ROUTINES

This section lists the routines related to cl2fits


idl
version 5.0 or more is necessary to run cl2fits.
fits2cl
provides the complimentary routine to read in a power spectrum from a FITS file.
convert_oldhpx2cmbfast
convert an existing power spectrum FITS file from the polarization convention used in Healpix 1.1 to the one used in Healpix 1.2 (and CMBFAST).
synfast
utilises the output file generated by cl2fits.


EXAMPLE:

cl2fits, pwrsp, `spectrum.fits', HDR = hdr, XHDR = xhdr

cl2fits writes the power spectrum stored in the variable pwrsp to the output FITS file spectrum.fits with optional headers passed by the string variables hdr and xhdr.

Eric Hivon 2003-02-07