This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Number of keywords in header


[nkeys,morekeys] = fits.getHdrSpace(fptr)


[nkeys,morekeys] = fits.getHdrSpace(fptr) returns the number of existing keywords (not counting the END keyword) and the amount of space currently available for more keywords. It returns morekeys = -1 if the header has not yet been closed. Note that the CFITSIO library will dynamically add space if required when writing new keywords to a header so in practice there is no limit to the number of keywords that can be added to a header.

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


fptr = fits.openFile('tst0012.fits');
[nkeys,morekeys] = fits.getHdrSpace(fptr);