These files read, write, and scan the headers of FITS files. FITS is a standard format for astonomical images. All of the files
should be self-documenting with the MATLAB 'help' command. The on-line help also includes examples of usage.
The files have been tested on Matlab v. 5.2, and 5.3.
Roberto Abraham (2020). fits (https://www.mathworks.com/matlabcentral/fileexchange/122-fits), MATLAB Central File Exchange. Retrieved .
The fitsinfo/fitsread are now part of Matlab, but no Write, so this contribution is excellent.
if you have fitsheader search for a specific keyword, it doesn't properly close the file. adding 'fclose(file)' to line 73 in 'fitsheader.m' seems to solve the problem. otherwise, works great.
FITS file is always in BIG-ENDIAN format, so one DO NOT need to determine the endianness from computer; instead you need to ALWAYS set bswap='b' when write and read.
so you need to ALWAYS set bswap='b'
I only need 2D arrays so it works for me, thanks!
Thanks for the great fitswrite.m file, Roberto. I added
bswap = 'b';
to get it to work on my computer :)
Good for handling simple fits files, but does not handle cubes (ie 3d arrays).
Perfect for FITS manipulation