% look at raw (full time and depth scale resolution) temperature
% data ASCII text files
% format:
% T only:
% date/time       temperature
% 20060802000000  25.9760
% P only:
% date/time      T again P
% 20060802104500 25.8    1020
% P & T
% 20060730130740  16.9676  16.0988

d=dir('*.txt');

for ii = 1:length(d)
  disp(d(ii).name)
  % load data
  data=load(d(ii).name);
  % calculate Matlab date
  dvec=parse_date(data(:,1));
  mdate=datenum(dvec);

  % plot data
  if strcmp(d(ii).name(1:2),'T2') | strcmp(d(ii).name(1:2),'T0')	
    % T only sensors:
    dvec=parse_date(data(:,1));
    mdate=datenum(dvec);

    plot(mdate,data(:,2))
    xlabel('Date')
    ylabel('Temperature ^oC')
    title(['SW06 ASIS Temperature Data: ',d(ii).name(1:end-4)])
    
    print('-dpng',d(ii).name(1:end-4))
    
  elseif strcmp(d(ii).name(1:2),'P0')
    % P only sensor

    plot(mdate,data(:,3))
    xlabel('Date')
    ylabel('Pressure (dbar)')
    title(['SW06 ASIS Temperature Data: ',d(ii).name(1:end-4)])
    
    print('-dpng',d(ii).name(1:end-4))
        
  elseif strcmp(d(ii).name(1:2),'TP')
    % T & P sensor
    subplot(2,1,1)
    plot(mdate,data(:,2))
    ylabel('Temperature ^oC')
    title(['SW06 ASIS Temperature Data: ',d(ii).name(1:end-4)])
    subplot(2,1,2)
    plot(mdate,data(:,3))    
    xlabel('Date')
    ylabel('Pressure (dbar)')
        
  else
    error(['plot_yankee: bad .txt file name: ',d(ii).name])
  end
  
  datetick('x',2)
  ax=axis;
  axis([mdate(1) mdate(end) ax(3:4)])
  
  print('-dpng',d(ii).name(1:end-4))           
      
end


