function ep2pco2look(NumOfDays) % EP2PCO2LOOK - Opens and plots the file \oasis\ep2\co2 % % Requires: READEQPAC % Peter Strutton % 29 Dec 1998; Brian Schlining % Prompt for input if no input arguments are specified if ~nargin NumOfDays = str2num(input('How many days of data would you like to view? ','s')); end % Set the path to the data file depending on what type of machine this function is run from switch computer case 'PCWIN' % Assumes the pwd is /oasis/epqac/brian/ FileLoc = ['//tsunami.shore.mbari.org/oasis/eqpac/ep2/co2']; otherwise % Assigns an absolute path in UNIX FileLoc = ['/hosts/tsunami/oasis/eqpac/ep2/co2']; end loc = '2S 170W'; % Read co2 X = readeqpac(FileLoc, NumOfDays); % Plot it fig1 = figure; set(fig1,'Name','delta pCO2') plot(X(:,1),X(:,2)); ylabel('delta pCO2 [\muatm]'); xlabel('Date'); if NumOfDays < 50 dtick = 6; else dtick = 3; end datetick('x',dtick) % Set the path to the data file depending on what type of machine this function is run from switch computer case 'PCWIN' % Assumes the pwd is /oasis/epqac/brian/ %FileLoc = ['..\ep2\co2.cal']; FileLoc = ['//tsunami.shore.mbari.org/oasis/eqpac/ep2/co2.cal']; otherwise % Assigns an absolute path in UNIX FileLoc = ['/hosts/tsunami/oasis/eqpac/ep2/co2.cal']; end % Read co2.cal Y = readeqpac(FileLoc, NumOfDays); % Make sure the data is monotonic Y = sortrows(Y,1); X = sortrows(X,1); % Plot it try CO = interp1(Y(:,1),Y(:,2),X(:,1)); catch CO = NaN*ones(size(X(:,1))); end CO = X(:,2) - CO; hold on plot(X(:,1), CO, 'r') legend('pCO_2 (uncalibrated)','pCO_2 (calibrated)',0) title(['pCO_2 at ' loc])