[ncl-talk] Question about Spectral Analysis(computation of variance)
Lyndon Mark Olaguera
olagueralyndonmark429 at gmail.com
Fri Jan 6 01:57:12 MST 2017
Hi All,
I'm trying to perform spectral analysis using the specx_anal function in
ncl.
I'm getting a variance around 1000 near the zero mark.I dont know if I'm
missing a step prior to performing the spectral analysis. I would like to
ask for any suggestions on how can I improve this.
Attached are the data set and script.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
filename = "type1_clim.csv"
lines = asciiread(filename,-1,"string")
data = lines(1:)
rain = tofloat(str_get_field(data,10,","))
d = 1
sm = 12
pct = 0.10
spec= specx_anal(rain,d,sm,pct)
printVarSummary(spec)
wks = gsn_open_wks("png","test_fldmean") ; Opens a ps file
res = True
res at tiMainString = "Type1_Spectrum" ; title
f = spec at frq
res at tiXAxisString = "Frequency (cycles/day)" ; xaxis
res at tiYAxisString = "Variance" ; yaxis
splt = specx_ci(spec, 0.05, 0.95)
res at xyLineColors = (/"foreground","green","blue","red"/)
plot = gsn_csm_xy(wks,f,splt,res) ; create plot
end
I'll appreciate any help.
Many thanks,
Lyndz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170106/79047551/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: type1_clim.csv
Type: text/csv
Size: 29325 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170106/79047551/attachment.bin
More information about the ncl-talk
mailing list