Contenu principal

matlab.io.fits.imgCompress

Compress HDU from one file into another

Syntax

matlab.io.fits.imgCompress(infptr,outfptr)

Description

matlab.io.fits.imgCompress(infptr,outfptr) initializes the output HDU, copies all the keywords, and compresses the input image, writing the compressed data to the output HDU.

Examples

collapse all

Write compressed images from the sample file tst0012.fits to a new FITS file. Use the RICE compression algorithm.

import matlab.io.*
infptr = fits.openFile("tst0012.fits");
outfptr = fits.createFile("myfile.fits");
fits.setCompressionType(outfptr,"RICE")
fits.imgCompress(infptr,outfptr)
fits.closeFile(infptr)
fits.closeFile(outfptr)

Delete the new file.

delete myfile.fits

Tips

  • This function corresponds to the fits_img_compress 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