Re: Re: ncl-talk Digest, Vol 30, Issue 21

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sun, 4 Jun 2006 19:19:32 -0600 (MDT)

On Sun, 4 Jun 2006, Siraj Ul Islam wrote:
> Dear All,
> I an having a model out put data in netcdf format for ten years. this data
> is monthly data. What I want to is to make sorting of data in each grid cell
> and want to display it after calculating 9th percentile (as for percentile
> calculation sorting is the first step) calculation. Actually I want to
> display number of days in each grid box. Is there any FORTRAN code or NCL
> code which can sort my Grided data.
> Thanks in advance
--------------------------------------------------
The following will do the sort:

http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_pqsort.shtml

--------------
      f = addfile ("foo.nc" , "r")
      x = f->xData ; (time,lat,lon)

      dimx = dimsizes( x )
      ntim = dimx(0)

      xSort = x(lat|:,lon|:,time|:)
                                       ; sort
      iSort = dim_avg( xSort, 2 ) ; return permutation vector (not used here)
                                       ; and
                                       ; values in ascending order
      printVarSummary(xSort)

      n = floattointger( (ntim-1)*0.9 ); subscript of 9th percentile

data to plot

      xSort(:,:,n)

good luck

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Jun 04 2006 - 19:19:32 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 05 2006 - 14:29:52 MDT