write_tqu

This IDL facility writes a temperature+polarization Healpix map (T,Q,U) into a binary table FITS file, with optionally the error (dT,dQ,dU) and correlation (dQU, dTU, dTQ) in separate extensions

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


FORMAT

IDL> WRITE_TQU , File, TQU, [Coordsys=, Nested=, Ring=, Ordering=, Error=, Extension=, Help=, Hdr=, Xhdr=, Units=, Help=]


QUALIFIERS

File
name of a FITS file in which the maps are to be written

TQU
array of Healpix maps of size ( Npix,3,n_ext) where Npix is the total number of Healpix pixels on the sky, and n_ext $\le$ 3.
Three maps are written in each extension of the FITS file :
-the temperature+polarization Stokes parameters maps (T,Q,U) in extension 0
-the error maps (dT,dQ,dU) (if n_ext $\ge$ 2) in extension 1
-the correlation maps (dQU, dTU, dTQ) (if n_ext = 3) in extension 2
it is also possible to write 3 maps directly in a given extension (provided the preceding extension, if any, is already filled in) by setting Extension to the extension number in which to write (0 based) and if n_ext + Extension $\le$ 3

Coordsys=
(optional),
if set to either 'C', 'E' or 'G', specifies that the Healpix coordinate system is respectively Celestial=equatorial, Ecliptic or Galactic. (The relevant keyword is then added/updated in the extension header, but the map is NOT rotated)

Error=
(optional output),
will take value 1 if file can not be written

Extension=
(optional),
extension unit a which to put the data (0 based). The physical interpretation of the maps is determined by the extension in which they are written
see also:TQU

Hdr=
(optional),
string variable containing on input the information to be added to the primary header. (If already present, FITS reserved keywords will be automatically updated).

Ordering=
(optional),
if set to either 'ring' or 'nested' (case un-sensitive), specifies that the map is respectively in RING or NESTED ordering scheme
see also:Nested and Ring

Units=
(optional),
string describing the physical units of the data set

Xhdr=
(optional),
string variable containing on input the information to be added to the extension headerx. (If already present, FITS reserved keywords will be automatically updated). It will be repeated in each extension, except for TTYPE* and EXTNAME which are generated by the routine and depend on the extension


KEYWORDS

Help
if set, an extensive help is displayed and no file is written
Nested
if set, specifies that the map is in the NESTED ordering scheme
see also:Ordering and Ring
Ring
if set, specifies that the map is in the RING ordering scheme
see also:Ordering and Nested


DESCRIPTION

write_tqu writes out Stokes parameters (T,Q,U) maps for the whole sky into a FITS file. It is also possible to write the error per pixel for each map and the correlation between fields, as subsequent extensions of the same FITS file (see qualifiers above). Therefore the file may have up to three extensions with three maps in each. Extensions can be written together or one by one (in their physical order) using the Extension option.
For more information on the FITS file format supported in HEALPix, including the one implemented in write_tqu , see https://healpix.sourceforge.io/data/examples/healpix_fits_specs.pdf.


RELATED ROUTINES

This section lists the routines related to write_tqu

idl
version 6.4 or more is necessary to run write_tqu
read_tqu
This HEALPix IDL facility can be used to read in maps written by write_tqu.
read_fits_s
This HEALPix IDL facility can be used to read into an IDL structure maps written by write_tqu.
sxaddpar
This IDL routine (included in HEALPix package) can be used to update or add FITS keywords to the header(s) HDR or XHDR
write_fits_cut4, write_fits_partial, write_fits_map
write_tqu, write_fits_sb
HEALPix IDL routines to write cut-sky and partial maps, full-sky maps, polarized full-sky maps and arbitrary data sets into FITS files


EXAMPLE:

npix = nside2npix(64)
TQU = randomn(seed,npix,3)
write_tqu, 'map_polarization.fits', TQU, coord='G', /ring
The array TQU is defined to contain a fictitious polarisation map, with the 3 Stokes parameters T, Q and U. The map is assumed to be in Galactic coordinates, with a RING ordering of the pixels and Nside=64. write_tqu writes out the contents of TQU into the extension of the FITS file 'map_polarization.fits'.

Version 3.82, 2022-07-28