Index: DPWavesProc/trunk/DPWavesProc/adcp_matlab/radialtouvw.m =================================================================== --- DPWavesProc/trunk/DPWavesProc/adcp_matlab/radialtouvw.m (revision 215) +++ DPWavesProc/trunk/DPWavesProc/adcp_matlab/radialtouvw.m (revision 217) @@ -22,5 +22,5 @@ %whats the magnetic variation -magvar=9.63; +magvar=-10; %set up sysinfo file Index: DPWavesProc/trunk/DPWavesProc/adcp_matlab/specmultiplot.m =================================================================== --- DPWavesProc/trunk/DPWavesProc/adcp_matlab/specmultiplot.m (revision 215) +++ DPWavesProc/trunk/DPWavesProc/adcp_matlab/specmultiplot.m (revision 217) @@ -1,3 +1,3 @@ -function [Winfo]=specmultiplot(dateinfo1,dateinfo2,timestep); +function [Winfo,spec2d,fd,thetad,td]=specmultiplot(dateinfo1,dateinfo2,timestep); %where dateinfo1 and 2 are the strings of the first and last date extension %of the pressure,range,etc files and timestep is the time in hours between @@ -28,10 +28,12 @@ end - +%Make a directory for the data +mkdir('tempdir'); + %set up time, which is Winfo.time as date str in the yymmddHHMM format time=datestr(Winfo.time, 'yymmddHHMM'); %set up data structure for wave info -Winfo.setup={'EMEP UVW','IMLM UVW','EMEP range','IMLM range','EMEP radial','IMLM radial','wavesmon'}'; +Winfo.setup={'EMEP radial'}; Winfo.hsig=[]; Winfo.hconf=[]; @@ -39,11 +41,5 @@ Winfo.dirP=[]; Winfo.Ddir=[]; -Winfo.Spectrum.EMEPuvw=[]; -Winfo.Spectrum.IMLMuvw=[]; -Winfo.Spectrum.EMEPrange=[]; -Winfo.Spectrum.IMLMrange=[]; Winfo.Spectrum.EMEPradial=[]; -Winfo.Spectrum.IMLMradial=[]; -Winfo.Spectrum.wavesmon=[]; %Load the data and run the script @@ -55,5 +51,5 @@ orbit=strcat('orbit_',dateinfo,'.txt'); sysinfo=strcat('sysinfo_',dateinfo,'.txt'); - spec=strcat('DSpec',dateinfo,'.txt'); + pressure=load(pressure); @@ -61,27 +57,5 @@ orbit=load(orbit); sysinfo=load(sysinfo); - spec=load(spec); - - %set up data with uvw and pressure, freq at 0.01 and dir at 2 - [ID,SM,EP]=radialtouvw(pressure,range,orbit,sysinfo,1); - - %run diwasp to generate this spectrum - [E_uvw_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); - - %now for IMLM - EP.method='IMLM'; - EP.iter=3; - [I_uvw_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); - - %set up data with ranges, freq and dir at default - [ID,SM,EP]=radialtouvw(pressure,range,orbit,sysinfo,2); - - % run diwasp to generate this spectrum with EMEP - [E_range_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); - - %now with IMLM - EP.method='IMLM'; - EP.iter=3; - [I_range_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); + %set up data with radial velocities, freq and dir at default @@ -89,35 +63,25 @@ % run diwasp to generate this spectrum with EMEP - [E_radial_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); - - %now with IMLM - EP.method='IMLM'; - EP.iter=3; - [I_radial_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); + [radialE, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); %Use waveplot to plot the polar, freq and dir plots of the spectra - [E_UVW_WI,I_UVW_WI,E_range_WI,I_range_WI,wmon_WI,fig1,fig2]=waveplot(E_uvw_F01_D2,I_uvw_F01_D2,E_range_F01_D2,I_range_F01_D2,spec,sysinfo); + [E_radial_WI,fig1,fig2]=waveplottest1(radialE,sysinfo); saveas(fig1,['polar1_' dateinfo '.fig']); saveas(fig2,['dirfreq1_' dateinfo '.fig']); - - [E_radial_WI,I_radial_WI,fig5,fig6]=radialwaveplot(E_radial_F01_D2,I_radial_F01_D2,spec,sysinfo); - - saveas(fig5,['polar3_' dateinfo '.fig']); - saveas(fig6,['dirfreq3_' dateinfo '.fig']); + movefile(['polar1_' dateinfo '.fig'],'tempdir'); + movefile(['dirfreq1_' dateinfo '.fig'],'tempdir'); close all; - %Make sure wavesmon spectrum is formatted right before outputting, change to m^2/Hz/deg - wmon.S=spec/(360*1000*1000); %Fill up the Winfo data structure - hsig=[vertcat(E_UVW_WI.hsig,I_UVW_WI.hsig,E_range_WI.hsig,I_range_WI.hsig,E_radial_WI.hsig,I_radial_WI.hsig,wmon_WI.hsig)]; - hconf=[vertcat(E_UVW_WI.hconf,I_UVW_WI.hconf,E_range_WI.hconf,I_range_WI.hconf,E_radial_WI.hconf,I_radial_WI.hconf,[NaN NaN])]; - peakP=[vertcat(E_UVW_WI.tp,I_UVW_WI.tp,E_range_WI.tp,I_range_WI.tp,E_radial_WI.tp,I_radial_WI.tp,wmon_WI.tp)]; - dirP=[vertcat(E_UVW_WI.dtp,I_UVW_WI.dtp,E_range_WI.dtp,I_range_WI.dtp,E_radial_WI.dtp,I_radial_WI.dtp,wmon_WI.dtp)]; - Ddir=[vertcat(E_UVW_WI.dp,I_UVW_WI.dp,E_range_WI.dp,I_range_WI.dp,E_radial_WI.dp,I_radial_WI.dp,wmon_WI.dp)]; + hsig=[vertcat(E_radial_WI.hsig)]; + hconf=[vertcat(E_radial_WI.hconf)]; + peakP=[vertcat(E_radial_WI.tp)]; + dirP=[vertcat(E_radial_WI.dtp)]; + Ddir=[vertcat(E_radial_WI.dp)]; @@ -127,16 +91,53 @@ Winfo.dirP=[horzcat(Winfo.dirP,dirP)]; Winfo.Ddir=[horzcat(Winfo.Ddir,Ddir)]; - Winfo.Spectrum.EMEPuvw=[cat(3,Winfo.Spectrum.EMEPuvw,E_uvw_F01_D2.S)]; - Winfo.Spectrum.IMLMuvw=[cat(3,Winfo.Spectrum.IMLMuvw,I_uvw_F01_D2.S)]; - Winfo.Spectrum.EMEPrange=[cat(3,Winfo.Spectrum.EMEPrange,E_range_F01_D2.S)]; - Winfo.Spectrum.IMLMrange=[cat(3,Winfo.Spectrum.IMLMrange,I_range_F01_D2.S)]; - Winfo.Spectrum.EMEPradial=[cat(3,Winfo.Spectrum.EMEPradial,E_radial_F01_D2.S)]; - Winfo.Spectrum.IMLMradial=[cat(3,Winfo.Spectrum.IMLMradial,I_radial_F01_D2.S)]; - Winfo.Spectrum.wavesmon=[cat(3,Winfo.Spectrum.wavesmon,wmon.S)]; - + Winfo.Spectrum.EMEPradial=[cat(3,Winfo.Spectrum.EMEPradial,radialE.S)]; end +Winfo.Spectrum.EMEPradial=permute(Winfo.Spectrum.EMEPradial,[3,1,2]); + +spec2d=Winfo.Spectrum.EMEPradial; +spec2d=spec2d(:,:,1:180); +spec2d=spec2d*(360/(2*pi)); + +%this changes the coordinates from axis to compass +newspec2d=zeros(size(spec2d)); +for i= 1:size(spec2d,1) + oldspec=squeeze(spec2d(i,:,:)); + + newspec=zeros(size(oldspec)); + + for j = 1:46 + newspec(:,j)=oldspec(:,47-j); + end + for j = 47:180 + newspec(:,j)=oldspec(:,181-(j-46)); + end + + %firstspec=newspec(:,91:180); + %secondspec=newspec(:,1:90); + %newspec=cat(2,firstspec,secondspec); + + newspec2d(i,:,:)=newspec; +end + +Winfo.Spectrum.EMEPradial=newspec2d; + +%************************************************************************* +%these following variables can be output if you wish to continue to process the data through +%the XWAVES software. + +spec2d=newspec2d; +fd=[0.01:0.01:0.4]; +thetad=[0:2:358]; +date1=datevec(Winfo.time); +td=date1(:,1:5); + +save(['specdata_' dateinfo],'Winfo','spec2d','fd','thetad','td'); +movefile(['specdata_' dateinfo '.mat'],'tempdir'); + +%************************************************************************** + %now create the time series plots of the wave info -[fig_sigh,fig_pp,fig_dp,fig_dd]=Winfo_plot(Winfo); +[fig_sigh,fig_pp,fig_dp,fig_dd]=Winfo_plot1(Winfo); saveas(fig_sigh,['sigh_' dateinfo '.fig']); @@ -145,4 +146,11 @@ saveas(fig_dd,['domdir_' dateinfo '.fig']); +movefile(['sigh_' dateinfo '.fig'],'tempdir'); +movefile(['peakp_' dateinfo '.fig'],'tempdir'); +movefile(['dirpeak_' dateinfo '.fig'],'tempdir'); +movefile(['domdir_' dateinfo '.fig'],'tempdir'); + +movefile('tempdir',strcat('procdata_',dateinfo)); + close all; Index: DPWavesProc/trunk/DPWavesProc/nortek/nortek_radialtouvw.m =================================================================== --- adcp/trunk/adcp/nortek/nortek_radialtouvw.m (revision 168) +++ DPWavesProc/trunk/DPWavesProc/nortek/nortek_radialtouvw.m (revision 217) @@ -22,5 +22,5 @@ %whats the magnetic variation -magvar=9.63; +magvar=-10; %set up pressure Index: DPWavesProc/trunk/DPWavesProc/nortek/nortek_specmultiplot.m =================================================================== --- DPWavesProc/trunk/DPWavesProc/nortek/nortek_specmultiplot.m (revision 215) +++ DPWavesProc/trunk/DPWavesProc/nortek/nortek_specmultiplot.m (revision 217) @@ -36,5 +36,5 @@ %set up data structure for wave info -Winfo.setup={'EMEP','IMLM' 'nortek'}'; +Winfo.setup={'IMLM'}'; Winfo.hsig=[]; Winfo.hconf=[]; @@ -42,7 +42,5 @@ Winfo.dirP=[]; Winfo.Ddir=[]; -Winfo.Spectrum.EMEP=[]; Winfo.Spectrum.IMLM=[]; -Winfo.Spectrum.nortek=[]; %load the wave data from the nortek quick wave software @@ -68,8 +66,5 @@ [ID,SM,EP]=nortek_radialtouvw(pressure,range,orbit,sysinfo,1); - %run diwasp to generate this spectrum - [E_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); - - %now for IMLM + %For IMLM EP.method='IMLM'; EP.iter=3; @@ -88,9 +83,9 @@ %Fill up the Winfo data structure - hsig=[vertcat(E_WI.hsig,I_WI.hsig,nortek_WI.hsig)]; - hconf=[vertcat(E_WI.hconf,I_WI.hconf,nortek_WI.hconf)]; - peakP=[vertcat(E_WI.tp,I_WI.tp,nortek_WI.tp)]; - dirP=[vertcat(E_WI.dtp,I_WI.dtp,nortek_WI.dtp)]; - Ddir=[vertcat(E_WI.dp,I_WI.dp,nortek_WI.dp)]; + hsig=[I_WI.hsig]; + hconf=[I_WI.hconf]; + peakP=[I_WI.tp]; + dirP=[I_WI.dtp]; + Ddir=[I_WI.dp]; Winfo.hsig=[horzcat(Winfo.hsig,hsig)]; @@ -99,8 +94,5 @@ Winfo.dirP=[horzcat(Winfo.dirP,dirP)]; Winfo.Ddir=[horzcat(Winfo.Ddir,Ddir)]; - Winfo.Spectrum.EMEP=[cat(3,Winfo.Spectrum.EMEP,E_F01_D2.S)]; - Winfo.Spectrum.IMLM=[cat(3,Winfo.Spectrum.IMLM,I_F01_D2.S)]; - Winfo.Spectrum.nortek=[cat(3,Winfo.Spectrum.nortek,nortekspec)]; - + Winfo.Spectrum.IMLM=[cat(3,Winfo.Spectrum.IMLM,I_F01_D2.S)]; end