[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TRIGRID problem



Cathy Smith (cas@cdc.noaa.gov) writes:

> I ran into a problem using TRIGRID to interpolate an array from 36x16 to 72x16
> on a sphere. I have the two lines
> 
> triangulate,xlon1,xlat1,tr,FVALUE=slp1,sphere=s,/degrees
> 
> z=trigrid(slp1,[0.,0.],[0.,15.,355.,90.],NX=72,NY=16,/degrees,sphere=s)
> 
> This did not work and gave me the error
> 
> % TRIGRID: Points are co-linear, no solution.
> 
> However, using 354.99 instead of 355 gave me the correctly interpolated
> grid and no error.
> 
> I think I followed the directions correctly (and in fact I tried setting
> GS to 5x5 and other similar
> permutations but got the same error).
> 
> Does anyone know why?

I'm going to guess the infamous round-off error
related to the way computers store numbers. But
this is a useful trick to work around this frequent
problem. I've tried scaling the data before gridding,
etc. Lot's of things work. Sorta. :-)

Cheers,

David
-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155