SaveCalFile

Hello,

I've noticed that the present version of SaveCalFile replaces
an old cal file with a new one, and thus we would lose older
calibration data.
This problem occurs because SaveCalFile now passes "filename"
instead of "filespec" to LoadCalFile. (Then LoadCalFile
duplicates the directiory and extension strings of the specified
cal file.)

I've included SaveCalFile (below) I modified to avoid this
problem. Modifications were marked by "%%%".

One more thing. A minor problem regarding LMSToMacBoyn.m.
Line 20 should be:
factors = (T_cones(1:2,:)'\T_lum');
We want to use "T_cones" rather than "T_cones_sp".

Eiji

------------
% Set the filename
if (nargin < 3 | isempty(dir))
dir = CalDataFolder;
end
if (nargin < 2 | isempty(filespec))
filespec = 'default'; %%% modified by ek
filename = [dir filespec '.mat']; %%%
elseif (isstr(filespec))
filename = [dir filespec '.mat'];
else
filename = [dir sprintf('screen%d.mat',filespec)];
end

% Load the file to get older calibrations
[oldCal,oldCals] = LoadCalFile(filespec); %%%
if (isempty(oldCals))
cals = {cal};
else
nOldCals = size(oldCals,2);
cals = oldCals;
cals{nOldCals+1} = cal;
end

% Save the file
eval(['save ' QuoteString(filename) ' cals']);

---------------------------------------
Eiji Kimura

Tel: +81-72-254-9622
Fax: +81-72-254-9927
e-mail: kimura@...-u.ac.jp

Dept. of Human Sciences,
College of Integrated Arts and Sciences.
Osaka Prefecture University
1-1 Gakuen-cho, Sakai-shi,
Osaka 599-8531 Japan
---------------------------------------
Thanks. I'll incorporate these fixes.

DB

>I've noticed that the present version of SaveCalFile replaces
>an old cal file with a new one, and thus we would lose older
>calibration data.
>This problem occurs because SaveCalFile now passes "filename"
>instead of "filespec" to LoadCalFile. (Then LoadCalFile
>duplicates the directiory and extension strings of the specified
>cal file.)
>
>I've included SaveCalFile (below) I modified to avoid this
>problem. Modifications were marked by "%%%".
>
>One more thing. A minor problem regarding LMSToMacBoyn.m.
>Line 20 should be:
> factors = (T_cones(1:2,:)'\T_lum');
>We want to use "T_cones" rather than "T_cones_sp".
>
>Eiji
>
>------------
>% Set the filename
>if (nargin < 3 | isempty(dir))
> dir = CalDataFolder;
>end
>if (nargin < 2 | isempty(filespec))
> filespec = 'default'; %%% modified by ek
> filename = [dir filespec '.mat']; %%%
>elseif (isstr(filespec))
> filename = [dir filespec '.mat'];
>else
> filename = [dir sprintf('screen%d.mat',filespec)];
>end
>
>% Load the file to get older calibrations
>[oldCal,oldCals] = LoadCalFile(filespec); %%%
>if (isempty(oldCals))
> cals = {cal};
>else
> nOldCals = size(oldCals,2);
> cals = oldCals;
> cals{nOldCals+1} = cal;
>end
>
>% Save the file
>eval(['save ' QuoteString(filename) ' cals']);
>
>---------------------------------------
>Eiji Kimura
>
>Tel: +81-72-254-9622
>Fax: +81-72-254-9927
>e-mail: kimura@...-u.ac.jp
>
>Dept. of Human Sciences,
>College of Integrated Arts and Sciences.
>Osaka Prefecture University
>1-1 Gakuen-cho, Sakai-shi,
>Osaka 599-8531 Japan
>---------------------------------------
>
>
>http://psychtoolbox.org
>POST a message to: psychtoolbox@yahoogroups.com
>UNSUBSCRIBE by sending a blank message to:
>psychtoolbox-unsubscribe@yahoogroups.com
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/