function ep_prcCtd(id)
% EP_PRCCTD - Opens the files \oasis\eqpac\ep1\temp.0m, calculates salinity and
% writes it to a new file \oasis\eqpac\ep1\ctd.0m.brian
%
% Requires: READEQPAC

% Brian Schlining
% 28 Jan 1999

switch lower(id)
case 'ep1'
   loc = '0 155W';
case 'ep2'
   loc = '2S 170W';
otherwise
   loc = [];
   return;
end

% Set the path to the data file depending on what type of machine this function is run from
PathS = fullfile(getOasisPath, 'eqpac', id);

FileLoc = fullfile(PathS, 'temp.0m');
X       = readeqpac(FileLoc);
S       = salin_(X(:,3)/4.2914,X(:,2),0);

fidR    = fopen(FileLoc,'rt');
fidW    = fopen(fullfile(PathS, 'ctd.0m.brian'),'wt');

s = fgetl(fidR);
while strcmp(s(1),'#')
   fprintf(fidW,'%s\n',s);
   s = fgetl(fidR);
end
fprintf(fidW,'# The fourth column is salinity - added by Brian Schlining\n#\n');

n = 0;
while ~feof(fidR)
   s = fgetl(fidR);
   n = n + 1;
   fprintf(fidW,'%s   %7.4f\n',s,S(n));
end

fclose(fidR);
fclose(fidW);




