NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

root/DPWP/trunk/DPWP/adcp_matlab/confplot.m

Revision 314 (checked in by gdusek, 14 years ago)

changes to mulitple files due to recent merge

Line 
1 function [fig1]=confplot(uvw,range,radial)
2
3
4
5 freqs=[0.01:0.01:.4];
6 dirres=2;
7
8
9
10 %calculate just the frequency energy spectrum
11 uvwfreq=sum(uvw.S')*dirres;
12 rangefreq=sum(range.S')*dirres;
13 radialfreq=sum(real(radial.S)')*dirres;
14
15 %Compute the coefficient for the upper and lower error bounds for the power
16 %spectrum assuming 95% confidence.  Added on 9/17/08
17 degF=radial.degF;
18 chiUp=chi2inv(.975,degF);
19 chiLow=chi2inv(.025,degF);
20 coeffUp=degF/chiLow;
21 coeffLow=degF/chiUp;
22 logCoeffUp=log10(coeffUp);
23 logCoeffLow=log10(coeffLow);
24
25 %calculate the conf limits throughout the frequency spectrum
26 radialfreqUP=radialfreq*coeffUp;
27 radialfreqLOW=radialfreq*coeffLow;
28
29 %same thing for the Puvw and range
30 degF2=25;
31 chiUp2=chi2inv(.975,degF2);
32 chiLow2=chi2inv(.025,degF2);
33 coeffUp2=degF2/chiLow2;
34 coeffLow2=degF2/chiUp2;
35 logCoeffUp2=log10(coeffUp2);
36 logCoeffLow2=log10(coeffLow2);
37
38 %calculate the conf limits throughout the frequency spectrum
39 uvwfreqUP=uvwfreq*coeffUp2;
40 uvwfreqLOW=uvwfreq*coeffLow2;
41 rangefreqUP=rangefreq*coeffUp2;
42 rangefreqLOW=rangefreq*coeffLow2;
43
44 scrsz = get(0,'ScreenSize');
45 fig1=figure('Position',[scrsz]);
46
47 %plot the frequency energy spectrum
48 h1=semilogy(freqs,uvwfreq,'b');
49 hold on
50 plot([0.1,0.1],[10^logCoeffLow2,10^logCoeffUp2],'b.-');
51 %plot(freqs,EMEPfreqUP,'b--');
52 %plot(freqs,EMEPfreqLOW,'b--');
53
54 h2=semilogy(freqs,rangefreq,'r');
55 plot([0.11,0.11],[10^logCoeffLow2,10^logCoeffUp2],'r.-');
56 %plot(freqs,EMEPrangefreqUP,'r--');
57 %plot(freqs,EMEPrangefreqLOW,'r--');
58
59 h3=semilogy(freqs,radialfreq,'g');
60 plot([0.12,0.12],[10^logCoeffLow,10^logCoeffUp],'g.-');
61 %plot(freqs,EMEPradialfreqUP,'g--');
62 %plot(freqs,EMEPradialfreqLOW,'g--');
63 ylim([10^-2,10^1]);
64 %set(gca,'ytick',[-4 -3 -2 -1 0 1]);
65 axis(axis);
66 legend([h1,h2,h3],'EMEP uvw','EMEP range','EMEP radial','location','best');
67 title('1d Frequency Spectrum');
68 xlabel('frequency in Hz');
69 ylabel('m^2 / hz');
70
71
72
73
74
75
76
77
Note: See TracBrowser for help on using the browser.