[ncl-talk] Question about Spectral Analysis(computation of variance)

Dennis Shea shea at ucar.edu
Fri Jan 6 09:42:38 MST 2017


[1]
As noted in the documentation:
   "The units are variance/(unit frequency interval)."
    **not**
   "variance"

[2]
Look at the data ... literally
   plot = gsn_csm_y(wks,rain,False)                      ; see attachment

Basically, the annual cycle of rain.

What is it you expect from a time series like this? The lag-1 day auto
correlation is 0.96. A ***very red** process.

Assuming this is a climatology, I did a [four)info] on the data, The 1st
harmonic has amplitude 7.3 with the phase max at day 220 and it explains
82% of the variance. The 2nd harmonic has amplitude 2.3; phase day 32; 8%
of the variance.



On Fri, Jan 6, 2017 at 1:57 AM, Lyndon Mark Olaguera <
olagueralyndonmark429 at gmail.com> wrote:

> 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
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170106/ec6f5217/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rain.000001.png
Type: image/png
Size: 46363 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170106/ec6f5217/attachment.png 


More information about the ncl-talk mailing list