NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/adcp/trunk/adcp/diwasp_1_1GD/private/radial.m

Revision 168 (checked in by cbc, 16 years ago)

Adding diwasp customizations.

Line 
1 function trm=radial(ffreqs,dirs,wns,z,depth,xpos,ypos);
2
3 %This transfer function takes the along beam radial velocities from an ADCP
4 %and transfers them to surface displacement for use in DIWASP.
5 %This was added to DIWASP on 6/22/07
6 % Modified from Hoshimoto (1997)
7
8
9
10 transH=.4; % transducer face height off the bottom
11 dist=(xpos^2+ypos^2)^.5; %horizontal distance from origin
12 a=atan(dist/(z-transH));%beam angle from the vertical
13
14 % compute the axis angle
15 if xpos > 0 & ypos > 0 % 1st quadrant
16     B= acos(xpos/dist);
17 elseif xpos < 0 & ypos < 0 % 3 quadrant
18     B= pi + acos(abs(xpos/dist));
19 elseif xpos < 0 & ypos > 0 % 2nd quadrant
20     B= pi/2 + asin(abs(xpos/dist));
21 elseif xpos > 0 & ypos < 0 % 4th quadrant
22     B = 3*pi/2 + asin(abs(xpos/dist));
23 end
24
25 %note: Dirs and B are both measured from the x-axis with positive angles
26 %being counterclockwise
27
28 A1=(ones(1,length(dirs))*cos(a));%a vector of length dirs of the cos(a)
29
30 FL=ffreqs*ones(1,length(dirs));%Create a vector of length ffreqs/length dirs so that we can multiply
31 %through in the trm function
32
33 KZ=cosh(wns*z)./sinh(wns*depth);
34 %include a maximum cuttoff for the velocity response function
35 KZ(find(KZ<0.1))=0.1;
36 KZ(find(isnan(KZ)))=1;
37
38 KZi=sinh(wns*z)./sinh(wns*depth);
39 %include a maximum cuttoff for the velocity response function
40 KZi(find(KZi<0.1))=0.1;
41 KZi(find(isnan(KZi)))=1;
42
43
44 trm=FL.*(KZ*(sin(a)*cos(dirs-B))-(i*KZi)*A1);
45
46
47
48
Note: See TracBrowser for help on using the browser.