displaying an image in simple geographic coordinates [message #54165] |
Thu, 24 May 2007 13:44  |
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   |
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  |
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  |
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
|
|
|