forked from PeterRochford/SkillMetricsToolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoverlay_target_diagram_circles.m
More file actions
60 lines (55 loc) · 1.91 KB
/
overlay_target_diagram_circles.m
File metadata and controls
60 lines (55 loc) · 1.91 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
function overlay_target_diagram_circles(option)
%OVERLAY_TARGET_DIAGRAM_CIRCLES Overlays circle contours on a target diagram.
%
% OVERLAY_TARGET_DIAGRAM_CIRCLES(OPTION)
% Plots circle contours on a target diagram to indicate standard
% deviation ranges and observational uncertainty threshold.
%
% INPUTS:
% option : data structure containing option values. (Refer to
% GET_TARGET_DIAGRAM_OPTIONS function for more information.)
% option.axismax : maximum for the X & Y values. Used to set
% default circles when no contours specified
% option.circles : radii of circles to draw to indicate
% isopleths of standard deviation
% option.circleLineSpec : circle line specification (default dashed
% black, '--k')
% option.normalized : statistics supplied are normalized with
% respect to the standard deviation of reference values
% option.obsUncertainty : Observational Uncertainty (default of 0)
%
% OUTPUTS:
% None.
% 1 - reference circle if normalized
if strcmp(option.normalized,'on')
theta = 0:0.01:2*pi;
rho(1:length(theta)) = 1;
[X,Y] = pol2cart(theta,rho);
plot(X,Y,'k','LineWidth',option.circleLineWidth);
end
% Set range for target circles
if strcmp(option.normalized,'on')
circles = [.5 1];
else
if isfield(option,'circles')
index = find(option.circles <= option.axismax);
circles = option.circles(index);
else
circles = option.axismax*[.7 1];
end
end
% 2 - secondary circles
for i=1:length(circles)
theta=0:0.01:2*pi;
rho(1:length(theta))=circles(i);
[X,Y] = pol2cart(theta,rho);
plot(X,Y,option.circleLineSpec,'LineWidth',option.circleLineWidth);
end
% 3 - Observational Uncertainty threshold
if option.obsUncertainty > 0
theta=0:0.01:2*pi;
rho(1:length(theta))=option.obsUncertainty;
[X,Y] = pol2cart(theta,rho);
plot(X,Y,'--b');
end
end % function overlay_target_diagram_circles