% Voulgaris check function voulgarischeck(settings) [nparts, nADVs] = size(settings.statfiles); nlegs = length(settings.legpos); for ipart = 1:nparts, % load data %ncs = cell(nADVs,nparts); for iADV = 1:nADVs, ncs(iADV).fname = settings.statfiles{ipart,iADV}; ncs(iADV).nc = netcdf(ncs(iADV).fname); ncs(iADV).cs = ncs(iADV).nc{'CS_300'}(:); ncs(iADV).cd = ncs(iADV).nc{'CD_310'}(:); ncs(iADV).ptch = ncs(iADV).nc{'Ptch_1216'}(:); ncs(iADV).roll = ncs(iADV).nc{'Roll_1217'}(:); for ileg = 1:nlegs, % leg is x = settings.posADV{iADV}(1)-settings.legpos{ileg}(1); y = settings.posADV{iADV}(2)-settings.legpos{ileg}(2); [r, az] = pcoord(x,y); if az>360, az = az-360; end if az<0, az = 360+az; end ncs(iADV).legaz(ileg) = az; ncs(iADV).legr(ileg) = r; end end mooring = settings.mooring; figure('position',[66 502 854 420]) subplot(4,1,[1 2 3]) ratio = ncs(1).cs./ncs(2).cs; plot(ncs(1).cd, ratio,'.') hold on set(gca,'xlim',[0 360]) yl = get(gca,'ylim'); ylabel(sprintf('Velocity Ratio %s/%s',settings.ADVcolor{1},settings.ADVcolor{2})) L{1} = 'ADV ratio'; il = 2; for ileg = 1:nlegs, plot([ncs(1).legaz(ileg) ncs(1).legaz(ileg)],yl,... [settings.legname{ileg}(1) '-']) L{il} = sprintf('%s leg to %s = %5.2f deg.',... settings.legname{ileg}, settings.ADVcolor{1}, ncs(1).legaz(ileg)); plot([ncs(2).legaz(ileg) ncs(2).legaz(ileg)],yl,... [settings.legname{ileg}(1) '--']) L{il+1} = sprintf('%s leg to %s = %5.2f deg.',... settings.legname{ileg}, settings.ADVcolor{2}, ncs(2).legaz(ileg)); il = il+2; end %title(sprintf('%s %s & %s',ncs(1).nc.PROJECT(:),ncs(1).fname,ncs(2).fname)) title(sprintf('%s %s & %s',settings.project,ncs(1).fname,ncs(2).fname)) legend(L,'location','BestOutside') pos1 = get(gca,'position'); clear L il = 1; subplot(4,1,4) for iADV = 1:nADVs; plot(ncs(iADV).cd, ncs(iADV).ptch,[settings.ADVcolor{iADV}(1) '.']) L{il} = [settings.ADVcolor{1} ' pitch']; hold on plot(ncs(iADV).cd, ncs(iADV).roll,[settings.ADVcolor{iADV}(1) '+']) L{il+1} = [settings.ADVcolor{1} ' roll']; il=il+2; end set(gca,'xlim',[0 360]) xlabel('Velocity Direction, degrees') ylabel('Deg.') pos2 = get(gca,'position'); pos2(3) = pos1(3); legend(L,'location','BestOutside') set(gca,'position',pos2) eval(sprintf('print -djpeg %sVoulgaris%s.jpg',mooring,settings.parts{ipart})) for iADV = 1:nADVs, close(ncs(iADV).nc); end end