[ncl-talk] Spectral Analysis

Kwesi Quagraine starskykwesi at gmail.com
Tue Jan 17 13:51:43 MST 2017


Thanks Sir Dennis for the suggestions given. It really has helped.

Kwesi

On Tue, Jan 17, 2017 at 7:30 PM, Dennis Shea <shea at ucar.edu> wrote:

> The 'specx_anal' documentation clearly states that "Missing values are not
> allowed. "
> =================
> Prototype
>
> 	function specx_anal (
> 		x    [*] : numeric,
> 		iopt [1] : integer,
> 		jave [1] : integer,
> 		pct  [1] : numeric
> 	)
>
> 	return_val <http://www.ncl.ucar.edu/Document/Functions/return_val.shtml> [1] :  float or double
>
> Arguments *x*
>
> A one-dimensional array containing the data. Missing values are not
> allowed.
>
> ==================
>
> You could do
>
>      aao at _FillValue = 0.0      ; change: _FillValue =
> 3.000000060858434e+33
>
>      delete(aao at _FillValue)   ; delete recognition of _FillValue
>
> There will be no error messages returned bu specx_anal and you will get
> 'numbers'
>
> ***BUT***
>
> they are *not* the correct numbers. These 0-values will affect the
> calculated spectrum.
>
>
> =================
>
> You must ****intelligently**** fill the _FillValue locations. Any old
> numbers (eg: 0) will not accomplist this taks.
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++
>
> Please become familiar with:  https://climatedataguide.ucar.edu/
>
> Search fo AAO (or, equivalently, SAM)
>
> https://climatedataguide.ucar.edu/climate-data/overview-climate-indices
>
> https://climatedataguide.ucar.edu/climate-data/marshall-
> southern-annular-mode-sam-index-station-based
>
> The latter has "Get Data (External)"  .... Click and get the data you want.
>
>
>
>
>
>
>
>
> On Tue, Jan 17, 2017 at 3:52 AM, Kwesi Quagraine <starskykwesi at gmail.com>
> wrote:
>
>> Hello NCLers, I am currently trying to make a spectral analysis plot from
>> a AAO indices (timeseries 1980-2016) netcdf file using the script
>> (following spec_1 from ncl website) below and I get this error
>> "fatal:specx_anal: 'x' cannot contain any missing values".
>>
>> [1] I have tried setting aao at _FillValue = 0 but to no avail
>>
>> Any help will be much appreciated.
>>
>>
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>>
>> diri    = "/home/kwesi/Documents/Indices/"
>>
>> begin
>>
>>    in  =addfile(diri + "aao_anom.nc","r")                           ;
>> open netcdf file
>>    aao  = in->AAO
>>
>>   printVarSummary(aao)
>>
>>   d = 1
>>   sm = 7
>>   pct = 0.10
>>
>>   spec = specx_anal(aao,d,sm,pct)
>>
>>   wks  = gsn_open_wks("ps","spec")                ; Opens a ps file
>>
>>    res = True                       ; no plot mods desired
>>    res at tiMainString = "AAO"                   ; title
>>    res at tiXAxisString = "Frequency (cycles/month)"  ; xaxis
>>    res at tiYAxisString = "Variance"                  ; yaxis
>>
>>    plot=gsn_csm_xy(wks,spec at frq,spec at spcx,res)     ; create plot
>> end
>>
>> printVarSummary(aao) gives;
>> ​Variable: aao
>> Type: double
>> Total Size: 3552 bytes
>>             444 values
>> Number of Dimensions: 1
>> Dimensions and sizes:    [time | 444]
>> Coordinates:
>>             time: [   0.. 443]
>> Number Of Attributes: 4
>>   long_name :    Antarctic Oscillation Index
>>   units :    1
>>   _FillValue :    3.000000060858434e+33
>>   missing_value :    3.000000060858434e+33
>>>>
>> --
>> Try not to become a man of success but rather a man of value-Albert
>> Einstein
>>
>> University of Cape Coast|College of Agriculture and Natural Sciences|Department
>> of Physics|
>> Team Leader|Recycle Up! Ghana|Technology Without Borders|
>> Other emails: kwesi.quagraine at ucc.edu.gh|kwesi.quagraine at teog.de|
>> Mobile: +233266173582 <+233%2026%20617%203582>
>> Skype: quagraine_cwasi
>> Twitter: @Pkdilly
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>


-- 
Try not to become a man of success but rather a man of value-Albert Einstein

University of Cape Coast|College of Agriculture and Natural Sciences|Department
of Physics|
Team Leader|Recycle Up! Ghana|Technology Without Borders|
Other emails: kwesi.quagraine at ucc.edu.gh|kwesi.quagraine at teog.de|
Mobile: +233266173582
Skype: quagraine_cwasi
Twitter: @Pkdilly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170117/9065d323/attachment.html 


More information about the ncl-talk mailing list