[ncl-talk] Perform Fourier Analysis to Pentad Series

Dennis Shea shea at ucar.edu
Tue Jan 3 14:52:19 MST 2017


  ntim = 73
   nlat = 73
   mlon = 144

   y    = random_uniform(0,100,(/ntim,nlat,mlon/))
   y!0 = "time"
   y!1 = "lat"
   y!2 = "lon"

   printVarSummary(y)                ; [time | 73] x [lat | 73] x [lon |
144]
   print("==========")

   Y    = y(lat|:,lon|:,time|:)      ; convenience
   printVarSummary(Y)
   cf   = ezfftf (Y)                 ; ==> cf(2,nlat,mlon,ntim/2)
   printVarSummary(cf)               ; [2] x [73] x [144] x [36]

  ;print(cf at xbar)

   do n=0,nlat*mlon-1
      cf at xbar(n) = 0.0               ; reconstruct with harmonics only
   end do

   cf(:,:,:, 0:4 ) = 0.0             ; set non-desired harmonics  to 0.0
   cf(:,:,:, 6:16) = 0.0
   cf(:,:,:,18:  ) = 0.0

  YY    = ezfftb(cf,cf at xbar)
   copy_VarMeta(Y, YY)
   YY at info = "Only harmonics 5 and 18 retained: means removed"
   printVarSummary(YY)    ; (lat,lon,time)


You can apply to your file.
Also, *you* cn determine how to write the file out.

Method 1 at
http://www.ncl.ucar.edu/Applications/o-netcdf.shtml


On Mon, Jan 2, 2017 at 7:41 PM, Lyndon Mark Olaguera <
olagueralyndonmark429 at gmail.com> wrote:

> Dear All,
>
> I would like to perform fourier analysis to a  pentad (nonoverlapping five
> day average) time series(t=1 to t=73). I would like to get the sum of the
> 5th and 18th harmonics and output as a separate netcdf file. Is this
> possible to do in ncl?I am new in ncl. Ill appreciate if anyone can point
> me to the right functions that I can use here.
>
> Here is the link to the file that I'm working with.
>
> https://drive.google.com/file/d/0B9faET7Bc2o8cWpmRE1yNldNVE9SQ
> 1JNNF9XdXJPVUdqbUc0/view?usp=sharing
>
> Many thanks in advance,
>
> 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/20170103/475f0d21/attachment.html 


More information about the ncl-talk mailing list