2D TO 3D ARRAY with different number of elements [message #76730] |
Tue, 28 June 2011 03:25  |
AISHWARYA
Messages: 9 Registered: June 2011
|
Junior Member |
|
|
Hi IDL Users,
I was trying to convert a 2d array into 3d array. I tried congrid,
rebin and reform but couldn't succeed as the number of elements in the
final array was different. I have a 512*512 pixel data from Telescope.
I need to shift from Earth centre to Venus centre. Since the rpesent
data is in 2 dimension, I will have to convert it to 3 dimension with
the third dimension as distance between Earth's centre and Venus's
centre. Centre of the venus disc is 0.345 AU from Earth. So, how do I
now shift the z axis such that it matches with (0,0,0 ) of venus
centre.
Any help would be appreciated!
Thank you in advance,
Aishwarya.
|
|
|
Re: 2D TO 3D ARRAY with different number of elements [message #76770 is a reply to message #76730] |
Mon, 04 July 2011 21:07  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Jun 28, 6:25 am, AISHWARYA <spacea...@gmail.com> wrote:
> Hi IDL Users,
>
> I was trying to convert a 2d array into 3d array. I tried congrid,
> rebin and reform but couldn't succeed as the number of elements in the
> final array was different. I have a 512*512 pixel data from Telescope.
> I need to shift from Earth centre to Venus centre. Since the rpesent
> data is in 2 dimension, I will have to convert it to 3 dimension with
> the third dimension as distance between Earth's centre and Venus's
> centre. Centre of the venus disc is 0.345 AU from Earth. So, how do I
> now shift the z axis such that it matches with (0,0,0 ) of venus
> centre.
It's not clear if you want to make a 3D surface plot from 2D data, or
rebin a 2D array into a 3D array.
Rebinning is best done with a statement like this,
arr_new = rebin(reform(arr_old,nx_old,ny_old,1) , nx_new, ny_new,
nz_new)
The use of REFORM() is necessary to force IDL to think of a NXxNy 2D
arra as a NXxNYx1 3D array.
Making a 3D surface plot will depend a lot on what your map projection
is to begin with.
Craig
|
|
|