Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fvcom-toolbox
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FVCOM
fvcom-toolbox
Commits
87c3b7e9
Commit
87c3b7e9
authored
Apr 30, 2018
by
Rory O'Hara Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some more help/examples added to plot_fvocm_field.m
parent
01deca19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
9 deletions
+38
-9
plot_fvcom_field.m
utilities/plot_fvcom_field.m
+38
-9
No files found.
utilities/plot_fvcom_field.m
View file @
87c3b7e9
...
...
@@ -18,9 +18,38 @@
% [optional] axi = the axis - specify axis range
% [optional] pll = the axis
% [optional] grd = add gridlines - specify colour
% [optional] tit = add title - specify text
% [optional] leg = add legend - specify text as a cell array
% [optional] qui = add quiver vectors - specify a structure with the quiver information in (see examples)
%
%
% EXAMPLE USAGE
% plot_fvcom_field(Mobj, Mobj.zeta, 'fid', 1, 'cli', [0 100], 'gif', 'animation.gif', 'axi', [60000 70000 40000 50000])
% plot_fvcom_field(Mobj, Mobj.zeta, 'fid', 1, 'cli', [0 100], 'gif', 'animation.gif', 'axi', [60000 70000 40000 50000])
%
% Quiver vecotor example 1 (plot every other depth average velocity vector on unstructured grid):
% Q.X = PFOW.lonc(1:15:end);
% Q.Y = PFOW.latc(1:15:end);
% Q.U = PFOW.ua(1:15:end,:);
% Q.V = PFOW.va(1:15:end,:);
% plot_fvcom_field(PFOW, PFOW.ua(:,1:13), 'pll', 'qui', Q)
%
% Quiver vecotor example 2 (include vecotrs on an interpolated regular grid):
% Q.x = -4:0.01:-2;
% Q.y = 58:0.01:59;
%
% [Q.X1, Q.Y1] = meshgrid(Q.x, Q.y);
% Q.X = Q.X1(:); Q.Y = Q.Y1(:);
%
% Only use data from within the region of interpolation
% I = PFOW.lonc>Q.x(1) & PFOW.lonc<Q.x(end) & PFOW.latc>Q.y(1) & PFOW.latc<Q.y(end);
%
% for tt=1:13
% Fx = scatteredInterpolant(double(PFOW.lonc(I)), double(PFOW.latc(I)), double(PFOW.ua(I,tt)));
% Fy = scatteredInterpolant(double(PFOW.lonc(I)), double(PFOW.latc(I)), double(PFOW.va(I,tt)));
% Q.U(:,tt) = Fx(Q.X, Q.Y);
% Q.V(:,tt) = Fy(Q.X, Q.Y);
% end
% plot_fvcom_field(PFOW, PFOW.ua(:,1:13), 'pll', 'qui', Q)
%
% Author(s)
% Rory O'Hara Murray (Marine Scotland Science)
...
...
@@ -93,9 +122,9 @@ for ii=1:1:length(varargin)
case
'qui'
quiver_flag
=
true
;
quiverData
=
varargin
{
ii
+
1
};
case
'qu2'
quiver2_flag
=
true
;
quiverData
=
varargin
{
ii
+
1
};
%
case 'qu2'
%
quiver2_flag = true;
%
quiverData = varargin{ii+1};
end
end
...
...
@@ -154,12 +183,12 @@ for ii=1:size(plot_field,2)
title
([
'time = '
datestr
(
double
(
M
.
time
(
ii
))
+
MJD_datenum
,
'HH:MM dd/mm/yyyy'
)])
end
if
quiver_flag
% hold on
% quiver(quiverData.X, quiverData.Y, quiverData.U(:,:,ii), quiverData.V(:,:,ii), 'w');
% hold off
% elseif quiver2_flag
hold
on
quiver
(
quiverData
.
X
,
quiverData
.
Y
,
quiverData
.
U
(:,:,
ii
),
quiverData
.
V
(:,:,
ii
),
'w'
);
hold
off
elseif
quiver2_flag
hold
on
quiver
(
quiverData
.
X
,
quiverData
.
Y
,
quiverData
.
U
(:,
ii
),
quiverData
.
V
(:,
ii
),
'color'
,
'w'
)
quiver
(
quiverData
.
X
,
quiverData
.
Y
,
quiverData
.
U
(:,
ii
),
quiverData
.
V
(:,
ii
),
0.4
,
'color'
,
0.99
*
[
1
1
1
])
hold
off
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment