This routine writes a keyword of any kind into a FITS header. It is a wrapper to other routines that write keywords of different kinds.

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


call add_card( header, kwd, value[, comment, update] )

Arguments appearing in italic are optional.


name & dimensionality kind in/out description
header(LEN=80) DIMENSION(:) CHR INOUT The header to write the keyword to.
kwd(LEN=*) CHR IN the FITS keyword to write. Should be shorter or equal to 8 characters.
value any IN the value (double, real, integer, logical or character string) to give to the keyword. Note that long string values (more than 68 characters in length) are supported.
comment(LEN=*) CHR IN comment to the keyword.
name & dimensionality kind in/out description
update LGT IN if set to .true., the first occurence of the keyword kwd in header will be updated (and all other occurences removed); otherwise, the keyword will be appended at the end (and any previous occurence removed). If the keyword is either 'HISTORY' or 'COMMENT', update is ignored and the keyword is peacefully appended at the end of the header.


character(len=80), dimension(1:120) :: header
header = '' ! very important
call add_card(header,'NSIDE',256,'the nside of the map')
Gives the keyword `NSIDE' the value 256 in the given header-string. It is important to make sure that the header string array is empty before attempting to write anything in it.


This section lists the modules and routines used by add_card.

more general routine for adding a keyword to a header.
library for FITS file handling.


This section lists the routines related to add_card

routine to write HEALPix compliant baseline FITS header
general purpose routine to read any keywords from a header in a FITS file.
routine to discard a keyword from a FITS header
read_par, number_of_alms
routines to read specific keywords from a header in a FITS file.
function returning the size of the data set in a fits file and reading some other useful FITS keywords
routine to merge two FITS headers

Version 3.31, 2017-01-06