Main Content

matlab.io.fits.setCompressionType

设置图像压缩类型

语法

setCompressionType(fptr,comptype)

说明

setCompressionType(fptr,comptype) 指定写入 FITS 图像时应使用的图像压缩算法。

comptype 的支持值包括:

'GZIP'
'GZIP2'
'RICE'
'PLIO'
'HCOMPRESS'
'NOCOMPRESS'

此函数对应于 CFITSIO 库 C API 中的 fits_set_compression_type 函数。

示例

import matlab.io.*
fptr = fits.createFile('myfile.fits');
fits.setCompressionType(fptr,'GZIP2');
fits.createImg(fptr,'long_img',[256 512]);
data = reshape(1:256*512,[256 512]);
data = int32(data);
fits.writeImg(fptr,data);
fits.closeFile(fptr);
fitsdisp('myfile.fits','mode','full');

另请参阅

|