Greetings,
I am gridding a 2-D GOES dataset (not gridded) onto a fine grid: 0.01x0.01 degree using the natgrids function. The natgrids function runs forever on datasets larger than ~8MB. I must be missing something, here is my script. Any help is appreciated.
; BEGIN SCRIPT
; USAGE: ncl 'obs_yr=2010' 'dd_of_yr=3' 'dd_in_yr=365' 'filenm1="/data/scapps/goes/goes11.2010.003.200014.BAND_01.nc"' 'fl_out="test.nc"' goes_grid.ncl
;
begin
file1 = addfile(filenm1,"r")
bright = file1->data(0,:,:) ; float data(bands, lines, elems)
brite1d = ndtooned(bright)
delete(bright)
lat = file1->latitude(:,:) ; float latitude(lines,elems)
lon = file1->longitude(:,:) ; float longitude(lines,elems)
lat1d = ndtooned(lat)
lon1d = ndtooned(lon)
delete(lon)
delete(file1)
delete(lat)
; Create Regular Grid
dlon = 1./100. ;0.01 degree
dlat = 1./100. ;0.01 degree
lat1 = decimalPlaces(flt2dble(min(lat1d)),2,True)
lat2 = decimalPlaces(flt2dble(max(lat1d)),2,True)
lon1 = decimalPlaces(flt2dble(min(lon1d)),2,True)
lon2 = decimalPlaces(flt2dble(max(lon1d)),2,True)
nlon = doubletoint(abs(lon1-lon2)/dlon)+1
nlat = doubletoint(abs(lat1-lat2)/dlat)+1
londbl = fspan(lon1,lon2,nlon)
latdbl = fspan(lat1,lat2,nlat)
lat_out= doubletofloat(latdbl)
lon_out= doubletofloat(londbl)
delete(londbl)
delete(latdbl)
nnsetp("ext", 0) ;interp NOT allowed outside convex hull
nnsetp("non", 1) ;interp values are NOT allowed to be negative
nnsetp("nul",-999.0) ;Set _FillValue
;**************************************************************
; INTERP USING NATGRID:http://www.ncl.ucar.edu/Document/Functions/Built-in/natgrid.shtml
tmp1_int = natgrids(lon1d, lat1d, brite1d, lon_out, lat_out) ; Outputs as lon,lat
;**************************************************************
tmp1_int!0 = "lon"
tmp1_int!1 = "lat"
tmp1_int&lon = lon_out
tmp1_int&lat = lat_out
out1_int = tmp1_int(lat | :,lon | :)
delete(tmp1_int)
; Writeout to netCDF file...
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jan 8 18:21:21 2010
This archive was generated by hypermail 2.1.8 : Fri Jan 15 2010 - 13:51:45 MST