[ncl-talk] mask and calculate EOFs

Dennis Shea shea at ucar.edu
Tue Apr 12 07:20:49 MDT 2016


[1] Set the lat/lon area bounds

  latS   =
  latN   =
  lonL   =
  lonR   =

  f = addfile(...)

  X = f->data(:,{latS:latN},{lonL:lonR})


; =================================================================
; create weights:  sqrt(cos(lat))   [or sqrt(gw) ]
; =================================================================
  rad    = 4.*atan(1.)/180.
  clat   = X&lat
  clat   = sqrt( cos(rad*clat) )                 ; gw for gaussian grid

; =================================================================
; weight all observations
; =================================================================
  wX   = X                                   ; copy meta data
  wX   = X*conform(X, clat, 1)
  wX at long_name = "Wgt: "+x at long_name

; =================================================================
; Reorder (lat,lon,time) the *weighted* input data
; Access the area of interest via coordinate subscripting
; =================================================================
  x      = wX(lat|:,lon:,time|:)

  eof    = eofunc_Wrap(x, neof, optEOF)
  eof_ts = eofunc_ts_Wrap (x, eof, optETS)

  printVarSummary( eof )                         ; examine EOF variables
  printVarSummary( eof_ts )

=========

[2]
Use [1] to subset the region but then use a shape file that contains India.
See http://test.www.ncl.ucar.edu/Applications/shapefiles.shtml Example 8

Then use
http://test.www.ncl.ucar.edu/Document/Functions/Built-in/gc_inout.shtml
as the basis for masking . Then do the EOFs

On Sat, Apr 9, 2016 at 2:40 AM, Abdoulaye SY <sy.abdoulaye3 at ugb.edu.sn>
wrote:

> Hello, I have daily dataset (*data(time|366,lat|180,lon|360)*) and I want
> to mask all areas except, for example, India and to calculate  EOFs there.
> Thanks
>
> _______________________________________________
> 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/20160412/0d18bcae/attachment.html 


More information about the ncl-talk mailing list