Here is an example of writing a FITS image. header = ft_imagehead(simple, bitpix, naxis, ax1, ax2, ...); ft_imagewite(file, header, data, bitpix); These routines allow access to complete multiextension FITS files. If bitpix is given as 0 no data will be read in on the first pass. If bitpix is specified the data blocks will be read and converted (if images) to the given type. If the file is not seekable the data will be buffered in any event. FITSFile = ft_fileopen(filenamei, bitpix); FITSFile = ft_fileread(file, bitpix); hdu = ft_filematch(fitsfile, hduname); ft_filehduhead(fitsfile, hdu); ft_filehdudata(fitsfile, hdu); ft_filevali(fitsfile, hdu, name, n, &card); ft_fileseti(fitsfile, hdu, name, n, &card); ft_fileappi(fitsfile, hdu, name, n); data = ft_fileimageread(fitsfile, bitpix); data = ft_filetableload(fitsfile) data = ft_filetablerowload(fitsfile, row); Toss in xx_alloc and get 1, 2, 3 dim edges. Toss in acht and get type changes. Add macros for all struct value access + ft_headblocks(head) ft_datablocks(head)