7 Cylindrical cut of a warp (example07.py)

from Nbody import *
import RandomArray

'''
display the vertical position of particles as a function of the
azimuthal angle of a warped galaxy, for a radial slice
at 20 kpc.
'''
 
nb = Nbody('warp.dat') 

# compute distance to the center
r = sqrt(nb.pos[:,0]**2 + nb.pos[:,1]**2 + nb.pos[:,2]**2)

# select particles in a radial slice
c = (r>19)*(r<21)
nb = nb.selectc(c)


# compute azimuth
t = arctan2(nb.pos[:,1],nb.pos[:,0])

# change values of pos : replace x by azimut
nb.pos[:,0] = t


nb.show(size=(pi,20),view='xz',filter_name='convol',
filter_opts=[10,10,3,3],scale='log',mn=0,mx=0)

See About this document... for information on suggesting changes.