Re: gridding GOES data

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 12 2010 - 17:42:31 MST

Hi Scott

The GOES files has 1,665,352 irregularly spaced observations.
There is a very high density.

The 0.01x0.01 grid that you specified leads to

     mlon=1713 nlat=1193 mlon*nlat=2,043,609

so 1.67 million observations interpolated to 2 million grid points.
There is no magic ... it takes time to do the interpolation.

I wrote a fortran subroutine that does what I call
'iterative improvement' interpolation. In the sample case,
  I did only one iteration. :-)

The attached *test* NCL script took 841 seconds to
read/interpolate/plot/create netCDF. The interpolation
took 815 seconds. The coarser the grid, the faster the interpolation.
I will look at the fortran to see if it can speeded up but, I'm sure,
it is already significantly faster that natgrid.

Plots:
original data: http://www.cgd.ucar.edu/~shea/goes_test-0.png
gridded data: http://www.cgd.ucar.edu/~shea/goes_test-1.png

I will send you the test script and the sample netCDF offline.

Good luck
D

On 01/08/2010 06:21 PM, Scott Capps wrote:
> 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
>

-- 
======================================================
Dennis J. Shea                  tel: 303-497-1361    |
P.O. Box 3000                   fax: 303-497-1333    |
Climate Analysis Section                             |
Climate&  Global Dynamics Div.                       |
National Center for Atmospheric Research             |
Boulder, CO  80307                                   |
USA                        email: shea 'at' ucar.edu |
======================================================
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jan 12 17:44:09 2010

This archive was generated by hypermail 2.1.8 : Fri Jan 15 2010 - 13:51:45 MST