Re: station timeseries to grid

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 27 Aug 2009 22:11:18 -0600

You have npts=5 which is the number of stations.
You have ntim=480
You have an area: 32N-to-36N, 89E-to-98E

For each time, you want to interpolate the 5 stations to the
above grid.

    do nt=0,ntim-1
         grid(:,:,nmo) = obj_anal_ic(lon1,lat1,xObs(nt,:),lon,lat,
rscan, opt)
    end do

I must say that 5 points over the above area in not a lot
of spatial data.

Good lock
D

yanling_1220 wrote:
> Dear all,
>
> I want to interpolate my station timeseries data to grids,which is with
> missing values.I find althought "natgrids" "Natgrid
> <http://www.ncarg.ucar.edu//ngmath/natgrid/nnhome.html>" and "natgridd"
> can deal with timeseries data,but they don't allow missing values in the
> input data arrays."obj_anal_ic" allow missing values in the input data
> arrays,but it design for one dimension array,and must do loop.Is there
> any other function
> I didn't find which is according with my goal?
>
> Before find other function,I write a sript with "obj_anal_ic" (the
> attached),but it pop up following error messeges when run in ncl
> 5.1.1,and I don't know how to modify it.Can somebody help me please?
>
> Thanks in advance.
> sunflower
>
> error messege as following(line 36 is where the function "obj_anal_ic"
> lie,in red color ):
> -----------------------------------------------------------------------------------
> fatal:wgt_runave: The length of wgt must be less than or equal to the
> last dimen
> sion of x
> fatal:Execute: Error occurred at or near line 10354 in file
> $NCARG_ROOT/lib/ncar
> g/nclscripts/csm/contributed.ncl
> fatal:Execute: Error occurred at or near line 10673 in file
> $NCARG_ROOT/lib/ncar
> g/nclscripts/csm/contributed.ncl
> fatal:Execute: Error occurred at or near line 36 in file obj_anal_ic.ncl
> ---------------------------------------------------------------------------------------
>
> ---------------------------------------------------------------------------------------
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> begin
> npts = 5
> ntim = 480 ;extract 1961-2000 timeseries
> xx = asciiread ( "Yangtze_river_1961_2000_tas_observed_cof.txt",
> (/npts, ntim/), "float")
> xx!0 = "pts"
> xx!1 = "time"
> xObs = xx(time|:,pts|:)
> xObs@_FillValue <mailto:xObs@_FillValue> = -99.99
> printVarSummary(xObs )
> stain= asciiread("Yangtze_river_temperature_station.txt",(/5,3/),
> "float")
> printVarSummary(stain )
> lat1 = stain(:,1)
> lon1 = stain(:,2)
>
> lon = fspan(89, 98, 10) ;I output is 1.0*1.0
> nlon = dimsizes( lon)
> print(lon)
> lat = fspan(32, 36, 5)
> nlat = dimsizes( lat)
> print(lat)
> ;============================================================== ;
> grid =new((/nlat,nlon,ntim/),typeof(xObs))
> do nmo =0,ntim-1
> zVal = xObs(nmo,:)
> rscan = (/5,3,2,1,0.5/)
> opt = True
> opt_at_zonal <mailto:opt_at_zonal> = True ; use zonal averages as a 1st
> guess
> grid(:,:,nmo) = obj_anal_ic(lon1,lat1,zVal,lon,lat, rscan,
> opt) ;line 36
> printVarSummary(grid)
> end do
> end
> -------------------------------------------------------------------------------------
>
>
>
> ------------------------------------------------------------------------
> 没有广告的终身免费邮箱,www.yeah.net <http://www.yeah.net/?from=footer>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Aug 27 2009 - 22:11:18 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 02 2009 - 12:24:39 MDT