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

Home » Public Forums » archive » 2D TO 3D ARRAY with different number of elements
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
2D TO 3D ARRAY with different number of elements [message #76730] Tue, 28 June 2011 03:25 Go to next message
AISHWARYA is currently offline  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 Go to previous message
Craig Markwardt is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: map_continents and /fill... revisted
Next Topic: Re: Reading an arbitrary profile from 2D FITS data

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

Current Time: Wed Oct 08 11:53:34 PDT 2025

Total time taken to generate the page: 0.00549 seconds