Need to use GRIDDATA instead of CONGRID? [message #69034] |
Wed, 16 December 2009 22:22 |
Tim B
Messages: 4 Registered: December 2009
|
Junior Member |
|
|
I've been happily using CONGRID for upscaling an array of sea
temperatures at 1/2 degree latitude and longitude intervals to 1/8
degree (to match some data from elsewhere which is at 1/8 degree
intervals). To provide a code example, say:
dims = size(sst, /dimensions)
sst_regrid = congrid(sst, 4*dims[0], 4*dims[1], /center)
This gives me essentially a 4x version of the original array with no
interpolation. However, the end algorithm I'm working on now requires
that I interpolate the temperature values. With the land values set to
NaN, the following
produces a 4x interpolation:
...
sst_regrid = congrid(sst, 4*dims[0], 4*dims[1], /center, /interp)
BUT the array values that neighbour the NaN values are also being set
to NaN, and thus my landmask is effectively growing - quite visible in
some images. I would much rather that any value that neighbours a NaN
simply retain the value it had in the first way I used congrid().
Conceivably I could do a tweak to congrid.pro, or replace any values
from the second call that are NaN with their non-NaN equivalents from
the first call, or is there a simpler way - maybe using GRIDDATA?
Curiously, doing a search on 'griddata' produces *no* results with the
google group search for idl-pvwave but I'm sure there must be threads
that reference it. The IDL reference page for GRIDDATA requires
extremely strong coffee...
Tim Burgess
Coral Reef Watch
Satellite Applications and Research - NESDIS
National Oceanic and Atmospheric Administration
http://www.coralreefwatch.noaa.gov
675 Ross River Rd, Kirwan QLD Australia 4817
|
|
|