Error using matlab.io.fits.openFile - will not open FITS files
6 次查看(过去 30 天)
显示 更早的评论
Hi, I am trying to use Matlab FITS i/o routines (fitsinfo, fitsread in 2017b release) to open FITS files and am receiving the following error:
Error using fitsiolib
CFITSIO library error (104): could not open the named file
Error in matlab.io.fits.openFile (line 63)
fptr = fitsiolib('open_file',filename,mode);
Error in fitsinfo>openFile (line 747)
fptr = fits.openFile(filename);
Error in fitsinfo (line 207)
fid = openFile(filename);
Are there any guidelines to troubleshooting the error; the message is not particularly descriptive. I've seen one other thread which suggested certain characters might cause trouble with fitsread - is there a list of known issues? These FITS files can be opened without difficulty using other readers, such as SAO DS9, so I'm quite puzzled. Thank you for your help.
1 个评论
Ed Principe
2018-12-22
I have nearly the identical error set running code which worked 4 years ago... but not now. This is in version 2013b. See below.
Error using fitsiolib
CFITSIO library error (211): illegal BITPIX keyword value
Error in matlab.io.fits.openFile (line 63)
fptr = fitsiolib('open_file',filename,mode);
Error in fitsinfo>openFile (line 743)
fptr = fits.openFile(filename);
Error in fitsinfo (line 207)
fid = openFile(filename);
Error in fitsread (line 99)
info = fitsinfo(filename);
Error in fits2ldo (line 15)
imdata=fitsread(fullfile(pathname,fname{1}),'primary');
回答(1 个)
Sreeram
2025-5-8
Hi Richard,
This is a known issue in MATLAB R2017b and earlier, where "fitsread" returns an error if the file path contains special characters.
A workaround is available on the Bug Reports page. In short, you'll need to download a provided ZIP file, back up and replace certain files in your MATLAB installation, then run "rehash toolboxcache" after restarting MATLAB.
Please refer to the Bug Reports page for detailed steps and the download link:
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!