Write to FITS image
writeImg(fptr,data)
writeImg(fptr,data,fpixel)
writeImg(fptr,data)
writes an entire image
to the FITS data array. The number of rows and columns in data
must
equal the values of the NAXIS2 and NAXIS1 keywords, respectively.
Any further extents must correspond to the NAXIS3, NAXIS4 ... NAXISn
keywords respectively.
writeImg(fptr,data,fpixel)
writes a subset
of an image to the FITS data array. fpixel
gives
the coordinate of the first pixel in the image region.
This function corresponds to the fits_write_subset
(ffpss)
function in the CFITSIO library C API.
import matlab.io.* fptr = fits.createFile('myfile.fits'); fits.createImg(fptr,'long_img',[256 512]); data = reshape(1:256*512,[256 512]); data = int32(data); fits.writeImg(fptr,data); fits.closeFile(fptr);
Create an 80x40 uint8
image and set all but
the outermost pixels to 1.
import matlab.io.* fptr = fits.createFile('myfile.fits'); fits.createImg(fptr,'uint8',[80 40]); data = ones(78,38); fits.writeImg(fptr,data,[1 1]); fits.closeFile(fptr);