[ncl-talk] Question about Spectral Analysis(computation of variance)
Lyndon Mark Olaguera
olagueralyndonmark429 at gmail.com
Thu Jan 12 19:59:20 MST 2017
Dear Sir Dennis,
I tried to perform the spectral analysis in different regions using a
different data set from my previous post. For example, Western Africa and
South China Sea but I still get the same spike in variance near the 0 mark.
I am using gpcp daily data. Attached are the images and my script.
Any suggestion on how can I fix this?
Here is the link to the data that I am using.
https://drive.google.com/drive/folders/0B9faET7Bc2o8R0ZsZXM1bkxUWlE?
usp=sharing
Many thanks,
Lyndon
On Mon, Jan 9, 2017 at 11:14 AM, Lyndon Mark Olaguera <
olagueralyndonmark429 at gmail.com> wrote:
> Hi Sir Dennis,
>
> Thanks for the help. I was looking for peaks with periods of 30 to 60
> days.
> The data is not good for this analysis. I also tried in the raw daily
> values (attached in this email) but there is still a very large
> variance/frequency.
>
>
>
> On Sat, Jan 7, 2017 at 1:42 AM, Dennis Shea <shea at ucar.edu> wrote:
>
>> [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/20170113/ca2c171c/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SCS.png
Type: image/png
Size: 58922 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170113/ca2c171c/attachment.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WCA.png
Type: image/png
Size: 56775 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170113/ca2c171c/attachment-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spec_netcdf.ncl
Type: application/octet-stream
Size: 1968 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170113/ca2c171c/attachment.obj
More information about the ncl-talk
mailing list