alm2fits

This IDL routine provides a means to write spherical harmonic coefficients (and optional errors) and their index label to a FITS file. Each signal is written to a separate binary table extension. The routine also writes header information if required. The facility is primarily designed to allow the user to write a FITS files containing constraints for a constrained realisation performed by the HEALPix facility synfast.

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


FORMAT

IDL> ALM2FITS, index, alm_array, fitsfile, [HDR=, /HELP, XHDR=]


QUALIFIERS

index
Long array containing the index for the corresponding array of alm coefficients (and erralm if required). The index i is related to $\ell,m$ by the relation
$i = \ell^2 + \ell + m + 1$
alm_array
Real array of alm coefficients written to the file. This has dimension (nl,nalm,nsig) – corresponding to
nl = number of l,m indices
nalm = 2 for real and imaginary parts of alm coefficients or 4 for above plus corresponding error values
nsig = number of signals to be written (1 for any of T E B or 3 if ALL to be written). Each signal is stored in a separate extension.
fitsfile
String containing the name of the file to be written.


KEYWORDS

HDR =
String array containing the primary header to be written in the FITS file.
/HELP
If set, the routine documentation header is shown and the routine exits
XHDR =
String array containing the extension header. If ALL signals are required, then each extension table is given this header.
NOTE: optional header strings should NOT include the header keywords explicitly written by this routine.


DESCRIPTION

alm2fits writes the input alm coefficients (and associated errors if required) into a FITS file. Each signal type is written as a separate binary table extension. Optional headers conforming to the FITS convention can also be written to the output file. All required FITS header keywords are automatically generated by the routine and should NOT be duplicated in the optional header inputs. The keywords EXTNAME and TTYPE* are now also automatically generated.


RELATED ROUTINES

This section lists the routines related to alm2fits

idl
version 6.4 or more is necessary to run alm2fits.
fits2alm
provides the complimentary routine to read in alm coefficients from a FITS file.
alm_i2t, alm_t2i
these facilities turn indexed lists of $a_{\ell m}$ into 2D a(l,m) tables and back
lm2index
converts the $a_{\ell m}$ order and degree $(\ell, m)$ into the index $i = \ell^2 + \ell + m + 1$ required by alm2fits.
cl2fits
routine to write a power spectrum into a FITS file.
fits2cl
routine to read/compute $C(\ell)$ power spectra from a file containing $C(\ell)$ or $a_{\ell m}$ coefficients
alteralm
utilises the output file generated by alm2fits.
synfast
utilises the output file generated by alm2fits.


EXAMPLE:

alm2fits, index, alm, 'alm.fits', HDR = hdr, XHDR = xhdr
alm2fits writes the coefficients stored in the variable alm to the output FITS file alm.fits with optional headers passed by the string variables hdr and xhdr.

Version 3.83, 2024-11-13