Survey_Names={'North-Survey_0';'North-Fertilization_1';'North-Survey_1';'North-Fertilization_2';'North-Survey_2';'South-Survey_0';'South-Fertilization_1';'South-Survey_1';'South-Fertilization_2';'South-Survey_2';'South-Fertilization_3';'South-Survey_3';'South-Fertilization-4';'South-Survey_4';'North-Survey_3';'North-Fertilization_3'};
Graph_Titles={'Temperature [C^o] ';'Salinity [PSU] ';'Flourometer [volts] ';'Surface pCO_2 [umolo mol^-1] ';'Surface FeIII [nm] ';'SF_6 [ppt] '};
Graph_Cols=[25;24;14;26;28;27];

start_time = datenum(['10-Jan-02 00:00';     % North Survey 0
    '12-Jan-02 14:00';     % North Fertilization 1
    '14-Jan-02 14:30';     % North Survey 1
    '16-Jan-02 03:30';     % North Fertilization 1
    '17-Jan-02 17:00';     % North Survey 2
    '22-Jan-02 04:50';     % South Survey 0
    '24-Jan-02 07:30';     % South Fertilization 1
    '26-Jan-02 01:30';     % South Survey 1, milk running low
    '28-Jan-02 14:30';     % South Fertilization 2, bread running low
    '30-Jan-02 06:30';     % South Survey 2, bread gone
    '01-Feb-02 10:00';     % South Fertilization 3, butter gone
    '02-Feb-02 11:30';     % South Survey 3
    '04-Feb-02 11:00';     % South Fertilization 4, milk gone
    '05-Feb-02 03:00';
    '08-Feb-02 00:00'
    '09-Feb-02 11:00']);     % South Survey 4, milk back!

end_time = datenum(['11-Jan-02 22:00';
    '14-Jan-02 14:30';
    '15-Jan-02 13:30';
    '17-Jan-02 15:00';
    '19-Jan-02 14:00';
    '23-Jan-02 13:00';
    '26-Jan-02 01:30';
    '28-Jan-02 13:00';
    '30-Jan-02 01:30';
    '01-Feb-02 10:00';
    '02-Feb-02 11:00';
    '03-Feb-02 21:00';
    '05-Feb-02 03:00';
    '05-Feb-02 12:00';
    '09-Feb-02 01:30';
    '10-Feb-02 01:00']);

DataSet = load('c:\winnt\profiles\dracha\desktop\merge');
for survey = [1:7 8:length(end_time)] %skip South_Fert_1
        ind=find(DataSet(:,2)>=start_time(survey)&DataSet(:,2)<=end_time(survey));
        f_out=fopen(char(Survey_Names(survey)),'wt');
        fprintf(f_out,'pco2_time [jday]\tship_time [sdn]\tair_temp [C]\tair_pressure [hPa]\tq_short [W/m2]\trel_hum [percent]\trel_wind_speed [m/s]\trel_wind_dir [deg]\ttrue_wind_speed [m/s]\ttrue_wind_dir [deg]\tsig_t [kg/m3]\twater_flow [gpm]\toxygen [ml/l]\tflr [volts]\tPAR [W/m2]\tlat [deg]\tlon [deg]\tcog [deg]\tsog [kn]\tdrifter_lat [deg]\tdrifter_lon [deg]\tx_pos [m]\ty_pos [m]\ttsg_sal [psu]\ttsg_temp [C]\txCO2 [umol/mol]\tSF6 [ppt]\tFEIII [nm]\n');
        for k = 1:length(ind)
        fprintf(f_out, '%7.6f\t%13.6f\t%5.2f\t%7.2f\t%6.1f\t%4.1f\t%4.1f\t%5.1f\t%4.1f\t%5.1f\t%5.2f\t%4.1f\t%5.3f\t%6.3f\t%7.2f\t%7.4f\t%8.4f\t%5.1f\t%4.1f\t%8.4f\t%8.4f\t%5.0f\t%5.0f\t%5.2f\t%6.3f\t%5.1f\t%5.3f\t%5.3f\n',DataSet(ind(k),:));
        end;
        fclose(f_out);
        [ax,minax,maxax]=navaspect(DataSet(ind,16),DataSet(ind,17));
        for j=1:6
            nanind=find(~isnan(DataSet(ind,Graph_Cols(j))));
            subplot(2,3,j)
            scatter(DataSet(ind(nanind),17),DataSet(ind(nanind),16),15,DataSet(ind(nanind),Graph_Cols(j)),'filled');
            colorbar;
            xlabel('Longitude [deg]');
            ylabel('Latitude [deg]');
            title([char(Graph_Titles(j)) char(Survey_Names(survey))]);
            set(gca,ax,[minax maxax]);
        end;
        set(gcf,'Position',[3 29 1022 672]);
        screen2jpeg(char(Survey_Names(survey)));
        close all;
end;
        
            
        
        