-
Notifications
You must be signed in to change notification settings - Fork 6
/
Signature_E_P_Profile_Plots.m
141 lines (101 loc) · 3.05 KB
/
Signature_E_P_Profile_Plots.m
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
clc
clear all
close all
% 5 beam E-P profiles
% Use this example to plot mean dissipation and production profiles
% Bins
Nbin=20;
% Ensembles
Ens1=10;
EnsN=43;
NEns=EnsN-Ens1+1;
% Dissipation Rate files:
fpathD = ['/Users/Maru/Documents/PhD_UW/5BeamCodes/Signature_Dissipation'];
% Spectra
prefixSp = ['Dissip_Spectra_bin'];
% Structure Function
fnameSF = ['SF_DissipationRate.mat']; %This file contains the structure function for el depths
% Production File
fpathP = ['/Users/Maru/Documents/PhD_UW/5BeamCodes/Signature_Production'];
fnameP=['Production.mat'];
% Mean Flow
fpathMF=['/Users/Maru/Documents/PhD_UW/5BeamCodes/BinDataSignature'];
prefixMF=['Signature_Usigned_Bin'];
% Range
bin=1;
fpath3=['/Users/Maru/Documents/PhD_UW/5BeamCodes/BinDataSignature'];
prefix3 = ['SignatureData_QC_Bin'];
fname3 = [prefix3 int2str(bin) '.mat'];
load([ fpath3 '/' fname3 ])
z=SigData.range;
%% ------------------------------------------------------------------------
% Load Data for Plots
GoodEnsAI=43;
NensAI=34;
% Data from dissipation rate from the spectra
for bin=1:Nbin
eratefile=[prefixSp int2str(bin) '.mat'];
load([ fpathD '/' eratefile])
le=length(erate);
erateall(1:le,bin)=erate'; %mean(Sww_flat) with best fit to 0 slope of Sww_flat
erate_error(1:le,bin)=erate_error';
% U Signed
archivo=[prefixMF int2str(bin) '.mat'];
load([fpathMF '/' archivo])
Usigned(:,bin)=nanmean(Ens_Usigned,1)';
%Usigned(abs(Usigned(:,bin))<0.5,bin)=NaN;
clear Ens_Usigned
end
Usigned=Usigned(Ens1:EnsN,:);
esnan=find(erateall==0);
erateall2(esnan)=NaN;
clear esnan
% Saves only the useful ones
erateSp=erateall(Ens1:EnsN,:);
erateSp=erateSp';
% Structure Function Results
load([fpathD '/' fnameSF]);
esnan=find(abs(Usigned)<0.5);
SF.epsilon5(esnan)=NaN;
SF.eflat5(esnan)=NaN;
% Production
load([fpathP '/' fnameP]);
% Ebb and Flood
flood=find(nanmean(Usigned,2)>0);
ebb=find(nanmean(Usigned,2)<=0);
%%
figure(1)
clf
%set(gcf,'Position',[257 85 550 350])
% Ebb
%s1=subplot(2,2,1)
s1=axes('Position',[0.13 0.22 0.3259 0.7])
% SF
h2_ebb=semilogx(nanmean(SF.eflat5(:,ebb),2),z,'k','LineWidth',2)
hold on
% Spectra
h5_ebb=semilogx(nanmean(erateSp(:,ebb),2),z,'b','LineWidth',2)
% Production
h7_ebb=semilogx(nanmean(abs(Prod.P_total(:,ebb)),2),z(1:end-1),'r','LineWidth',2)
hold off
set(gca,'FontSize',16)
xlabel('P, \epsilon (m^{2}s^{-3})','FontSize',16)
ylabel('z (m)','FontSize',16)
title('Ebb')
% Flood
% SF
%s2=subplot(2,2,2)
s2=axes('Position',[0.57 0.22 0.3259 0.7])
h2_flood=semilogx(nanmean(SF.eflat5(:,flood),2),z,'k','LineWidth',2)
hold on
% Spectra
h5_flood=semilogx(nanmean(erateSp(:,flood),2),z,'b','LineWidth',2)
% Production
h7_flood=semilogx(nanmean(abs(Prod.P_total(:,flood)),2),z(1:end-1),'r','LineWidth',2)
hold off
set(gca,'FontSize',16)
xlabel('P, \epsilon (m^{2}s^{-3})','FontSize',16)
ylabel('z (m)','FontSize',16)
title('Flood')
legend([h2_ebb,h5_ebb,h7_ebb],'\epsilon Structure Function','\epsilon TKE Spectra','Production',...
'Position',[280 25 1 0.3],'Orientation','Horizontal','FontSize',16)