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

Home » Public Forums » archive » Map an image onto a sphere
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
Map an image onto a sphere [message #90903] Mon, 11 May 2015 11:22 Go to next message
joellama is currently offline  joellama
Messages: 8
Registered: July 2013
Junior Member
Hi all,

I'm sure this has been answered before but I can't find the answer. I have an array that is 360 x 180 and I want to project it onto a sphere for display purposes. I've had success using the Molleweide projection with the documentation


arr = randomu(seed, [360, 180])
mollmap = IMAGE(arr, $
LIMIT=[-90,-180,90,180], GRID_UNITS=2, $
IMAGE_LOCATION=[-180,-90], IMAGE_DIMENSIONS=[360,180], $
MAP_PROJECTION='Mollweide', rgb_table=13)

But I can't seem to change it so that the projection is onto a sphere instead. Any help would be greatly appreciated. I would also ideally like to be able to specify the central longitude and latitude.

Thanks!
Re: Map an image onto a sphere [message #90930 is a reply to message #90903] Thu, 14 May 2015 07:27 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Monday, May 11, 2015 at 12:23:02 PM UTC-6, Joe Llama wrote:
> Hi all,
>
> I'm sure this has been answered before but I can't find the answer. I have an array that is 360 x 180 and I want to project it onto a sphere for display purposes. I've had success using the Molleweide projection with the documentation
>
>
> arr = randomu(seed, [360, 180])
> mollmap = IMAGE(arr, $
> LIMIT=[-90,-180,90,180], GRID_UNITS=2, $
> IMAGE_LOCATION=[-180,-90], IMAGE_DIMENSIONS=[360,180], $
> MAP_PROJECTION='Mollweide', rgb_table=13)
>
> But I can't seem to change it so that the projection is onto a sphere instead. Any help would be greatly appreciated. I would also ideally like to be able to specify the central longitude and latitude.
>
> Thanks!

Can you use a Stereographic projection?

arr = randomu(seed, [360, 180])
mollmap = IMAGE(arr, $
CENTER_LONGITUDE=-105, $
LIMIT=[-90,-185,90,-15], GRID_UNITS=2, $
IMAGE_LOCATION=[-180,-90], IMAGE_DIMENSIONS=[360,180], $
MAP_PROJECTION='Stereographic', rgb_table=13)
m = MapContinents(FILL_COLOR='gray')

If you change the center lon/lat, you will need to mess with the LIMIT to restrict it to a single hemisphere. Otherwise it starts to look really crazy because of the projection.

Cheers,
Chris
Re: Map an image onto a sphere [message #90937 is a reply to message #90903] Thu, 14 May 2015 21:59 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Monday, May 11, 2015 at 3:23:02 PM UTC-3, Joe Llama wrote:
>
> But I can't seem to change it so that the projection is onto a sphere instead. Any help would be greatly appreciated. I would also ideally like to be able to specify the central longitude and latitude.


It all depends on what you mean by "project onto a sphere". I would say that when you use any map projection (Mollweide included, as you did) you are projection onto a sphere.

I guess you only need to pick the projection you want, and figure out the parameters to pass to map(), since each of IDL's many map projections is defined by a different set of parameters:

http://www.exelisvis.com/docs/map_proj_init.html

And here are a few examples

http://www.exelisvis.com/docs/mapProjections.html

This may also help choose the projection (note that some projections have more than one name, so the names may differ between IDL and Wikipedia).

My best guesses for the projection you want are stereographic (Chris' reply), orthographic, or perspective.
Re: Map an image onto a sphere [message #90938 is a reply to message #90937] Thu, 14 May 2015 22:01 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Friday, May 15, 2015 at 1:59:47 AM UTC-3, Paulo Penteado wrote:
> This may also help choose the projection (note that some projections have more than one name, so the names may differ between IDL and Wikipedia).

"This" was referring to this link:
http://en.wikipedia.org/wiki/List_of_map_projections
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: % Program caused arithmetic error: Floating illegal operand
Next Topic: Re: Help extracting a single column from dat file

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

Current Time: Wed Oct 08 07:25:34 PDT 2025

Total time taken to generate the page: 0.00486 seconds