Error using matlab.io.fits.openFile - will not open FITS files

6 vues (au cours des 30 derniers jours)
Richard Lambour
Richard Lambour le 30 Juil 2018
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 commentaire
Ed Principe
Ed Principe le 22 Déc 2018
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');

Connectez-vous pour commenter.

Réponses (1)

Sreeram
Sreeram le 8 Mai 2025
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:

Produits


Version

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by