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

Home » Public Forums » archive » displaying an image in simple geographic coordinates
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
displaying an image in simple geographic coordinates [message #54165] Thu, 24 May 2007 13:44 Go to next message
Matt[1] is currently offline  Matt[1]
Messages: 23
Registered: December 2006
Junior Member
does anyone know how i can display an image in simple geographic
coordinates using IDL? all documentation that i have read deals with
reprojection images to various projections or reprojecting a window to
a given image's projection. geographic coordinates is never listed as
an option in any of these functions. maybe it's because i'm dealing
with cartesian coordinates not a projected space per se? but my data
is in lat/lon wgs84 and i need to plot point data that is in decimal
degrees (wgs84) as well. any suggestions?

matt
Re: displaying an image in simple geographic coordinates [message #54224 is a reply to message #54165] Fri, 25 May 2007 13:54 Go to previous messageGo to next message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Matt wrote:
> does anyone know how i can display an image in simple geographic
> coordinates using IDL? all documentation that i have read deals with
> reprojection images to various projections or reprojecting a window to
> a given image's projection. geographic coordinates is never listed as
> an option in any of these functions. maybe it's because i'm dealing

In IDL, the default projection is cylindrical, which is (almost) the
same thing as what you're calling geographic coordinates. In this
projection, the x coordinate is the longitude in radians, and the y
coordinate is the latitude in radians.

IDL> map_set, /continents, /grid
IDL> print,map_proj_forward([-90,90],[-45,45])*!RADEG
-89.999995 -44.999998
89.999995 44.999998

You can also use MAP_PROJ_INIT, but you have to override the default
sphere radius:

IDL> proj = MAP_PROJ_INIT('Equirectangular', SPHERE_RADIUS=1.0)
IDL> print,map_proj_forward([-90,90],[-45,45],map_structure=proj) *!
RADEG
-89.999995 -44.999998
89.999995 44.999998

Alternatively, you could simplify by building the conversion factor
into the projection itself:
IDL> proj = MAP_PROJ_INIT('Equirectangular', SPHERE_RADIUS=!RADEG)
IDL> print,map_proj_forward([-90,90],
[-45,45],map_structure=proj)
-89.999995 -44.999998
89.999995 44.999998
Re: displaying an image in simple geographic coordinates [message #54282 is a reply to message #54165] Tue, 29 May 2007 10:36 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Matt wrote:
> Any reason why my !RADEG values appear to be different than the ones
> posted above? When I run the same commands I get different results:
>
> IDL> map_set, /continents, /grid
> IDL> print,map_proj_forward([-90,90],[-45,45])*!RADEG
> -90.000001 -45.000001
> 90.000001 45.000001
>
> Not a huge difference but it seems to me like the conversion factor
> should be the same, right?

This looks like a floating point round-off error to me. See <http://
www.dfanning.com/math_tips/sky_is_falling.html> for relevant
information. We are probably running on different platforms. I
performed that test on my Linux desktop machine; where "uname -srvmp"
gives:

Linux 2.4.21-47.EL #1 Tue Aug 1 08:56:24 EDT 2006 i686 i686

If you're using a different platform, then it's quite feasible for
your round-off errors to be a little different from the ones I get on
my machine.
Re: displaying an image in simple geographic coordinates [message #54284 is a reply to message #54224] Tue, 29 May 2007 08:19 Go to previous message
Matt[1] is currently offline  Matt[1]
Messages: 23
Registered: December 2006
Junior Member
Any reason why my !RADEG values appear to be different than the ones
posted above? When I run the same commands I get different results:

IDL> map_set, /continents, /grid
IDL> print,map_proj_forward([-90,90],[-45,45])*!RADEG
-90.000001 -45.000001
90.000001 45.000001

Not a huge difference but it seems to me like the conversion factor
should be the same, right?

Matt
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL GLT creation.
Next Topic: Changing the labels orientation

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

Current Time: Wed Oct 08 15:27:06 PDT 2025

Total time taken to generate the page: 0.11119 seconds