Re: Need to use GRIDDATA instead of CONGRID? [message #69029] |
Thu, 17 December 2009 02:43 |
rogass
Messages: 200 Registered: April 2008
|
Senior Member |
|
|
On 17 Dez., 07:22, Tim B <tim.burg...@noaa.gov> wrote:
> 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 Administrationhttp://www.coralreefwatch.noaa.gov
> 675 Ross River Rd, Kirwan QLD Australia 4817
As I understood you don't want to stretch certain 'values such as NaN.
So maybe you have to set them 0 before the congrid call and after that
you may update the specific 4xlocations with the original values by
applying replicate_inplace...
Hope it helps
Regards
CR
|
|
|