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.

Insert FITS image after current image




insertImage(fptr,bitpix,naxes) inserts a new image extension immediately following the current HDU. If the file has just been created, a new primary array is inserted at the beginning of the file. Any following extensions in the file will be shifted down to make room for the new extension. If the current HDU is the last HDU in the file, then the new image extension will be appended to the end of the file.

This function corresponds to the fits_insert_imgll (ffiimgll) function in the CFITSIO library C API.


Create a 150x300 image between the 1st and 2nd images in a FITS file.

fptr = fits.createFile('myfile.fits');
fits.createImg(fptr,'byte_img',[100 200]);
fits.createImg(fptr,'byte_img',[200 400]);
fits.insertImg(fptr,'byte_img',[150 300]);

See Also