Header Keyword Routines
CFITSIO.fits_get_hdrspace
— Functionfits_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.
CFITSIO.fits_read_keyword
— Functionfits_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.
CFITSIO.fits_read_record
— Functionfits_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
.
CFITSIO.fits_read_keyn
— Functionfits_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
.
CFITSIO.fits_read_key_unit
— Functionfits_read_key_unit(f::FITSFile, keyname::String)
Read the physical unit of the keyword keyname
in the header.
CFITSIO.fits_write_key
— Functionfits_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.
CFITSIO.fits_write_key_unit
— Functionfits_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.
CFITSIO.fits_write_record
— Functionfits_write_record(f::FITSFile, card::String)
Write a user specified keyword record into the CHU.
CFITSIO.fits_write_date
— Functionfits_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).
CFITSIO.fits_delete_record
— Functionfits_delete_record(f::FITSFile, keynum::Int)
Delete the keyword record at the specified index.
CFITSIO.fits_delete_key
— Functionfits_delete_key(f::FITSFile, keyname::String)
Delete the keyword named keyname
.
CFITSIO.fits_hdr2str
— Functionfits_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.
CFITSIO.fits_copy_header
— Functionfits_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.