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

Home » Public Forums » archive » Spherical gridding at a pole
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Spherical gridding at a pole [message #4787] Tue, 25 July 1995 00:00 Go to next message
ECSPRS is currently offline  ECSPRS
Messages: 6
Registered: November 1994
Junior Member
Hi.
I'm having some problems with the TRIANGULATE function when trying to grid some
irregular data over the south pole. I have data points defined for each hour
of the day (hence each 15 deg in longitude) and for latitudes -90 to -50. So
the data looks like the spokes of a wheel radiating out from the pole. Now I
wanted to grid this and make a contour plot on top of a map of Antarctica so I
used the spherical implementation of TRIANGULATE vis;

TRIANGULATE,lon,lat,tr,SPHERE=s,FVALUE=epot,/DEGREES

Where lon, lat and epot are vector arrays of longitude, latitude and data.
This statement causes either IDL to crash or Windows to crash (wow...how
surprising). Any ideas? It just occured to me that the point -90 latitude
will appear 24 times in the array, once for each longitude. Would this help
mess things up? (I'll try taking the extra ones out out but I'd rather send
this first before disaster strikes).

I also noticed that while in the doco the GS, Limits parameters are in brackets
as optional for TRIGRID (spherical gridding mode), the command won't work
unless you put them in there.

I'm using IDL 4.0
Cheers,
Paul
Re: Spherical gridding at a pole [message #4793 is a reply to message #4787] Tue, 25 July 1995 00:00 Go to previous messageGo to next message
ECSPRS is currently offline  ECSPRS
Messages: 6
Registered: November 1994
Junior Member
In <1995Jul25.062615.28748@lugb.latrobe.edu.au> ECSPRS@LUFF.LATROBE.EDU.AU writes:

> Hi.
> I'm having some problems with the TRIANGULATE function when trying to grid some
> irregular data over the south pole. I have data points defined for each hour

[snip snip]

> surprising). Any ideas? It just occured to me that the point -90 latitude
> will appear 24 times in the array, once for each longitude. Would this help
> mess things up? (I'll try taking the extra ones out out but I'd rather send

Well lo and behold, having the south pole defined 24 times does crash
triangulate, although it would be nice if it didn't drag everything else down
with it. Sorry about this premature posting. However I'm stuck again on
TRIGRID now. Using,
con=TRIGRID(epot,[1.,1.],[-90.,-180.,-50.,180.],SPHERE=s,/DE GREES)

causes an arithmetic floating underflow error. I've changed the [1., 1.] to
larger values but no luck. 's' is a structure that has some very low values
(order 1e-19), 'epot' values are all well defined. I'm assuming the [-90.,
-180., -50., 180.] array is giving me the bounds I want to cover the polar
region. As mentioned previously, IDL doesn't let you use TRIGRID without these
two arrays. It's almost time to give up and write something to calculate lat
lons for each grid point after doing non-spherical gridding (which works).
Ok, hope I haven't served myself egg on face again
Paul
Re: spherical gridding [message #21742 is a reply to message #4787] Sun, 17 September 2000 00:00 Go to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
Hello,

The XGRID and YGRID keywords to TRIGRID will return vectors of the grid
row and column locations. That is, for example, each element of XGRID
will identify the coordinates of each column of the output grid (in your
case degrees longitude). You might consider using IDLgrSurface which
is set up to handle Z (2d array), and X and Y (vector coordinates for
grid elements).

Ben

Sylvain Carette wrote:

> Not sure if my understanding of spherical gridding correspond to the
> actual implementation in TRIANGULATE and TRIGRID function and proc.
> Running the sample code below as surface give a sine shaped surface
> while I was expecting a sphere.
> I figure that perhaps SURFACE only display "flat" surface and what I
> see is a unwarped sphere (?).
> 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...
> What do I miss?
>
> 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.
>
> 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...
>
> Here the sample code from TRIGRID example2 feeded to SURFACE:
>
>> ; 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
>>
>
> Any cues welcome thanks
>
> Sylvain Carette
> VRML designer-composer
>

--
Ben Tupper
248 Lower Round Pond Road
POB 106
Bristol, ME 04539

Tel: (207) 563-1048
Email: PemaquidRiver@tidewater.net
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: multiple delimiters
Next Topic: Vectorization question

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

Current Time: Wed Oct 08 11:37:37 PDT 2025

Total time taken to generate the page: 0.00700 seconds