필터 지우기
필터 지우기

fitsheader with list of files

조회 수: 1 (최근 30일)
Giuseppe
Giuseppe 2012년 9월 25일
Hi, I recently downloaded "fitsheader" ( http://www.mathworks.com/matlabcentral/fileexchange/122).
I can extract info from 1 file.fits, but having many of them I tried to use a LIST = dir([PATH '*' EXT]); and then
for i:length(LIST)
data(i) = fitsheader([PATH LIST(i).name], 'specific info');
end
Doing this I obtain the following error messages:
Error using fitsheader (line 58)
Too many open files
java.io.FileNotFoundException: /Users/giuseppemorello/.matlab/R2011b/matlab.prf (Too many open files)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
at java.io.FileOutputStream.<init>(FileOutputStream.java:145)
at com.mathworks.services.Prefs.save(Prefs.java:305)
at com.mathworks.services.Prefs$SavePrefsThread.run(Prefs.java:712)
Is there a mistake in my codes? Or is it impossible to apply fitsheader to a list with many files?

채택된 답변

Walter Roberson
Walter Roberson 2012년 9월 25일
Sounds like fitsheader() is failing to close a file.
If you do not have any other files open, then from time to time during the loop, you could call
fclose('all')
  댓글 수: 1
Giuseppe
Giuseppe 2012년 9월 25일
Thanks. I have not yet found the error in fitsheader.m, but it is the problem.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by