Header Keyword Routines

CFITSIO.fits_get_hdrspaceFunction
fits_get_hdrspace(f::FITSFile) -> (keysexist, morekeys)

Return the number of existing keywords (not counting the END keyword) and the amount of space currently available for more keywords.

source
CFITSIO.fits_read_keywordFunction
fits_read_keyword(f::FITSFile, keyname::String) -> (value, comment)

yields the specified keyword value and commend (as a tuple of strings), throws and error if the keyword is not found.

source
CFITSIO.fits_read_recordFunction
fits_read_record(f::FITSFile, keynum::Int)::String

Return the nth header record in the CHU. The first keyword in the header is at keynum = 1.

source
CFITSIO.fits_read_keynFunction
fits_read_keyn(f::FITSFile, keynum::Int) -> (name, value, comment)

Return the nth header record in the CHU. The first keyword in the header is at keynum = 1.

source
CFITSIO.fits_write_keyFunction
fits_write_key(f::FITSFile, keyname::String, value, comment::Union{String, Nothing} = nothing)

Write a keyword of the appropriate data type into the CHU. If comment is nothing, the keyword is written without a comment.

source
CFITSIO.fits_write_key_unitFunction
fits_write_key_unit(f::FITSFile, keyname::String, unit::String)

Write the physical units string into an existing keyword record. The keyword must already exist in the header. The unit string is enclosed in square brackets at the beginning of the keyword comment field.

source
CFITSIO.fits_write_dateFunction
fits_write_date(f::FITSFile)

Write the current date and time into the FITS header. If a DATE keyword already exists, it is replaced by the new value. The date is written in the format YYYY-MM-DDThh:mm:ss (ISO 8601).

source
CFITSIO.fits_hdr2strFunction
fits_hdr2str(f::FITSFile, nocomments::Bool=false)

Return the header of the CHDU as a string. If nocomments is true, comment cards are stripped from the output.

source
CFITSIO.fits_copy_headerFunction
fits_copy_header(fin::FITSFile, fout::FITSFile)

Copy the header (not the data) associated with the current HDU from fin to fout. If the current HDU in fout is not empty, it will be closed and a new HDU will be appended. An empty output HDU will be created with the header but no data.

source