Home > ctdcal > make_oxy_sumfile_deep.m

make_oxy_sumfile_deep

PURPOSE ^

MAKE_OXY_SUMFILE_DEEP - Makes oxygen bottle/ctd comparison summary file.

SYNOPSIS ^

function oxy_cal = make_oxy_sumfile_deep(cruiseid)

DESCRIPTION ^

 MAKE_OXY_SUMFILE_DEEP -  Makes oxygen bottle/ctd comparison summary file.

 CTD Calibration toolbox.

 USAGE:
  [oxy_struct] = make_oxy_sumfile_deep(cruiseid);

 INPUT: cruiseid: Cruise identification name. 
   
 OUTPUT:  Automatically writes two files  
          basically with the same fields in *.mat and *.asc formats
          oxy_struct: contains a structure with the same information
               contained in the *.mat file

 DESCRIPTION:  This function tries to merge the downcast information (*.cnv) files from the Seabird 
  and the *.oxy files from the AOML titration system
  and create a summary file containing coincident measurements from both
  systems.  The data for a whole cruise is processed at once so if you want
  less data you'll have to subset afterwards.

 BUGS:  1. Not really a bug but it's based on the AOML *.oxy files.  These files
  can vary slightly in terms of what each field means, based on operator preference.
  The results of read_oxy contain a field called depth which is usu. either
  the niskin bottle position on the rosette or the firing order.  Position is
  preferrable if you think about it at the beginning of the cruise.
 

 AUTHORS:Carlos Fonseca 
         UM/CIMAS
         Derrick Snowden
         NOAA/AOML/PhOD
         Tue May 11 11:23:37 EDT 2004
 CHANGELOG: 
   23-Jul-2004, Version 1.0
        * Initial version.

 DEPENDENCIES: SW package.
               load_oxy
               load_btl
               load_bl
               load_cnv

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function oxy_cal = make_oxy_sumfile_deep(cruiseid)
0002 % MAKE_OXY_SUMFILE_DEEP -  Makes oxygen bottle/ctd comparison summary file.
0003 %
0004 % CTD Calibration toolbox.
0005 %
0006 % USAGE:
0007 %  [oxy_struct] = make_oxy_sumfile_deep(cruiseid);
0008 %
0009 % INPUT: cruiseid: Cruise identification name.
0010 %
0011 % OUTPUT:  Automatically writes two files
0012 %          basically with the same fields in *.mat and *.asc formats
0013 %          oxy_struct: contains a structure with the same information
0014 %               contained in the *.mat file
0015 %
0016 % DESCRIPTION:  This function tries to merge the downcast information (*.cnv) files from the Seabird
0017 %  and the *.oxy files from the AOML titration system
0018 %  and create a summary file containing coincident measurements from both
0019 %  systems.  The data for a whole cruise is processed at once so if you want
0020 %  less data you'll have to subset afterwards.
0021 %
0022 % BUGS:  1. Not really a bug but it's based on the AOML *.oxy files.  These files
0023 %  can vary slightly in terms of what each field means, based on operator preference.
0024 %  The results of read_oxy contain a field called depth which is usu. either
0025 %  the niskin bottle position on the rosette or the firing order.  Position is
0026 %  preferrable if you think about it at the beginning of the cruise.
0027 %
0028 %
0029 % AUTHORS:Carlos Fonseca
0030 %         UM/CIMAS
0031 %         Derrick Snowden
0032 %         NOAA/AOML/PhOD
0033 %         Tue May 11 11:23:37 EDT 2004
0034 % CHANGELOG:
0035 %   23-Jul-2004, Version 1.0
0036 %        * Initial version.
0037 %
0038 % DEPENDENCIES: SW package.
0039 %               load_oxy
0040 %               load_btl
0041 %               load_bl
0042 %               load_cnv
0043 %
0044 %
0045 flag_message1=0;
0046 flag_message2=0;
0047 flag_conv1=0;
0048 flag_conv2=0;
0049 %
0050 % Retrieve the necessary preferences for this cruise
0051 group = group_name(cruiseid);
0052 
0053 % cruise_dir is the main calibration data directory
0054 if ispref(group,'cal_data_dir')
0055     cruise_dir=getpref(group,'cal_data_dir');
0056 else
0057     error(['The cal_data_dir preference was not set for cruise: ' cruiseid '.  Run register_cruise.m']);
0058 end
0059 
0060 % Load data from the cruise database
0061 db_file = fullfile(cruise_dir,[cruiseid '_db.mat']);
0062 if exist(db_file)==2
0063     load(db_file);
0064 else
0065     error(['The cruise data base file was not found on the path.  ' db_file]);
0066 end
0067 
0068 % Check for the necessary variables in the cruise database.
0069 n=who('btl');
0070 if isempty(n)==1
0071     error(['btl variable not found in the cruise database. Run load_btl.m ']);
0072     return;
0073 end
0074 n=who('bl');
0075 if isempty(n)==1
0076     error(['bl variable not found in the cruise database. Run load_bl.m ']);
0077     return;
0078 end
0079 n=who('cnv');
0080 if isempty(n)==1
0081     error(['cnv variable not found in the cruise database. Run load_cnv.m ']);
0082     return;
0083 end
0084 n=who('oxy');
0085 if isempty(n)==1
0086     error(['oxy variable not found in the cruise database. Run load_oxy.m ']);
0087     return;
0088 end
0089 oxy_cal=oxy_struct;
0090 oxy_cal.cruiseid=cruiseid;
0091 %information from .oxy files
0092     stations= unique(vertcat(oxy.station));
0093     oxy_cal.stnnbr=vertcat(oxy.station);
0094     oxy_cal.castnbr=vertcat(oxy.station);
0095     oxy_cal.sampnbr=vertcat(oxy.sample_bottle);
0096     oxy_cal.btlnbr=vertcat(oxy.depth);
0097     oxy_cal.niskinbtlpos=vertcat(oxy.depth);    
0098 % extracting the fire order from the .bl file
0099     for i=1:1:length(oxy_cal.btlnbr)
0100      i ; 
0101      oxy_cal.stnnbr(i);
0102      if (oxy_cal.stnnbr(i)==0)
0103      oxy_cal.fireorder(i,1)=NaN;
0104      else
0105      fire_index=find(bl(oxy_cal.stnnbr(i)).niskinnumber==oxy_cal.btlnbr(i));   
0106      oxy_cal.fireorder(i,1)=bl(oxy_cal.stnnbr(i)).fireorder(fire_index);
0107      end
0108     end
0109  % converting the oxygen values to ml/l
0110     oxy_cal.btloxy=vertcat(oxy.oxygen)*0.02239;  
0111   
0112  % keeping only the valid data
0113     jj_nan=find(isnan(oxy_cal.fireorder)==0);
0114     oxy_cal.fireorder=oxy_cal.fireorder(jj_nan);
0115     oxy_cal.stnnbr=oxy_cal.stnnbr(jj_nan);
0116     oxy_cal.castnbr=oxy_cal.castnbr(jj_nan);
0117     oxy_cal.sampnbr=oxy_cal.sampnbr(jj_nan);
0118     oxy_cal.btlnbr=oxy_cal.btlnbr(jj_nan);
0119     oxy_cal.niskinbtlpos=oxy_cal.niskinbtlpos(jj_nan);
0120     oxy_cal.btloxy=oxy_cal.btloxy(jj_nan);
0121   %
0122 % information from .btl files
0123  disp('**************************************');
0124  disp('Extracting information from .btl files');
0125  disp('**************************************');
0126    for i=1:length(oxy_cal.btloxy)
0127       sta_idx=oxy_cal.stnnbr(i);
0128       fire_idx=oxy_cal.fireorder(i);
0129       % extracting the indexes for the .btl files;
0130       for j=1:length(btl(sta_idx).names);
0131        if strncmp(btl(sta_idx).names(j),'pressure',8);
0132        pr_idx=j;
0133        end
0134        if strncmp(btl(sta_idx).names(j),'con_pri',7);
0135        ctd_c1_idx=j;
0136        end
0137        if strncmp(btl(sta_idx).names(j),'con_sec',7);
0138        ctd_c2_idx=j;
0139        end
0140        if strncmp(btl(sta_idx).names(j),'sbedo2_mll_pri',14);
0141        ctd_oxy1_idx=j;
0142        end
0143        if strncmp(btl(sta_idx).names(j),'sbedo2_mll_sec',14);
0144        ctd_oxy2_idx=j;
0145        end
0146        if strncmp(btl(sta_idx).names(j),'sbeox_volt_pri',14);
0147        ctd_oxv1_idx=j;
0148        end
0149        if strncmp(btl(sta_idx).names(j),'sbeox_volt_sec',14);
0150        ctd_oxv2_idx=j;
0151        end
0152        if strncmp(btl(sta_idx).names(j),'sbeox_dOCdt_pri',15);
0153        ctd_dvdt1_idx=j;
0154        end
0155        if strncmp(btl(sta_idx).names(j),'sbeox_dOCdt_sec',15);
0156        ctd_dvdt2_idx=j;
0157        end
0158        if strncmp(btl(sta_idx).names(j),'t68_pri',7);
0159        ctd_t1_idx=j;
0160        end
0161        if strncmp(btl(sta_idx).names(j),'t68_sec',7);
0162        ctd_t2_idx=j;
0163        end
0164        if strncmp(btl(sta_idx).names(j),'t90_pri',7);
0165        ctd_t1_idx=j;
0166        flag_conv1=1;
0167         if flag_message1==0
0168         disp('Primary temperatures are given in T90.')
0169         disp('This program will convert to T68 to make the necessary calculations')
0170         flag_message1=1;
0171         end
0172        end
0173        if strncmp(btl(sta_idx).names(j),'t90_sec',7);
0174        ctd_t2_idx=j;
0175        flag_conv2=1;
0176         if flag_message2==0
0177         disp('Secondary temperatures are given in T90.')
0178         disp('This program will convert to T68 to make the necessary calculations')
0179         flag_message2=1;
0180         end  
0181        end
0182       end
0183       oxy_cal.ctdupprs(i,1)=btl(sta_idx).data(fire_idx,pr_idx);
0184       oxy_cal.ctdupcon1(i,1)=10*btl(sta_idx).data(fire_idx,ctd_c1_idx);
0185       oxy_cal.ctdupcon2(i,1)=10*btl(sta_idx).data(fire_idx,ctd_c2_idx);
0186       oxy_cal.ctdupoxy1(i,1)=btl(sta_idx).data(fire_idx,ctd_oxy1_idx);
0187       oxy_cal.ctdupoxy2(i,1)=btl(sta_idx).data(fire_idx,ctd_oxy2_idx);
0188       oxy_cal.ctdupoxv1(i,1)=btl(sta_idx).data(fire_idx,ctd_oxv1_idx);
0189       oxy_cal.ctdupoxv2(i,1)=btl(sta_idx).data(fire_idx,ctd_oxv2_idx);
0190 %      oxy_cal.ctddvdt1(i,1)=btl(sta_idx).data(fire_idx,ctd_dvdt1_idx);
0191 %      oxy_cal.ctddvdt2(i,1)=btl(sta_idx).data(fire_idx,ctd_dvdt2_idx);
0192       % getting the dcdp values
0193  %     dcdp_idx=find(cond_cal.stnnbr==sta_idx & cond_cal.fireorder==fire_idx);
0194  %       if length(dcdp_idx)>1
0195  %         dcdp_idx=dcdp_idx(1);
0196  %       end
0197  %     if isempty(dcdp_idx)
0198  %     oxy_cal.dcdp1(i,1)=oxy_cal.dcdp1(i-1,1);
0199  %     oxy_cal.dcdp2(i,1)=oxy_cal.dcdp2(i-1,1);
0200  %else
0201 %      oxy_cal.dcdp1(i,1)=cond_cal.dcdp1(dcdp_idx);
0202 %      oxy_cal.dcdp2(i,1)=cond_cal.dcdp2(dcdp_idx);
0203 %     end
0204       
0205       %
0206       oxy_cal.ctduptmp1(i,1)=btl(sta_idx).data(fire_idx,ctd_t1_idx);
0207       if flag_conv1==1;
0208       oxy_cal.ctduptmp1(i,1)=t90tot68(oxy_cal.ctduptmp1(i,1));   
0209       end
0210       oxy_cal.ctduptmp2(i,1)=btl(sta_idx).data(fire_idx,ctd_t2_idx);
0211       if flag_conv2==1;
0212       oxy_cal.ctduptmp2(i,1)=t90tot68(oxy_cal.ctduptmp2(i,1));   
0213       end 
0214     end
0215   
0216      %calculating the salinity and the potential density
0217      oxy_cal.ctdupsal1=sw_salt(oxy_cal.ctdupcon1/sw_c3515,oxy_cal.ctduptmp1,oxy_cal.ctdupprs);
0218      oxy_cal.ctdupsigflu1=sw_pden(oxy_cal.ctdupsal1,oxy_cal.ctduptmp1,oxy_cal.ctdupprs,oxy_cal.ctdupprs)-1000;
0219       oxy_cal.ctdupsal2=sw_salt(oxy_cal.ctdupcon2/sw_c3515,oxy_cal.ctduptmp2,oxy_cal.ctdupprs);
0220      oxy_cal.ctdupsigflu2=sw_pden(oxy_cal.ctdupsal2,oxy_cal.ctduptmp2,oxy_cal.ctdupprs,oxy_cal.ctdupprs)-1000;   
0221      %end
0222     
0223   % Interpolating using the cnv files
0224   flag_message1=0;
0225   flag_message2=0;
0226   flag_conv1=0;
0227   flag_conv2=0;
0228  disp('**************************************');
0229  disp('Extracting information from .cnv files');
0230  disp('**************************************');
0231  for i=1:length(oxy_cal.stnnbr);
0232     sta_idx=oxy_cal.stnnbr(i);
0233     press_idx=round(oxy_cal.ctdupprs(i));
0234     
0235    for j=1:length(cnv(sta_idx).names);
0236    if strncmp(cnv(sta_idx).names(j),'timeS',5);
0237    time_idx=j;  
0238    elseif strncmp(cnv(sta_idx).names(j),'prDM',4);
0239    pr_idx=j;
0240    elseif strncmp(cnv(sta_idx).names(j),'sbeox0V',7);
0241    oxv1_idx=j;
0242    elseif strncmp(cnv(sta_idx).names(j),'sbeox0ML/L',10);
0243    ctd_o2_idx=j;
0244    elseif strncmp(cnv(sta_idx).names(j),'sbeox1V',7);
0245    oxv2_idx=j;
0246    elseif strncmp(cnv(sta_idx).names(j),'sbeox1ML/L',10);
0247    ctd_o2_2_idx=j;
0248    elseif strncmp(cnv(sta_idx).names(j),'c0S/m',5);
0249    cond1_idx=j;
0250    elseif strncmp(cnv(sta_idx).names(j),'c1S/m',5);
0251    cond2_idx=j;
0252    elseif strncmp(cnv(sta_idx).names(j),'t068C',5);
0253    temp1_idx=j;
0254    elseif strncmp(cnv(sta_idx).names(j),'t090C',5);
0255        temp1_idx=j;
0256        flag_conv1=1;
0257        if flag_message1==0
0258        disp('Primary temperatures are given in T90.')
0259        disp('This program will convert to T68 to make the necessary calculations')
0260        flag_message1=1;
0261        end
0262    
0263    elseif strncmp(cnv(sta_idx).names(j),'t168C',5);
0264    temp2_idx=j;
0265    elseif strncmp(cnv(sta_idx).names(j),'t190C',5);
0266        temp2_idx=j;
0267        flag_conv2=1;
0268        if flag_message2==0
0269        disp('Primary temperatures are given in T90.')
0270        disp('This program will convert to T68 to make the necessary calculations')
0271        flag_message2=1;
0272        end
0273    end
0274    end
0275    
0276    max_pressure_idx=find(cnv(sta_idx).data(:,pr_idx)==max(cnv(sta_idx).data(:,pr_idx)));
0277    lim_idx=find(cnv(sta_idx).data(1:max_pressure_idx,pr_idx)==press_idx);
0278   
0279       if (isempty(lim_idx)==1);   
0280         time_aux=cnv(sta_idx).data(1:30,time_idx);
0281         press_aux=cnv(sta_idx).data(1:30,pr_idx);
0282         oxyvolt_aux=cnv(sta_idx).data(1:30,oxv1_idx);
0283         oxyvolt2_aux=cnv(sta_idx).data(1:30,oxv2_idx);
0284         cond1_aux=10*cnv(sta_idx).data(1:30,cond1_idx);
0285         oxy_aux=cnv(sta_idx).data(1:30,ctd_o2_idx);
0286         oxy2_aux=cnv(sta_idx).data(1:30,ctd_o2_2_idx);
0287         temp1_aux=cnv(sta_idx).data(1:30,temp1_idx);
0288         cond2_aux=10*cnv(sta_idx).data(1:30,cond2_idx);
0289         temp2_aux=cnv(sta_idx).data(1:30,temp2_idx);
0290       elseif (lim_idx+30 > max_pressure_idx);
0291         time_aux=cnv(sta_idx).data(lim_idx-30:max_pressure_idx,time_idx); 
0292         press_aux=cnv(sta_idx).data(lim_idx-30:max_pressure_idx,pr_idx);
0293         oxyvolt_aux=cnv(sta_idx).data(lim_idx-30:max_pressure_idx,oxv1_idx);
0294         oxy_aux=cnv(sta_idx).data(lim_idx-30:max_pressure_idx,ctd_o2_idx);
0295         oxyvolt2_aux=cnv(sta_idx).data(lim_idx-30:max_pressure_idx,oxv2_idx);
0296         oxy2_aux=cnv(sta_idx).data(lim_idx-30:max_pressure_idx,ctd_o2_2_idx);
0297         cond1_aux=10*cnv(sta_idx).data(lim_idx-30:max_pressure_idx,cond1_idx);
0298         temp1_aux=cnv(sta_idx).data(lim_idx-30:max_pressure_idx,temp1_idx);
0299         cond2_aux=10*cnv(sta_idx).data(lim_idx-30:max_pressure_idx,cond2_idx);
0300         temp2_aux=cnv(sta_idx).data(lim_idx-30:max_pressure_idx,temp2_idx);
0301       elseif (lim_idx-30 <0);
0302         time_aux=cnv(sta_idx).data(1:lim_idx+30,time_idx);
0303         press_aux=cnv(sta_idx).data(1:lim_idx+30,pr_idx);
0304         oxyvolt_aux=cnv(sta_idx).data(1:lim_idx+30,oxv1_idx);
0305         oxy_aux=cnv(sta_idx).data(1:lim_idx+30,ctd_o2_idx);
0306         oxyvolt2_aux=cnv(sta_idx).data(1:lim_idx+30,oxv2_idx);
0307         oxy2_aux=cnv(sta_idx).data(1:lim_idx+30,ctd_o2_2_idx);
0308         cond1_aux=10*cnv(sta_idx).data(1:lim_idx+30,cond1_idx);
0309         temp1_aux=cnv(sta_idx).data(1:lim_idx+30,temp1_idx);
0310         cond2_aux=10*cnv(sta_idx).data(1:lim_idx+30,cond2_idx);
0311         temp2_aux=cnv(sta_idx).data(1:lim_idx+30,temp2_idx);
0312       else
0313         time_aux=cnv(sta_idx).data(lim_idx-30:lim_idx+30,time_idx); 
0314         press_aux=cnv(sta_idx).data(lim_idx-30:lim_idx+30,pr_idx);
0315         oxyvolt_aux=cnv(sta_idx).data(lim_idx-30:lim_idx+30,oxv1_idx);
0316         oxy_aux=cnv(sta_idx).data(lim_idx-30:lim_idx+30,ctd_o2_idx);
0317         oxyvolt2_aux=cnv(sta_idx).data(lim_idx-30:lim_idx+30,oxv2_idx);
0318         oxy2_aux=cnv(sta_idx).data(lim_idx-30:lim_idx+30,ctd_o2_2_idx);
0319         cond1_aux=10*cnv(sta_idx).data(lim_idx-30:lim_idx+30,cond1_idx);
0320         temp1_aux=cnv(sta_idx).data(lim_idx-30:lim_idx+30,temp1_idx);
0321         cond2_aux=10*cnv(sta_idx).data(lim_idx-30:lim_idx+30,cond2_idx);
0322         temp2_aux=cnv(sta_idx).data(lim_idx-30:lim_idx+30,temp2_idx);
0323       end
0324 %%%%%%%%%%
0325       if flag_conv1==1;
0326       temp1_aux=t90tot68(temp1_aux);   
0327       end
0328       if flag_conv2==1;
0329       temp2_aux=t90tot68(temp2_aux);    
0330       end 
0331 %%%%%%%%%%
0332         sal_aux1=sw_salt(cond1_aux/sw_c3515,temp1_aux,press_aux); 
0333         sal_aux2=sw_salt(cond2_aux/sw_c3515,temp2_aux,press_aux); 
0334 %%%%%%%%%%
0335         sig_flu_aux1=sw_pden(sal_aux1,temp1_aux,press_aux,press_aux)-1000;
0336         sig_flu_aux2=sw_pden(sal_aux2,temp2_aux,press_aux,press_aux)-1000;
0337         
0338     new_volt(i)=interp1(sig_flu_aux1,oxyvolt_aux,oxy_cal.ctdupsigflu1(i),'spline',NaN);
0339     new_volt2(i)=interp1(sig_flu_aux2,oxyvolt2_aux,oxy_cal.ctdupsigflu2(i),'spline',NaN);
0340     new_press(i)=interp1(sig_flu_aux1,press_aux,oxy_cal.ctdupsigflu1(i),'spline',NaN);
0341     new_cond(i)=interp1(sig_flu_aux1,cond1_aux,oxy_cal.ctdupsigflu1(i),'spline',NaN);
0342     new_cond2(i)=interp1(sig_flu_aux2,cond2_aux,oxy_cal.ctdupsigflu2(i),'spline',NaN);
0343     new_temp(i)=interp1(sig_flu_aux1,temp1_aux,oxy_cal.ctdupsigflu1(i),'spline',NaN);
0344     new_temp2(i)=interp1(sig_flu_aux2,temp2_aux,oxy_cal.ctdupsigflu2(i),'spline',NaN);
0345     new_oxy(i)=interp1(sig_flu_aux1,oxy_aux,oxy_cal.ctdupsigflu1(i),'spline',NaN);
0346     new_oxy2(i)=interp1(sig_flu_aux2,oxy2_aux,oxy_cal.ctdupsigflu2(i),'spline',NaN);
0347 end
0348  disp('**************************************************');
0349  disp('Interpolating upcast info on downcast using sigma ')
0350  disp('**************************************************');
0351  oxy_cal.ctddooxy1=new_oxy';
0352  oxy_cal.ctddooxy2=new_oxy2';
0353  oxy_cal.ctddooxv1=new_volt';
0354  oxy_cal.ctddooxv2=new_volt2';
0355  oxy_cal.ctddotmp1=new_temp';
0356  oxy_cal.ctddotmp2=new_temp2';
0357  oxy_cal.ctddocon1=new_cond';
0358  oxy_cal.ctddocon2=new_cond2';
0359  oxy_cal.ctddoprs=new_press';
0360  
0361  %using the surface values of the upcast
0362 % primary sensor
0363 aux=find(isnan(oxy_cal.ctddooxy1)==1);
0364 oxy_cal.ctddooxy1(aux)=oxy_cal.ctdupoxy1(aux);
0365 oxy_cal.ctddooxv1(aux)=oxy_cal.ctdupoxv1(aux);
0366 oxy_cal.ctddotmp1(aux)=oxy_cal.ctduptmp1(aux);
0367 oxy_cal.ctddocon1(aux)=oxy_cal.ctdupcon1(aux);
0368 oxy_cal.ctddoprs(aux)=oxy_cal.ctdupprs(aux);
0369 aux=find(oxy_cal.ctddoprs<10);
0370 oxy_cal.ctddooxy1(aux)=oxy_cal.ctdupoxy1(aux);
0371 oxy_cal.ctddooxv1(aux)=oxy_cal.ctdupoxv1(aux);
0372 oxy_cal.ctddotmp1(aux)=oxy_cal.ctduptmp1(aux);
0373 oxy_cal.ctddocon1(aux)=oxy_cal.ctdupcon1(aux);
0374 oxy_cal.ctddoprs(aux)=oxy_cal.ctdupprs(aux);
0375 % secondary Sensor
0376 aux=find(isnan(oxy_cal.ctddooxy2)==1);
0377 oxy_cal.ctddooxy2(aux)=oxy_cal.ctdupoxy2(aux);
0378 oxy_cal.ctddooxv2(aux)=oxy_cal.ctdupoxv2(aux);
0379 oxy_cal.ctddotmp2(aux)=oxy_cal.ctduptmp2(aux);
0380 oxy_cal.ctddocon2(aux)=oxy_cal.ctdupcon2(aux);
0381 aux=find(oxy_cal.ctddoprs<10);
0382 oxy_cal.ctddooxy2(aux)=oxy_cal.ctdupoxy2(aux);
0383 oxy_cal.ctddooxv2(aux)=oxy_cal.ctdupoxv2(aux);
0384 oxy_cal.ctddotmp2(aux)=oxy_cal.ctduptmp2(aux);
0385 oxy_cal.ctddocon2(aux)=oxy_cal.ctdupcon2(aux);
0386 disp('*************************************************');
0387 disp('Matching interpolated information with .oxy files')
0388 disp('*************************************************');
0389 % updating the fields for save
0390 oxy_cal.ctdprs=oxy_cal.ctddoprs;
0391 oxy_cal.ctdtmp1=oxy_cal.ctddotmp1;
0392 oxy_cal.ctdtmp2=oxy_cal.ctddotmp2;
0393 oxy_cal.ctdcon1=oxy_cal.ctddocon1;
0394 oxy_cal.ctdcon2=oxy_cal.ctddocon2;
0395 oxy_cal.ctdoxv1=oxy_cal.ctddooxv1;
0396 oxy_cal.ctdoxv2=oxy_cal.ctddooxv2;
0397 oxy_cal.ctdoxy1=oxy_cal.ctddooxy1;
0398 oxy_cal.ctdoxy2=oxy_cal.ctddooxy2;  
0399 oxy_cal.ctdsal1=sw_salt(oxy_cal.ctdcon1/sw_c3515,oxy_cal.ctdtmp1,oxy_cal.ctdprs);
0400 oxy_cal.ctdsal2=sw_salt(oxy_cal.ctdcon2/sw_c3515,oxy_cal.ctdtmp2,oxy_cal.ctdprs);
0401 % Save the oxygen summary structure.
0402 save(db_file,'oxy_cal','-append');
0403 
0404 if nargout==0
0405     assignin('caller','ans',oxy_cal);
0406     return
0407 else
0408     varargout{1}=oxy_cal;
0409     return
0410 end
0411  return
0412       
0413       
0414       
0415       
0416       
0417 
0418      
0419      
0420      
0421      
0422

Generated on Fri 08-Oct-2004 11:57:17 by m2html © 2003