function ep2flrlook(NumOfDays) % EP2FLRLOOK - Opens and graphs the file /oasis/eqpac/ep1/wetstar % Peter Strutton % 22 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 = ['..\ep2\wetstar']; FileLoc = ['//tsunami.shore.mbari.org/oasis/eqpac/ep2/wetstar']; otherwise % Assigns an absolute path in UNIX FileLoc = ['/hosts/tsunami/oasis/eqpac/ep2/wetstar']; end loc = '2S 170W'; % Open and read the file fid = fopen(FileLoc,'r'); OK = 1; while OK % Trash the header S = fgetl(fid); if ~strcmp(S(1),'#') break end end i = 1; while ~feof(fid) % Read the data XS = fgetl(fid); % Get a line from the file XBuf = sscanf(XS,'%f')'; % Read the data from the line if length(XBuf) == 2 X(i,:) = [XBuf NaN]; % Account for missing data else X(i,:) = XBuf; end i = i + 1; end fclose(fid); [rX cX] = size(X); % Get it's size D = dy2date(X(:,1)); % Convert decimal years to serial date numbers DEnd = max(D); % Get the last date i = find(D >= (DEnd - NumOfDays)); % Find all dates within specified period % Create the graph figH = figure; set(figH,'Name','Wetstar fluorescence') plot(D(i),X(i,2),'b') % Plot the surface fluorometer hold('on') j = find(~isnan(X(i,3))); % Skip rows of data with NaN's plot(D(i(j)),X(i(j),3),'r') % Plot the 20 m fluorometer %plot(data(length(data)-no_of_days*8:length(data),1),data(length(data)-no_of_days*8:length(data),2)); hold off ylabel('Fluorescence [v]'); xlabel('Date'); title(['Wetstar Fluoescence at ' loc]) %hold on legend('0 m','20 m',0) if NumOfDays < 40 dtick = 6; else dtick = 3 end datetick('x',dtick) setfontsize(7)