0001 function bt_plt1(botfile,sumfile,stations);
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 disp(['Loading WHP sum file ',sumfile])
0017 [lat,lon,station,time] = whp_sum(sumfile);
0018
0019 disp(['Loading WHP bottle file ',botfile])
0020 [bot,props,units] = whp_bot(botfile,2);
0021
0022
0023 js = findstrline(props,'STNNBR');
0024 if nargin > 2
0025
0026 ok = 0*station;
0027 for i = 1:length(station)
0028 if any(station(i) == stations)
0029 ok(i) = 1;
0030 end
0031 end
0032 lat = lat(ok); lon = lon(ok); station = station(ok); time = time(ok);
0033 ok = 0*bot(:,1);
0034 for i = 1:length(stations)
0035 if any(bot(:,js) == stations(i));
0036 ok(bot(:,js) == stations(i)) = ok(bot(:,js) == stations(i))+1;
0037 end
0038 end
0039 bot = bot(ok,:);
0040 else
0041 stations=sort(bot(:,js));stations(find(diff(stations)==0))=[];
0042
0043 end
0044
0045 bad = bot == -9;
0046 bot(bad) = nan*(bot(bad));
0047 disp(['Merging in station info....'])
0048 props = str2mat(props,'LONGIT','LATITU');
0049 units = str2mat(units,' ',' ');
0050 ncol = size(bot,2);
0051 for i = 1:length(stations)
0052 if any(bot(:,js) == stations(i));
0053 nmat = sum(bot(:,js) == stations(i));
0054 bot(bot(:,js) == stations(i),ncol+1) = lon(i)*ones(nmat,1);
0055 bot(bot(:,js) == stations(i),ncol+2) = lat(i)*ones(nmat,1);
0056 end
0057 end
0058
0059 disp(['Calculating derived variables....'])
0060
0061
0062 jsalt = findstrline(props,'SALNTY');
0063 jtemp = findstrline(props,'CTDTMP');
0064 jpres = findstrline(props,'CTDPRS');
0065
0066 ncol = size(bot,2);
0067 props = str2mat(props,'SIGMA0');
0068 units = str2mat(units,' KG/M^3');
0069 bot(:,ncol+1) = sw_pden(bot(:,jsalt),bot(:,jtemp),bot(:,jpres),0);
0070
0071
0072
0073
0074
0075
0076
0077 bot_gui(bot,props,units)
0078