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

4 visualizaciones (últimos 30 días)
Richard Lambour
Richard Lambour el 30 de Jul. de 2018
Respondida: Sreeram el 8 de Mayo de 2025
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 comentario
Ed Principe
Ed Principe el 22 de Dic. de 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');

Iniciar sesión para comentar.

Respuestas (1)

Sreeram
Sreeram el 8 de Mayo de 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:

Etiquetas

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by