Re: help on polar_surface routine [message #29798] |
Wed, 13 March 2002 05:46 |
florence.henry
Messages: 2 Registered: March 2002
|
Junior Member |
|
|
James Kuyper <kuyper@gscmail.gsfc.nasa.gov> wrote
> That looks fairly well centered to me. It isn't labelled that way, but
> that's because by default SURFACE uses the array indices as the labels
> for the x and y axes. Try the following:
thanks for the explanation ...
> zz = polar_surface(z,r,theta,/grid,bounds=bounds,spacing=spacing)
> surfsize = size(zz, /dimensions)
> xcoords = bounds(0) + spacing(0)*indgen(surfsize(0))
> ycoords = bounds(1) + spacing(1)*indgen(surfsize(1))
> surface,zz,xcoords,ycoords
...and thanks for the tip ! It works !
-----
Florence HENRY
florence.henry@obspm.fr
|
|
|
Re: help on polar_surface routine [message #29805 is a reply to message #29798] |
Tue, 12 March 2002 11:10  |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
Florence HENRY wrote:
> Hello,
>
> I'm trying to use the polar_surface routine, and I have one question about it.
> Here is the instruction I give :
> zz = polar_surface(z,r,t,missing=zmin,spacing=[ds,ds])
> r ranges between 5 and 100
> t ranges between 0 and 2*pi
>
> why the resulting zz is not centered on 0 ?
>
> For example :
>
> r=findgen(51)/50.
> theta=findgen(25)*15.*!dtor
> x=r#cos(theta)
> y=r#sin(theta)
> z=exp(-r^2)#replicate(1.,25)
> zz=polar_surface(z,r,theta,/grid)
> surface,z,x,y
> window,2
> surface,zz
>
> the "surface,z,x,y" will give a plot centered on 0
> and "surface,zz" won't.
That looks fairly well centered to me. It isn't labelled that way, but
that's because by default SURFACE uses the array indices as the labels
for the x and y axes. Try the following:
zz = polar_surface(z,r,theta,/grid,bounds=bounds,spacing=spacing)
surfsize = size(zz, /dimensions)
xcoords = bounds(0) + spacing(0)*indgen(surfsize(0))
ycoords = bounds(1) + spacing(1)*indgen(surfsize(1))
surface,zz,xcoords,ycoords
This works, even if you haven't previously defined 'bounds' and
'spacing'; in that case, polar_surface fills them in. That's something I
found out by accident when I forgot to specify them.
|
|
|