fits2cl*

This routine reads a power spectrum or beam window function from a FITS ASCII or binary table. The routine can read temperature coefficients $C_\ell^{TT}$ or both temperature and polarisation coefficients $C_\ell^{TT}$, $C_\ell^{EE}$, $C_\ell^{BB}$, $C_\ell^{TE}$ (and $C_\ell^{TB}$, $C_\ell^{EB}$, $C_\ell^{ET}$, $C_\ell^{BT}$, $C_\ell^{BE}$ when applicable). If the keyword PDMTYPE is found in the header, fits2cl assumes the table to be in the special format used by Planck and will ignore the first data column. If the input FITS file contains several extensions or HDUs, the one to be read can be specified thanks to the CFITSIO Extended File Name Syntax, using its number (eg, file.fits[2] or file.fits+2) or its EXTNAME value (eg. file.fits[beam_100x100]). By default, only the first valid extension will be read.

Location in HEALPix directory tree: src/f90/mod/fitstools.F90 


FORMAT

call fits2cl*( filename, clin, lmax, ncl, header, [units] )


ARGUMENTS

name & dimensionality kind in/out description
       
filename(LEN=filenamelen) CHR IN the FITS file containing the power spectrum.
lmax I4B IN Maximum $\ell$ value to be read.
ncl I4B IN 1 for temperature coeffecients only, 4 for polarisation.
clin(0:lmax,1:ncl) SP/ DP OUT the power spectrum read from the file.
header(LEN=80) (1:) CHR OUT the header read from the FITS-file.
units(LEN=80) (1:) CHR OUT the column units read from the FITS-file.


EXAMPLE:

use healpix_modules
real(SP), allocatable, dimension(:,:) :: cl
character(len=80), dimension(1:300) :: header
character(len=80), dimension(1:100) :: units
integer(I4B) :: lmax, ncl, np
character(len=filenamelen) :: fitsfile='cl.fits'
np = getsize_fits(fitsfile, nmaps=ncl, mlpol=lmax)
allocate(cl(0:lmax, 1:ncl))
call fits2cl(fitsfile, cl, lmax, ncl, header, units)
Reads a power spectrum from the FITS file `cl.fits' and stores the result in cl(0:lmax,1:ncl) which are the ncl $C_\ell$ coefficients up to $\ell=$lmax. The FITS header is returned in header, the column units in units.

MODULES & ROUTINES

This section lists the modules and routines used by fits2cl*.

fitstools
module, containing:
printerror
routine for printing FITS error messages.
cfitsio
library for FITS file handling.


RELATED ROUTINES

This section lists the routines related to fits2cl*

create_alm
Routine to create $a_{\ell m}$ values from an input power spectrum.
write_asctab
Routine to create an ascii FITS file containing a power spectrum.
getsize_fits
Routine to parse FITS file header, and determine the data storage features.
getnumext_fits
Routine to determine number of extensions of a FITS file.

Version 3.82, 2022-07-28