Changeset 217
- Timestamp:
- 12/18/08 11:47:50
- Files:
-
- DPWavesProc/trunk/DPWavesProc/adcp_matlab/radialtouvw.m (modified) (1 diff)
- DPWavesProc/trunk/DPWavesProc/adcp_matlab/specmultiplot.m (modified) (8 diffs)
- DPWavesProc/trunk/DPWavesProc/nortek/nortek_radialtouvw.m (modified) (1 diff)
- DPWavesProc/trunk/DPWavesProc/nortek/nortek_specmultiplot.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
DPWavesProc/trunk/DPWavesProc/adcp_matlab/radialtouvw.m
r215 r217 22 22 23 23 %whats the magnetic variation 24 magvar= 9.63;24 magvar=-10; 25 25 26 26 %set up sysinfo file DPWavesProc/trunk/DPWavesProc/adcp_matlab/specmultiplot.m
r215 r217 1 function [Winfo ]=specmultiplot(dateinfo1,dateinfo2,timestep);1 function [Winfo,spec2d,fd,thetad,td]=specmultiplot(dateinfo1,dateinfo2,timestep); 2 2 %where dateinfo1 and 2 are the strings of the first and last date extension 3 3 %of the pressure,range,etc files and timestep is the time in hours between … … 28 28 end 29 29 30 30 %Make a directory for the data 31 mkdir('tempdir'); 32 31 33 %set up time, which is Winfo.time as date str in the yymmddHHMM format 32 34 time=datestr(Winfo.time, 'yymmddHHMM'); 33 35 34 36 %set up data structure for wave info 35 Winfo.setup={'EMEP UVW','IMLM UVW','EMEP range','IMLM range','EMEP radial','IMLM radial','wavesmon'}';37 Winfo.setup={'EMEP radial'}; 36 38 Winfo.hsig=[]; 37 39 Winfo.hconf=[]; … … 39 41 Winfo.dirP=[]; 40 42 Winfo.Ddir=[]; 41 Winfo.Spectrum.EMEPuvw=[];42 Winfo.Spectrum.IMLMuvw=[];43 Winfo.Spectrum.EMEPrange=[];44 Winfo.Spectrum.IMLMrange=[];45 43 Winfo.Spectrum.EMEPradial=[]; 46 Winfo.Spectrum.IMLMradial=[];47 Winfo.Spectrum.wavesmon=[];48 44 49 45 %Load the data and run the script … … 55 51 orbit=strcat('orbit_',dateinfo,'.txt'); 56 52 sysinfo=strcat('sysinfo_',dateinfo,'.txt'); 57 spec=strcat('DSpec',dateinfo,'.txt');53 58 54 59 55 pressure=load(pressure); … … 61 57 orbit=load(orbit); 62 58 sysinfo=load(sysinfo); 63 spec=load(spec); 64 65 %set up data with uvw and pressure, freq at 0.01 and dir at 2 66 [ID,SM,EP]=radialtouvw(pressure,range,orbit,sysinfo,1); 67 68 %run diwasp to generate this spectrum 69 [E_uvw_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 70 71 %now for IMLM 72 EP.method='IMLM'; 73 EP.iter=3; 74 [I_uvw_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 75 76 %set up data with ranges, freq and dir at default 77 [ID,SM,EP]=radialtouvw(pressure,range,orbit,sysinfo,2); 78 79 % run diwasp to generate this spectrum with EMEP 80 [E_range_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 81 82 %now with IMLM 83 EP.method='IMLM'; 84 EP.iter=3; 85 [I_range_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 59 86 60 87 61 %set up data with radial velocities, freq and dir at default … … 89 63 90 64 % run diwasp to generate this spectrum with EMEP 91 [E_radial_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 92 93 %now with IMLM 94 EP.method='IMLM'; 95 EP.iter=3; 96 [I_radial_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 65 [radialE, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 97 66 98 67 %Use waveplot to plot the polar, freq and dir plots of the spectra 99 68 100 [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);69 [E_radial_WI,fig1,fig2]=waveplottest1(radialE,sysinfo); 101 70 102 71 saveas(fig1,['polar1_' dateinfo '.fig']); 103 72 saveas(fig2,['dirfreq1_' dateinfo '.fig']); 104 105 [E_radial_WI,I_radial_WI,fig5,fig6]=radialwaveplot(E_radial_F01_D2,I_radial_F01_D2,spec,sysinfo);106 107 saveas(fig5,['polar3_' dateinfo '.fig']);108 saveas(fig6,['dirfreq3_' dateinfo '.fig']);109 73 74 movefile(['polar1_' dateinfo '.fig'],'tempdir'); 75 movefile(['dirfreq1_' dateinfo '.fig'],'tempdir'); 110 76 close all; 111 77 112 %Make sure wavesmon spectrum is formatted right before outputting, change to m^2/Hz/deg113 wmon.S=spec/(360*1000*1000);114 78 115 79 %Fill up the Winfo data structure 116 80 117 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)];118 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])];119 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)];120 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)];121 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)];81 hsig=[vertcat(E_radial_WI.hsig)]; 82 hconf=[vertcat(E_radial_WI.hconf)]; 83 peakP=[vertcat(E_radial_WI.tp)]; 84 dirP=[vertcat(E_radial_WI.dtp)]; 85 Ddir=[vertcat(E_radial_WI.dp)]; 122 86 123 87 … … 127 91 Winfo.dirP=[horzcat(Winfo.dirP,dirP)]; 128 92 Winfo.Ddir=[horzcat(Winfo.Ddir,Ddir)]; 129 Winfo.Spectrum.EMEPuvw=[cat(3,Winfo.Spectrum.EMEPuvw,E_uvw_F01_D2.S)]; 130 Winfo.Spectrum.IMLMuvw=[cat(3,Winfo.Spectrum.IMLMuvw,I_uvw_F01_D2.S)]; 131 Winfo.Spectrum.EMEPrange=[cat(3,Winfo.Spectrum.EMEPrange,E_range_F01_D2.S)]; 132 Winfo.Spectrum.IMLMrange=[cat(3,Winfo.Spectrum.IMLMrange,I_range_F01_D2.S)]; 133 Winfo.Spectrum.EMEPradial=[cat(3,Winfo.Spectrum.EMEPradial,E_radial_F01_D2.S)]; 134 Winfo.Spectrum.IMLMradial=[cat(3,Winfo.Spectrum.IMLMradial,I_radial_F01_D2.S)]; 135 Winfo.Spectrum.wavesmon=[cat(3,Winfo.Spectrum.wavesmon,wmon.S)]; 136 93 Winfo.Spectrum.EMEPradial=[cat(3,Winfo.Spectrum.EMEPradial,radialE.S)]; 137 94 end 138 95 96 Winfo.Spectrum.EMEPradial=permute(Winfo.Spectrum.EMEPradial,[3,1,2]); 97 98 spec2d=Winfo.Spectrum.EMEPradial; 99 spec2d=spec2d(:,:,1:180); 100 spec2d=spec2d*(360/(2*pi)); 101 102 %this changes the coordinates from axis to compass 103 newspec2d=zeros(size(spec2d)); 104 for i= 1:size(spec2d,1) 105 oldspec=squeeze(spec2d(i,:,:)); 106 107 newspec=zeros(size(oldspec)); 108 109 for j = 1:46 110 newspec(:,j)=oldspec(:,47-j); 111 end 112 for j = 47:180 113 newspec(:,j)=oldspec(:,181-(j-46)); 114 end 115 116 %firstspec=newspec(:,91:180); 117 %secondspec=newspec(:,1:90); 118 %newspec=cat(2,firstspec,secondspec); 119 120 newspec2d(i,:,:)=newspec; 121 end 122 123 Winfo.Spectrum.EMEPradial=newspec2d; 124 125 %************************************************************************* 126 %these following variables can be output if you wish to continue to process the data through 127 %the XWAVES software. 128 129 spec2d=newspec2d; 130 fd=[0.01:0.01:0.4]; 131 thetad=[0:2:358]; 132 date1=datevec(Winfo.time); 133 td=date1(:,1:5); 134 135 save(['specdata_' dateinfo],'Winfo','spec2d','fd','thetad','td'); 136 movefile(['specdata_' dateinfo '.mat'],'tempdir'); 137 138 %************************************************************************** 139 139 140 %now create the time series plots of the wave info 140 [fig_sigh,fig_pp,fig_dp,fig_dd]=Winfo_plot (Winfo);141 [fig_sigh,fig_pp,fig_dp,fig_dd]=Winfo_plot1(Winfo); 141 142 142 143 saveas(fig_sigh,['sigh_' dateinfo '.fig']); … … 145 146 saveas(fig_dd,['domdir_' dateinfo '.fig']); 146 147 148 movefile(['sigh_' dateinfo '.fig'],'tempdir'); 149 movefile(['peakp_' dateinfo '.fig'],'tempdir'); 150 movefile(['dirpeak_' dateinfo '.fig'],'tempdir'); 151 movefile(['domdir_' dateinfo '.fig'],'tempdir'); 152 153 movefile('tempdir',strcat('procdata_',dateinfo)); 154 147 155 close all; 148 156 DPWavesProc/trunk/DPWavesProc/nortek/nortek_radialtouvw.m
r168 r217 22 22 23 23 %whats the magnetic variation 24 magvar= 9.63;24 magvar=-10; 25 25 26 26 %set up pressure DPWavesProc/trunk/DPWavesProc/nortek/nortek_specmultiplot.m
r215 r217 36 36 37 37 %set up data structure for wave info 38 Winfo.setup={' EMEP','IMLM' 'nortek'}';38 Winfo.setup={'IMLM'}'; 39 39 Winfo.hsig=[]; 40 40 Winfo.hconf=[]; … … 42 42 Winfo.dirP=[]; 43 43 Winfo.Ddir=[]; 44 Winfo.Spectrum.EMEP=[];45 44 Winfo.Spectrum.IMLM=[]; 46 Winfo.Spectrum.nortek=[];47 45 48 46 %load the wave data from the nortek quick wave software … … 68 66 [ID,SM,EP]=nortek_radialtouvw(pressure,range,orbit,sysinfo,1); 69 67 70 %run diwasp to generate this spectrum 71 [E_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 72 73 %now for IMLM 68 %For IMLM 74 69 EP.method='IMLM'; 75 70 EP.iter=3; … … 88 83 %Fill up the Winfo data structure 89 84 90 hsig=[ vertcat(E_WI.hsig,I_WI.hsig,nortek_WI.hsig)];91 hconf=[ vertcat(E_WI.hconf,I_WI.hconf,nortek_WI.hconf)];92 peakP=[ vertcat(E_WI.tp,I_WI.tp,nortek_WI.tp)];93 dirP=[ vertcat(E_WI.dtp,I_WI.dtp,nortek_WI.dtp)];94 Ddir=[ vertcat(E_WI.dp,I_WI.dp,nortek_WI.dp)];85 hsig=[I_WI.hsig]; 86 hconf=[I_WI.hconf]; 87 peakP=[I_WI.tp]; 88 dirP=[I_WI.dtp]; 89 Ddir=[I_WI.dp]; 95 90 96 91 Winfo.hsig=[horzcat(Winfo.hsig,hsig)]; … … 99 94 Winfo.dirP=[horzcat(Winfo.dirP,dirP)]; 100 95 Winfo.Ddir=[horzcat(Winfo.Ddir,Ddir)]; 101 Winfo.Spectrum.EMEP=[cat(3,Winfo.Spectrum.EMEP,E_F01_D2.S)]; 102 Winfo.Spectrum.IMLM=[cat(3,Winfo.Spectrum.IMLM,I_F01_D2.S)]; 103 Winfo.Spectrum.nortek=[cat(3,Winfo.Spectrum.nortek,nortekspec)]; 104 96 Winfo.Spectrum.IMLM=[cat(3,Winfo.Spectrum.IMLM,I_F01_D2.S)]; 105 97 end 106 98