@@ -20,17 +20,36 @@ def calculate_flowlines(input_xr,seed_points,uv_varnames=['u','v'],xy_varnames=[
20
20
"""
21
21
% (C) Nick Holschuh - Amherst College -- 2022 ([email protected] )
22
22
%
23
- % This function prints out the minimum and maximum values of an array
23
+ % This function takes a vector field described in an xarray dataset, an
24
+ % array of points, and calculates flowlines that pass through the array
25
+ % points following the vector field.
24
26
%
25
27
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26
28
% The inputs are:
27
29
%
28
- % input_xr -- xarray dataarray that has the gradient objects in it
30
+ % input_xr -- this must be an xarray dataset with two dataarrays, represting
31
+ % the x components and the y components of a vector field. The data
32
+ % variables and the coordinate variables that describe them can have
33
+ % any name, but the defaults are 'u','v','x','y'.
34
+ % seed_points -- this should be an nx2 array containing x/y pairs for seed points
35
+ % used to constrain the calculated flowlines
36
+ % uv_varnames -- default=['u','v'], these are the datavariable names for the
37
+ % vector field components.
38
+ % xy_varnames -- default=['x','y'], these are the coordinate variable names
39
+ % describing the columns and rows of the vector field arrays
40
+ % steps -- default=20000, this is the number of steps to take away from the seed
41
+ % in either the forward or backward direction
42
+ % ds -- default=2, this is the step-size to take when propagating the flowline away
43
+ % from the seedpoint (in the same units as the coordinate variables
44
+ % forward0_both1_backward2 -- default=1, this sets whether or not you want
45
+ % the flowlines to extend down-vector, up-vector, or
46
+ % both from the seed point.
29
47
%
30
48
%%%%%%%%%%%%%%%
31
49
% The outputs are:
32
50
%
33
- % output -- the min and max in a 1x2 array
51
+ % output -- a list of nx2 arrays containing the flowlines associated with
52
+ % each seed point
34
53
%
35
54
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36
55
"""
0 commit comments