Re: Regridding routines [message #42949] |
Tue, 08 March 2005 10:52 |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
sdj@tiscali.it wrote:
> Dear All,
>
> This is an ongoing problem I cannot seem to solve.
>
> I have some data in array a = fltarr(4320, 2160) which I need to regrid
> to an array b = fltarr(4096, 2048).
>
> The data in 'a' are ocean related with valid values appearing only on
> the sea pixels, all land pixels are set to some default value (say
> -9999.0).
>
> All the methods I tried using to regrid the data introduce a
> substantial error.
>
Hi,
I am not sure that this is an answer to your question, but if all you
want to do is resize then you could perform the following.
;make up dummy data
nX = 200L
nY = 300L
x = Hanning(nX, nY)
;assign a portion of the data the not-a-number value
x[Lindgen((nX*nY)*0.25)] = !Values.F_NAN
;resize the data array
y = CONGRID(x, nX, nY + 0.3*nY,/INTERP)
;show the data
tv, bytscl(x, /NAN)
tv, bytscl(y,/NAN), nx+10,0
If you need more sophisticated gridding - then you should look into
Grid_Input and GridData.
Hope this is helpful,
Ben
|
|
|