Contenido principal

matlab.io.fits.getHdrSpace

Get number of records in header

Syntax

[nrecs,morekeys] = matlab.io.fits.getHdrSpace(fptr)

Description

[nrecs,morekeys] = matlab.io.fits.getHdrSpace(fptr) returns the number of existing records (not counting the record containing the END keyword) and the amount of space currently available for more keywords. The function returns a value of -1 in the morekeys output argument if the header has not yet been closed.

Note

The CFITSIO library dynamically adds space, if required, when writing new keywords to a header. So, in practice, there is no limit to the number of keywords that you can add to a header.

Examples

collapse all

import matlab.io.*
fptr = fits.openFile("tst0012.fits");
[nrecs,morekeys] = fits.getHdrSpace(fptr)
nrecs = 
23
morekeys = 
12
fits.closeFile(fptr)

Tips

  • This function corresponds to the fits_get_hdrspace (ffghsp) function in the CFITSIO library C API.

  • To use this function, you must be familiar with the CFITSIO C interface. You can access the CFITSIO documentation at the CFITSIO website.

Extended Capabilities

expand all

Version History

expand all