[ncl-talk] Spectral Analysis

Kwesi Quagraine starskykwesi at gmail.com
Tue Jan 17 03:52:07 MST 2017


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
Skype: quagraine_cwasi
Twitter: @Pkdilly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170117/ec420820/attachment.html 


More information about the ncl-talk mailing list