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

Home » Public Forums » archive » Vectorized versions of MAP_2POINTS and LL_ARC_DISTANCE
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
Vectorized versions of MAP_2POINTS and LL_ARC_DISTANCE [message #70402] Thu, 08 April 2010 08:05
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
Following up on my post last week, I have added ARC_AZIMUTH_KPB and
LL_ARC_AZIMUTH_KPB, which are vectorized versions of MAP_2POINTS
and LL_ARC_DISTANCE, to my shared IDL library

http://csrp.tamu.edu/downloads/idl/bowman_lib.zip

For my application these routines sped-up the calculation by a factor
of 50 compared with using loops to call the built-in routines (10 s instead of
500 s). YMMV.

For consistency and simplicity I made a number of changes to the calling
sequences (procedure names, argument lists, and keywords).

ARC_AZIMUTH_KPB computes great-circle arc distances and azimuths between
a set of initial points (x0, y0) and final points (x1, y1). This implements part
of the functionality of the built-in routine MAP_2POINTS. The other functions
of MAP_2POINTS are not implemented in ARC_AZIMUTH_KPB.

LL_ARC_AZIMUTH_KPB computes the longitudes and latitudes (x1, y1) of points that are
located given great-circle arc distances and azimuths from a set of initial
points (x0, y0). This procedure is essentially equivalent to LL_ARC_DISTANCE.

Because the procedures both return *two* quantities (arc distances and azimuths
or longitudes and latitudes), I chose to write these as procedures rather than functions.
I prefer having the output values as separate arrays, and I don't have to make
an assumption about the order of indices (n x 2 vs. 2 x n).

Variable names and units are consistent in the two new procedures.
The default unit for all angles is degrees for *both* procedures. The RADIANS keyword
can be used to specify that angles are in radians. If you want to know the
physical distance along the arcs, rather than the angular distance,
you can compute that outside of these procedures by multiplying the arc distance
by the radius of the sphere (and converting to radians, if necessary).

There are two simple test routines in the 'test' subdirectory that
compare the output of my routines with the built-in routines.

These procedures have not been tested much beyond what is in the test routines,
so if you encounter any problems, please let me know.

Enjoy, Ken
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Best way to generate arrays of coordinates for hypersurface calculations?
Next Topic: reading images stored compressed in FITS files binary extensions

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

Current Time: Wed Oct 08 16:03:00 PDT 2025

Total time taken to generate the page: 0.00549 seconds