[SciPy-User] [SciPy-user] 2d interpolation, non-regular lat/lon grid - help with delauney/natgrid??

John [H2O] washakie at gmail.com
Thu Aug 13 04:19:20 EDT 2009


I'm sorry, pleading ignorance here... 

But is my approach correct? Could you possibly provide a link to an example
where data is projected first before the interpolation? Or, alternatively, a
brief example (if only in sudo code).

I just am not sure what I am doing here is correct:

149         # In this approach we work with projected data
150         x,y = m(x,y)
151         xres,yres = res
152         newx= np.arange(m.xmin,m.xmax,(m.xmax-m.xmin)/xres)
153         newy= np.arange(m.ymin,m.ymax,(m.ymax-m.ymin)/yres)
154         Znew = mlab.griddata(x,y,z,newx,newy)

It seems to work, yes, but what do you mean there is nothing to do? Should
my 'xres' simply be the lengths of the original x,y which are lon,lat ?

Thanks again!






Robert Kern-2 wrote:
> 
> On Wed, Aug 12, 2009 at 18:06, John [H2O]<washakie at gmail.com> wrote:
>>
>>
>> Robert Kern-2 wrote:
>>>
>>> Are you using lat/lon as X/Y for griddata? Or are you projecting it
>>> first? You should project. Not seeing your code or data, I'm not sure
>>> I can diagnose what is going wrong with the interpolation.
>>>
>>> --
>>> Robert Kern
>>>
>>>
>> I have been trying to follow your suggestion of projecting first.. see
>> example later, but I'm not sure if I am doing it correctly. One question
>> is
>> how then would I return the interpolated array back to a lat/lon grid...
>> it
>> seems transform_scalar is set up to go from lat/lon TO projection. I
>> guess
>> it could be used to 'unproject' the data as well?
> 
> The output Z values will be in the same order as the inputs. There is
> nothing to do.
> 
> -- 
> Robert Kern
> 
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
>   -- Umberto Eco
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
> 

-- 
View this message in context: http://www.nabble.com/2d-interpolation%2C-non-regular-lat-lon-grid-tp24909685p24950836.html
Sent from the Scipy-User mailing list archive at Nabble.com.




More information about the SciPy-User mailing list