WAFOFIG6 Joint distribution (pdf) of crest front period, Tcf, and crest amplitude, Ac given that the crest period, Tc=5s: Theoretical joint density (solid), kernel density estimate (dash) of Tcf and Ac given that 4.8s < Tc < 5.2s of the data from Poseidon in the Japan Sea (dots)
Estimate one-sided spectral density from data. | |
Extracts waveheights and steepnesses from data. | |
evaluates a PDF struct by interpolation | |
Binned Kernel Density Estimator. | |
Create or alter KDE OPTIONS structure. | |
Plot contents of pdf structures | |
Calculates quantile levels which encloses P% of data | |
Create or alter RIND OPTIONS structure. | |
Joint density of amplitude and period/wave-length characteristics | |
Prints a caption "made by WAFO" in current figure. | |
Clear variables and functions from memory. | |
Hold current graph. | |
Linear plot. |
001 function wafofig6 002 % WAFOFIG6 Joint distribution (pdf) of crest front period, Tcf, and crest amplitude, Ac 003 % given that the crest period, Tc=5s: 004 % Theoretical joint density (solid), 005 % kernel density estimate (dash) of Tcf and Ac 006 % given that 4.8s < Tc < 5.2s of the data from Poseidon in the Japan Sea (dots) 007 % 008 % 009 010 % Revised pab Feb2005, updated call to kdebin 011 012 global WAFOFIGNUM 013 014 if isempty(WAFOFIGNUM) 015 disp('You must start wafodemo in order to run this script') 016 clear global WAFOFIGNUM 017 return 018 end 019 020 global JTcf JAc Jind Jxn Jrate 021 global fTcfAcTc JNp Jh Jnit Jspeed 022 global kdeTcfAcTc Jkernel Jhs JL2 023 024 if Jnit<0 025 opt = rindoptset('method',abs(Jnit),'speed',Jspeed); 026 else 027 opt = rindoptset('method',0,'nit',(Jnit),'speed',Jspeed); 028 end 029 030 % Only need to calculate Globals which is not empty 031 % Poseidon / Japan Sea data 032 033 if isempty(JTcf) 034 [JVcf, JHd, JAc,JAt,JTcf,JTcr] = dat2steep(Jxn,Jrate,0); 035 Jind=find((4.8<JTcf+JTcr).*(JTcf+JTcr<5.2)); 036 end 037 if isempty(fTcfAcTc) 038 disp('This takes several minutes to finish => several hours ... ') 039 disp('depending on input arguments and your computer') 040 Sj=dat2spec(Jxn); 041 fTcfAcTc = spec2thpdf(Sj,0,'TcfAc',[5 5 JNp],Jh,opt); 042 end 043 044 if isempty( kdeTcfAcTc) 045 kopt = kdeoptset('kernel',Jkernel,'hs',Jhs,'L2',JL2); 046 kdeTcfAcTc=kdebin([JTcf(Jind) JAc(Jind)],kopt); 047 if 1, 048 r = evalpdf(kdeTcfAcTc,JTcf(Jind), JAc(Jind),'linear'); 049 kdeTcfAcTc.cl = qlevels2(r,kdeTcfAcTc.pl); % calculate the levels which encloses fkde.pl 050 % percent of the data (v,h) 051 end 052 end 053 plot( JTcf(Jind), JAc(Jind),'.'), hold on 054 pdfplot( kdeTcfAcTc,'r--') 055 pdfplot(fTcfAcTc,'k-') 056 hold off 057 wafostamp('Figure 6','(NR)')
Comments or corrections to the WAFO group