spherical gridding [message #21747] |
Sun, 17 September 2000 00:00  |
Sylvain Carette
Messages: 19 Registered: May 2000
|
Junior Member |
|
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Not sure if my understanding of spherical gridding correspond to the actual
implementation in TRIANGULATE and TRIGRID function and proc.
<br>Running the sample code below as surface give a sine shaped surface
while I was expecting a sphere.
<br>I figure that perhaps SURFACE only display "flat" surface and what
I see is a unwarped sphere (?).
<br>I though it would be better to feed the trigrid output to a polygon
as in IDLgrPolygon but now this one want xyz value while as far I can see
trigrid result is 2 dimentional array...
<br>What do I miss?
<p>My intend here is to project elevations grids onto wgs84 geoid but projecting
onto a perfect sphere will be just fine to begin with. If I'm unclear,
I need the final dem be patch of a sphere so that when putting all of them
together they form a globe and the cartesian space holding it have its
origin at the center of the globe.
<p>I've done once an autolisp function in Autocad doing this but the dem
have to be converted first to dxf in no more than 300x300 chunk and it
do not handle the case for dems that are not in long/lat proj. Very, very
big and slow...
<p>Here the sample code from TRIGRID example2 feeded to SURFACE:
<blockquote TYPE=CITE>
<pre>; Create some random longitude points:
lon = RANDOMU(seed, 50) * 360. - 180.
; Create some random latitude points:
lat = RANDOMU(seed, 50) * 180. - 90.
; Make a fake function value to be passed to FVALUE. The system
; variable !DTOR contains the conversion value for degrees to
; radians.
f = SIN(lon * !DTOR)^2 * COS(lat * !DTOR)
; Perform a spherical triangulation:
TRIANGULATE, lon, lat, tr, $
SPHERE=s, FVALUE=f, /DEGREES
; Perform a spherical triangulation using the values returned from
; TRIANGULATE. The result, r, is a 180 by 91 element array:
r=TRIGRID(f, SPHERE=s, [2.,2.],$
[-180.,-90.,178.,90.], /DEGREES)
surface, r
end</pre>
</blockquote>
<p><br>Any cues welcome thanks
<p>Sylvain Carette
<br>VRML designer-composer
<br> </html>
|
|
|
Re: Spherical gridding [message #35472 is a reply to message #21747] |
Thu, 19 June 2003 15:31   |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Thu, 19 Jun 2003 10:11:59 -0700, Ben Tupper wrote:
> Paul van Delst wrote:
>> Ben Tupper wrote:
>>
>>> Liam Gumley wrote:
>>>
>>>> It's not included in my SGI version of IDL 5.5.
>>>>
>>>>
>>> That's odd. The documentation for IDL 5.6 says it was introduced in
>>> version 5.5. I don't see any mention of its absence in the What's New
>>> in IDL 5.5 (which I happen to have handy.) Have your explored this
>>> with RSI?
>>
>>
>> I though my linux install didn't have it:
>>
>> IDL> print, !version
>> { x86 linux unix linux 5.5a Feb 7 2002 32 32}
>>
>> until I noticed that the help that comes with my 5.5a on my system is
>> the 5.4 docs!
>>
>> But:
>>
>> IDL> result=griddata(x,y)
>> % Loaded DLM: QHULL.
>> % GRIDDATA: Expression must be an array in this context: X. % Execution
>> halted at: $MAIN$
>>
>> indicates that there's *something* there. Too bad I can't look at the
>> help to have a lookee. Makes me wonder what else I've missed.....well,
>> not too much. My "What's new in IDL 5.6" book is still in the
>> shrink-wrap!
>>
>> I seem to recall a discussion about non-updated online documentation a
>> while back....is this what folks were referring to? Or could this just
>> be due to a screwed up installation om my part?
>>
>> paulv
>>
>>
> This is the problem caused by the funny update to online documention in
> the 5.4 to 5.5 upgrade. The online docs for IDL 5.6 are superior in
> terms of content. I struggle with searching on a Mac OSX online help
> since the PDF format doesn't provide the nice IDL> ?widget_list
> functionality. CoolHelp can work on IDL 5.6 - but it has dated content.
> See http://www.dfanning.com/misc_tips/nohelp.html for the story.
>
> I have not made the switch to IDLWAVE (sorry, JD!) - I am a part-timer
> right now and can't seem to bridge the M-X C-Q, etc. keystrokes and get
> work done. I drool over IDLWAVE's slick online help system - but
> alas...
>
>
I should probably write up a little tutorial called "IDLWAVE for the
keystroke-aphobic". As it turns out, you really can do almost
everything (including HTML context-sensitive help lookup) using menu
items and buttons. The same can be said for Emacs in general,
especially starting with version 21. E.g., I can do:
x=gridd[menu IDLWAVE->Completion->Complete]
x=griddata([menu IDLWAVE->Routine Info->Online Context Help]
and up pops:
GRIDDATA
The GRIDDATA function interpolates scattered data values and
locations sampled on a plane or a sphere to a regular grid. This is
accomplished using one of several available methods. The function
result is a two-dimensional floating point array. Computations are
performed in single precision floating point. Interpolation methods
supported by this function are as follows:
So you see, you don't actually need to learn all the silly keystrokes,
which must blend into a vaguely irritating white-noise appearance in
postings and documentation. You can get your feet wet without ever
touching the Meta key!
JD
|
|
|
|
Re: Spherical gridding [message #35478 is a reply to message #21747] |
Thu, 19 June 2003 12:14   |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
"Paul van Delst" <paul.vandelst@noaa.gov> wrote in message
news:3EF1E5AD.AE0BC585@noaa.gov...
> Ben Tupper wrote:
>>
>> Liam Gumley wrote:
>>> It's not included in my SGI version of IDL 5.5.
>>>
>>
>> That's odd. The documentation for IDL 5.6 says it was introduced in
>> version 5.5. I don't see any mention of its absence in the What's New
>> in IDL 5.5 (which I happen to have handy.) Have your explored this with
>> RSI?
>
> I though my linux install didn't have it:
>
> IDL> print, !version
> { x86 linux unix linux 5.5a Feb 7 2002 32 32}
>
> until I noticed that the help that comes with my 5.5a on my system is the
5.4 docs!
>
> But:
>
> IDL> result=griddata(x,y)
> % Loaded DLM: QHULL.
> % GRIDDATA: Expression must be an array in this context: X.
> % Execution halted at: $MAIN$
>
> indicates that there's *something* there. Too bad I can't look at the help
to have a
> lookee. Makes me wonder what else I've missed.....well, not too much. My
"What's new in
> IDL 5.6" book is still in the shrink-wrap!
>
> I seem to recall a discussion about non-updated online documentation a
while back....is
> this what folks were referring to? Or could this just be due to a screwed
up installation
> om my part?
It turns out I *do* have it in IDL 5.5 for SGI, and it's documented in the
printed version of "What's New in IDL 5.5" (pp. 228-252), but I can't find
an online PDF version of the document.
IDL Version 5.5 (IRIX mipseb). (c) 2001, Research Systems, Inc.
IDL> help, griddata(findgen(20, 20), dist(20))
% Compiled module: DIST.
% Loaded DLM: QHULL.
% GRIDDATA: Leading coordinate dimension must be 2.
% Execution halted at: $MAIN$
IDL>
Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
|
|
|
Re: Spherical gridding [message #35481 is a reply to message #21747] |
Thu, 19 June 2003 11:45   |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
Liam,
I just checked IDL and the docs. It is documented in 'What's new in IDL 5.5'
on page 228 and works fine in IDL 5.5 and 5.6, as well as 6.0 beta. I found
a bug with griddata that crashes IDL in a certain keyword combination if you
try to interpolate data poleward of the highest latitude data value. It is
logged with RSI and will be fixed. However, on UNIX the error does not occur
and most people will probably never notice this one!
Haje
--
Dr. Haje Korth
Space Physics Group
The Johns Hopkins University
Applied Physics Laboratory
MS MP3-E128
11100 Johns Hopkins Road
Laurel, MD 20723-6099
USA
Phone: 240-228-4033 (Washington), 443-778-4033 (Baltimore)
Fax: 240-228-0386 (Washington), 443-778-0386 (Baltimore)
e-mail: haje.korth@jhuapl.edu
"Liam Gumley" <Liam.Gumley@ssec.wisc.edu> wrote in message
news:bcsi25$nhd$1@news.doit.wisc.edu...
> It's not included in my SGI version of IDL 5.5.
>
> Cheers,
> Liam.
> Practical IDL Programming
> http://www.gumley.com/
>
> "Haje Korth" <haje.korth@jhuapl.edu> wrote in message
> news:bcs8ba$24n$1@houston.jhuapl.edu...
>> I am using "griddata", which has been included with IDL since version
5.5.
>> It is much more powerful than sph_sct.
>>
>> Haje
>>
>>
>> --
>>
>> "Elias J. Hunter" <hunter@imcs.rutgers.edu> wrote in message
>> news:3EF0A470.1080008@imcs.rutgers.edu...
>>> Hello,
>>>
>>> I have a matrix of surface pressure north of 60N, that is currently on
a
>>> gaussian lat-lon grid. My goal is to interpolate this grid to a one
>>> degree by one degree lat-lon grid. Now when I attempt this using
>>> sph_sct, the field south of 75 degrees lat looks good, the grid north
of
>>> 75 degrees lat is a mess.
>>>
>>> My guess is that the longitudinal resolution north of 75 degrees on
the
>>> new grid is so fine relative to the old grid, its creating a problem.
I
>>> suppose it could also be becasue I'm getting closer to the singularity
>>> at the pole.
>>>
>>> Has anybody addressed a similar difficulty using sph_scat?
>>>
>>> Thanks,
>>> Eli
>>>
>>
>>
>
>
|
|
|
Re: Spherical gridding [message #35482 is a reply to message #21747] |
Thu, 19 June 2003 11:42   |
Haje Korth
Messages: 651 Registered: May 1997
|
Senior Member |
|
|
Eli,
There are about a million different keyword combinations. It took me a
couple of days to find the right combination for my application. How long
have you tried before you came to the conclusion theat the routine is
poor???
Haje
PS: I am glad that you found a way around the physics on a sphere problem.
"hunter" <elhunter@rci.rutgers.edu> wrote in message
news:3ef1d88d$1@rutgers.edu...
> I tried griddata using keywords for spherical gridding, but the results
were
> poor. However, assuming the lat lon coordinates were cartesian. gave a
much
> better representation of the data (visually).
>
> Eli
>
>
> "Haje Korth" <haje.korth@jhuapl.edu> wrote in message
> news:bcs8ba$24n$1@houston.jhuapl.edu...
>> I am using "griddata", which has been included with IDL since version
5.5.
>> It is much more powerful than sph_sct.
>>
>> Haje
>>
>>
>> --
>>
>> "Elias J. Hunter" <hunter@imcs.rutgers.edu> wrote in message
>> news:3EF0A470.1080008@imcs.rutgers.edu...
>>> Hello,
>>>
>>> I have a matrix of surface pressure north of 60N, that is currently on
a
>>> gaussian lat-lon grid. My goal is to interpolate this grid to a one
>>> degree by one degree lat-lon grid. Now when I attempt this using
>>> sph_sct, the field south of 75 degrees lat looks good, the grid north
of
>>> 75 degrees lat is a mess.
>>>
>>> My guess is that the longitudinal resolution north of 75 degrees on
the
>>> new grid is so fine relative to the old grid, its creating a problem.
I
>>> suppose it could also be becasue I'm getting closer to the singularity
>>> at the pole.
>>>
>>> Has anybody addressed a similar difficulty using sph_scat?
>>>
>>> Thanks,
>>> Eli
>>>
>>
>>
>
>
|
|
|
|
|
|
Re: Spherical gridding [message #35490 is a reply to message #21747] |
Thu, 19 June 2003 08:35   |
hunter
Messages: 9 Registered: June 2003
|
Junior Member |
|
|
I tried griddata using keywords for spherical gridding, but the results were
poor. However, assuming the lat lon coordinates were cartesian. gave a much
better representation of the data (visually).
Eli
"Haje Korth" <haje.korth@jhuapl.edu> wrote in message
news:bcs8ba$24n$1@houston.jhuapl.edu...
> I am using "griddata", which has been included with IDL since version 5.5.
> It is much more powerful than sph_sct.
>
> Haje
>
>
> --
>
> "Elias J. Hunter" <hunter@imcs.rutgers.edu> wrote in message
> news:3EF0A470.1080008@imcs.rutgers.edu...
>> Hello,
>>
>> I have a matrix of surface pressure north of 60N, that is currently on a
>> gaussian lat-lon grid. My goal is to interpolate this grid to a one
>> degree by one degree lat-lon grid. Now when I attempt this using
>> sph_sct, the field south of 75 degrees lat looks good, the grid north of
>> 75 degrees lat is a mess.
>>
>> My guess is that the longitudinal resolution north of 75 degrees on the
>> new grid is so fine relative to the old grid, its creating a problem. I
>> suppose it could also be becasue I'm getting closer to the singularity
>> at the pole.
>>
>> Has anybody addressed a similar difficulty using sph_scat?
>>
>> Thanks,
>> Eli
>>
>
>
|
|
|
|
|
|
Re: Spherical gridding [message #35560 is a reply to message #35490] |
Fri, 20 June 2003 11:06  |
hunter
Messages: 9 Registered: June 2003
|
Junior Member |
|
|
Haje,
In the interest of completeness. I delved into griddata more thoroughly and,
of course, found that I had been a bit lax initially. Griddata works fine in
this application. Thanks for the pointer.
Interestingly, comparing the two resulting fields, one adhereing to
spherical coordinates and one approximating the sphere with cartesian
coordinates, the results are quite similar(using linear interpolation in
both cases). In fact, the difference in the resulting fields is, at most, 1%
of the minimm value of the original field. Typically, the difference is at
0.01%.
As for having "found a way around the physics", both methods generate
geometric approximations to a real field, not physical models. It just a
matter of establishing the error tolerances of the application.
Eli
"hunter" <elhunter@rci.rutgers.edu> wrote in message
news:3ef1d88d$1@rutgers.edu...
> I tried griddata using keywords for spherical gridding, but the results
were
> poor. However, assuming the lat lon coordinates were cartesian. gave a
much
> better representation of the data (visually).
>
> Eli
>
>
> "Haje Korth" <haje.korth@jhuapl.edu> wrote in message
> news:bcs8ba$24n$1@houston.jhuapl.edu...
>> I am using "griddata", which has been included with IDL since version
5.5.
>> It is much more powerful than sph_sct.
>>
>> Haje
>>
>>
>> --
>>
>> "Elias J. Hunter" <hunter@imcs.rutgers.edu> wrote in message
>> news:3EF0A470.1080008@imcs.rutgers.edu...
>>> Hello,
>>>
>>> I have a matrix of surface pressure north of 60N, that is currently on
a
>>> gaussian lat-lon grid. My goal is to interpolate this grid to a one
>>> degree by one degree lat-lon grid. Now when I attempt this using
>>> sph_sct, the field south of 75 degrees lat looks good, the grid north
of
>>> 75 degrees lat is a mess.
>>>
>>> My guess is that the longitudinal resolution north of 75 degrees on
the
>>> new grid is so fine relative to the old grid, its creating a problem.
I
>>> suppose it could also be becasue I'm getting closer to the singularity
>>> at the pole.
>>>
>>> Has anybody addressed a similar difficulty using sph_scat?
>>>
>>> Thanks,
>>> Eli
>>>
>>
>>
>
>
|
|
|