Changeset 232
- Timestamp:
- 07/17/09 14:27:12
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
DPWavesProc/trunk/DPWavesProc/adcp_matlab/radialtouvw.m
r229 r232 26 26 %set up sysinfo file 27 27 samplesInBurst=sysinfo(3,:); 28 binsOut=sysinfo(8,:); 28 29 bin1height=sysinfo(9,:); 29 30 bin2height=sysinfo(10,:); … … 35 36 roll=sysinfo(20,:); 36 37 38 37 39 %set up pressure 38 40 press=pressure/1000; … … 53 55 orbit=orbit/1000; 54 56 orbitnew=orbit; 57 58 % calculate the total number of orbital bins output (usually 20) 59 orbOut=binsOut*4; 60 55 61 %interpolate to take out any NaNs and QC for bad data in orbital data 56 std_orbit=ones(1, 20);57 for i=1: 2062 std_orbit=ones(1,orbOut); 63 for i=1:orbOut 58 64 59 65 %first take out any points outside of 4 std deviations … … 63 69 end 64 70 %find the avg std deviation for each group 4 beams 65 for i=4:4: 2071 for i=4:4:orbOut 66 72 avgstd_orbit(i-3:i)=mean(std_orbit(i-3:i)); 67 73 end 68 74 69 75 %now remove the points outside 4avg std dev and interp 70 for i=1: 2076 for i=1:orbOut 71 77 ibad_std=find(abs(orbit(:,i)) > 4*avgstd_orbit(i)); 72 78 orbit(ibad_std,i)=NaN; … … 131 137 %reshape the orbital matrix to 3 dimensions 132 138 133 radial=reshape(orbitnew,samplesInBurst,4, 5);139 radial=reshape(orbitnew,samplesInBurst,4,binsOut); 134 140 135 141 % Compute uvw velocities and change to earth coordinates … … 140 146 error_vel = D1*(radial(:,1,:)+radial(:,2,:)-radial(:,3,:)-radial(:,4,:)); 141 147 142 u=reshape(u,samplesInBurst, 5);143 v=reshape(v,samplesInBurst, 5);144 w=reshape(w,samplesInBurst, 5);145 error_vel=reshape(error_vel,samplesInBurst, 5);148 u=reshape(u,samplesInBurst,binsOut); 149 v=reshape(v,samplesInBurst,binsOut); 150 w=reshape(w,samplesInBurst,binsOut); 151 error_vel=reshape(error_vel,samplesInBurst,binsOut); 146 152 147 153 [m,n] = size(u); 148 uno = ones(m, 5);154 uno = ones(m,binsOut); 149 155 unew = u.*(uno*a) + v.*(uno*b) + w.*(uno*c); 150 156 vnew = u.*(uno*d) + v.*(uno*e) + w.*(uno*f); DPWavesProc/trunk/DPWavesProc/adcp_matlab/specmultiplot.m
r231 r232 60 60 61 61 %set up data with radial velocities, freq and dir at default 62 [ID,SM,EP]=radialtouvw(pressure,range,orbit,sysinfo, 1);62 [ID,SM,EP]=radialtouvw(pressure,range,orbit,sysinfo,3); 63 63 64 64 % run diwasp to generate this spectrum with EMEP