Map an image onto a sphere [message #90903] |
Mon, 11 May 2015 11:22  |
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   |
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   |
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.
|
|
|
|