-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalphaPIXArray.m
More file actions
95 lines (75 loc) · 3.28 KB
/
Copy pathalphaPIXArray.m
File metadata and controls
95 lines (75 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
function [x,y] = alphaPIXArray(x0, y0, h0, Tmean, rot)
%
% [x, y] = alphaPIXArray(x0, y0, h0, Tmean, rot)
%
% creates an array of pixel sample locations for the estimation of
% wave direction at location [x0, y0]. Because the scales of the spatial
% lags depend on the local wavelength, the user is asked to input the
% mean wave period and local depth for the analysis. Specific lag arrays
% and recommended scaling is mostly taken from Herbers et al, 1995.
%
% Inputs:
% x0,y0 - center of the array in meters referenced to local coordinate
% system. x0 cross shore, y0 along shore
% h0 - water depth in meters at the array center
% Tmean - typical wave period of interest in seconds
% rot - array rotation in degrees (positive rotation is CCW from
% a cross-shore/longshore arrangement). Rotation is about
% the position [x0, y0]
%
%
% Examples:
% [xa1, ya1] = alphaPIXArray(200, 650, 4.5, 8.0, 10);
% [x, y] = alphaPIXArray(400, 650, approxDuckBathy(400), 8.0, 10);
%
% See also bathyPIXArray, runupPIXArray, vbarPIXArray, dipsol
%
% Copyright, Argus User Group, 2001
% Authors: Chris Chickadel, James Sulzman, Rob Holman
% set constants
% Apx/Lcen, where Apx is the aperture and Lcen is sample frequency of interest.
% the value 0.5 is a guess by Holman and Holland
kappa = 0.5; % this may be slightly too large (Holman, 8/01)
%The alongshore aperture divided by the cross shore aperture
aspectRatio = 2; %Apy/Apx
%These are the cumulative lag spacings of the sample locations in meters
instPtsX = [1 9 10 13 15 20]'-1; % cross shore Freilich from XSPECT.m
instPtsY = [1 2 5 10 16 20 22]'-1; % along shore
% find Lcen
k = dispsol2(h0,1/Tmean,0);
Lcen = 2*pi/k; % k is radial wavenumber
% find Apx, Apy, the cross-shore and longshore aperatures
Apx = Lcen*kappa;
Apy = Apx*aspectRatio;
% make inst locations
instLocX = instPtsX*Apx/max(instPtsX) - Apx/2 ;
instLocY = instPtsY*Apy/max(instPtsY) - Apy/2 ;
% make diagonal locations
diagonal = [1 1 -1 -1; -1 1 -1 1]'*[(max(instLocX)) 0; 0 (max(instLocY))]*0.5;
% make x and y vectors, then rotate
x = [instLocX; repmat(0,size(instLocY)); diagonal(:,1)] + x0;
y = [repmat(0,size(instLocX)); instLocY; diagonal(:,2)] + y0;
xy=[(x-x0) (y-y0)];
rot = deg2rad(rot);
xy = xy * [cos(rot) sin(rot); -sin(rot) cos(rot)];
x = xy(:,1) + x0;
y = xy(:,2) + y0;
% Copyright by Oregon State University, 2002
% Developed through collaborative effort of the Argus Users Group
%
% Id: alphaPIXArray.m 1.1 4/24/2 17:13:53
% Notes:
%key pixel pixelDesign
%comment Creates an array of pixel sample locations for wave direction estimates
% This program is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
% published by the Free Software Foundation, version 3 of the
% License.
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
% You should have received a copy of the GNU General Public License
% along with this program. If not, see
% <http://www.gnu.org/licenses/>.
% CIRN: https://coastal-imaging-research-network.github.io/