Contenido principal

matlab.io.fits.movAbsHDU

Move to absolute HDU number

Syntax

htype = matlab.io.fits.movAbsHDU(fptr,hdunum)

Description

htype = matlab.io.fits.movAbsHDU(fptr,hdunum) moves to the specified absolute HDU number (starting with 1 for the primary array) in a FITS file. The function returns htype as 'IMAGE_HDU', 'ASCII_TBL', or 'BINARY_TBL'.

Examples

collapse all

import matlab.io.*
fptr = fits.openFile("tst0012.fits");
N = fits.getNumHDUs(fptr);
for j = 1:N
    htype = fits.movAbsHDU(fptr,j);
    fprintf('HDU %d: "%s"\n',j,htype)
end
HDU 1: "IMAGE_HDU"
HDU 2: "BINARY_TBL"
HDU 3: "IMAGE_HDU"
HDU 4: "IMAGE_HDU"
HDU 5: "ASCII_TBL"
fits.closeFile(fptr)

Tips

  • This function corresponds to the fits_movabs_hdu (ffmahd) 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