comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Regridding routines
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Regridding routines [message #42971] Sat, 05 March 2005 08:49
sdj is currently offline  sdj
Messages: 20
Registered: November 2003
Junior Member
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.

I assume the problem lies in the fact that all regridding
(interpolation) functions always take into account the non-valid (land)
values. I can minimize this effect by setting their value equal to
zero, but this still does not solve the problem. What I would like is
to have the opportunity of setting the non-valid values to say a NaN,
and then having the functionality of /NaN keyword in a regridding
function (just like the 'total' function)

Here are some examples of the errors I introduce:

a_v = where(a GT 0.0,complement = a_nv)
a(a_nv) = 0.0
print, mean(a(a_v))
-> 0.307170

Say I use the 'expand' function:
expand, a, 4096, 2048, b
b_v = where(b GT 0.0)
print, mean(b(b_v))
-> 0.288994

Say I use the congrid function:
c = congrid(a, 4096, 2048, /interp)
c_v = where(c GT 0.0)
print, mean(c(c_v))
--> 0.289111

Interpolate and bilinear introduce the same kind of errors.

Can anybody tell me what I need to do in order to regrid safely without
introducing too much a big error due to non-valid data pixels ?

Thanks in advance for the help.

Regards,
Pepe
[Message index]
 
Read Message
Previous Topic: Regridding routines
Next Topic: antialias fonts

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 08:08:21 PDT 2025

Total time taken to generate the page: 1.91968 seconds