%Read SCS Event file
% Each Event is stopped and started to creat daily files (UTC)
% DEW LB 7/10/2013
disp('Need to run read_epicz to create 5 min all file');
disp('Plt_buoy');

clear
close all

cruise='WHOTS_2013';     % Cruise name, for example 'STRATUS_2009', 'TOTO_1969', etc...
ship='Hiialakai';                % Research vessel
yys = '2013';
data_drive='D:\';
Lacie_drive='G:\';
plotit = 1;

% bds = input('Input year day (195) ','s');
mms = '07';
% dds = input('Input year day (14) ','s');


way_proc_data_flux = [data_drive cruise  '\' ship '\flux\Processed\'];     % Processed data path
way_images_flux = [data_drive cruise  '\' ship '\flux\Raw_Images\' ];

dc = 8;
for i = 190:196
    dc = dc + 1;  %  increment day
    dds = sprintf('%02d',dc);
    bds = num2str(i);
    g=['D:\WHOTS_2013\Hiialakai\flux\Processed\WHOTS_2013_proc_gpsnav_1min_2013_' mms '_' dds '_' bds '.txt'];
    gps=load(g)';
    %195.00000    22.797  -157.899     0.230   300.881    57.635     0.264
    % 1  jd_pc;  %decimal JD
    % 2  lo
    % 3  lat

    figure;
    plot(gps(3,:),gps(2,:),'.');
    tit = (['PSD GPS Lat/Lon ' cruise,' ' yys '/' mms '/' dds ' DOY ' bds]);
    title(tit)   %,'FontWeight','Bold','Interpreter','none');
    xlabel('Longitude (deg)');ylabel('Latitude (deg)');grid
    %% added 7/15/2013 DEW ro help calrify when we were near buoys
    hold
    %     m_line(-157.9084,22.7874,'marker','o','markersize',6,'LineWidth',1.5,'color','g');    %WHOTS-12 (old buoy)
    %     m_line(-157.9502,22.6686,'marker','*','markersize',6,'LineWidth',1.5,'color','g');    %WHOTS-13 (old buoy)
    text(-157.91,22.7874,'o12','FontSize',18,'FontWeight','bold','color','g');  % 2012
    text(-157.91,22.6686,'o13','FontSize',18,'FontWeight','bold','color','r');  % 2013
    xlim([-158.05 -157.8 ])
    ylim([22.6 22.85 ])

    if 1
        print_buffer = [way_images_flux cruise '_Buoy1_' bds '.png'];
        print('-dpng ', print_buffer);
    end

    figure;
    subplot(2,1,1),plot(gps(1,:),gps(2,:),'.');
    tit = (['PSD GPS Lat/Lon ' cruise,' ' yys '/' mms '/' dds ' DOY ' bds]);
    title(tit)   %,'FontWeight','Bold','Interpreter','none');
    ylabel('Latitude (deg)');
    hold
    grid
    subplot(2,1,2),plot(gps(1,:),gps(3,:),'.');
    hold
    grid
    subplot(2,1,1),plot(i+.5,22.6686,'r*','MarkerSize',12);  %2013
    subplot(2,1,2),plot(i+.5,-157.9502,'r*','MarkerSize',12);  %2013
    subplot(2,1,1),plot(i+.5,22.7874,'go','MarkerSize',12);   % 2012
    subplot(2,1,2),plot(i+.5,-157.9084,'go','MarkerSize',12);  %2012
    xlabel('Year Day(UTC)');
    ylabel('Longtude (deg)');
    %% added 7/15/2013 DEW ro help calrify when we were near buoys
    %    -157.9084   22.7874  %WHOTS-12 (old buoy)
    %    -157.9502   22.6686  %WHOTS-13 (new buoy)

    if 1
        print_buffer = [way_images_flux cruise '_Buoy2_' bds '.png'];
        print('-dpng ', print_buffer);
    end

end % day loop