function m_lookPco2(id, NumOfDays)
% m_lookPco2 - Opens and plots the file \oasis\ep1\co2
%
% Requires: READEQPAC

% Peter Strutton
% 29 Dec 1998; Brian Schlining

% Prompt for input if no input arguments are specified
if nargin < 2
   NumOfDays = 7;
end

infile = netcdf(fullfile(getOasisPath, id, 'netcdf', [id '_pco2.nc']));

%prop = readProperties('//tsunami.shore.mbari.org/oasis/cfg/mooring.properties');
XLim = [now-NumOfDays now];

v = var(infile);
n = ncnames(v);

dataTypes = {'pco2', 'mv', 'pressure', 'temp'};
colors = [ .8 .8 .2; .2 .8 .8; .8 .2 .8; .2 .2 .8; .8 .2 .2; .2 .8 .2 ];
colors = [  .8 .1 .1; .9 .6 1; 1 .9 .6; .1 .1 .8; .2 .8 .2 ];
symbols = 's^do.';

% For storing the time data
timeStruct = [];
for k = 1:length(dataTypes)
   
   goodVar = flipud([strmatch(dataTypes{k}, n)]);
   
   if ~isempty(goodVar)
      
      figure;
      
      X = [];
      
      for i = 1:length(goodVar)
         
         V   = v{goodVar(i)};
         N   = char(ncnames(V));
         d   = dim(V); % get the dimensions
         
         timeDimName = char(ncnames(d{1}));
         X   = utc2sdn(infile{timeDimName}(:)); % Time
         
         Y   = infile{N}(:);   % Data
         Y(find(Y == infile{N}.missing_value(:))) = NaN;
         
         lat = infile{char(ncnames(d{2}))}(:); % Latitude
         lon = infile{char(ncnames(d{3}))}(:); % Longitude
         if isempty(lat) | isempty(lon)
            loc = [];
         else
            loc = getLocationString(lat, lon);
         end
         
         
         good = find(X >= XLim(1) & X <= XLim(2));
         
         fprintf(1, 'Plotting %s (%i points)\n', N, length(X(good)))
         if ~isempty(good)
            X = X(good);
            Y = Y(good);
            plot(X, Y, symbols(i), 'Color', colors(i, :), 'Markersize', 3, 'MarkerFaceColor', colors(i,:))
         else
            plot(now, 0, symbols(i), 'Color', colors(i, :), 'Markersize', 3)
         end
         if i == 1
            hold on
         end
      end
      
      legendS = [];
      for j = 1:length(goodVar)
         legendS{j} = v{goodVar(j)}.long_name(:);
      end
      set(gca, 'XLim', XLim);
      legend(legendS,0);
      daytick x
      setfontsize(7)
      title(['\bf{Data from pCO_2 sensor on ' upper(id) ' at ' char(loc) '}'])
      xlabel \bf{Date}
      ylabel(['\bf{' v{goodVar(1)}.units '}'])
      grid on
      set(gcf, 'PaperPosition', [0 0 3.75 3.25])
   end
end
