clustertools.util.coordinates module

For changing coordinate systems

Designed to accept StarCluster instance as in put to calculate stellar positions and velocities in different coordinates

clustertools.util.coordinates.cart_to_cyl(x, y, z, vx, vy, vz)[source]

Convert cartesian coordinates to cylindrical coordinates

Parameters:
x,y,z,vx,vy,vzfloat

positions and velocities in cartesian coordinates

Returns:
r, theta, z, vr, vtheta, vzfloat

stellar positions and velocities in cylindrical coordinates

clustertools.util.coordinates.cart_to_sky(x, y, z, vx, vy, vz, ro=8.275, vo=239.23725000000002, solarmotion=[-11.1, 12.24, 7.25])[source]

Convert cartesian coordinates to sky coordinates

Parameters:
x,y,z,vx,vy,vzfloat

positions and velocities in cartesian coordinates

Returns:
ra,dec,d0,pmra,pmdec,vr0float

on-sky positions and velocities

clustertools.util.coordinates.cart_to_sphere(x, y, z, vx, vy, vz)[source]

Convert cartesian coordinates to spherical coordinates

Parameters:
x,y,z,vx,vy,vzfloat

positions and velocities in cartesian coordinates

Returns:
r,theta,phi,vr,vtheta,vphifloat

positions and velocities in spherical coordinates

clustertools.util.coordinates.cyl_coords(cluster)[source]

Get the cylindrical coordinates of every star in the cluster

Parameters:
clusterclass

StarCluster

Returns:
r, theta, z, vr, vtheta, vzfloat

stellar positions and velocities in cylindrical coordinates

clustertools.util.coordinates.cyl_to_cart(r, theta, zed, vr, vtheta, vz)[source]

Convert cylindrical coordinates to cartesian coordinates

Parameters:
r, theta, z, vr, vtheta, vzfloat

stellar positions and velocities in cylindrical coordinates

Returns:
x,y,z,vx,vy,vzfloat

positions and velocities in cartesian coordinates

clustertools.util.coordinates.sky_coords(cluster, ro=8.275, vo=239.23725000000002, solarmotion=[-11.1, 12.24, 7.25], zo=0.0208)[source]

Get the sky coordinates of every star in the cluster

Parameters:
clusterclass

StarCluster

Returns:
ra,dec,d0,pmra,pmdec,vr0float

on-sky positions and velocities of cluster stars

clustertools.util.coordinates.sphere_coords(cluster)[source]

Get the spherical coordinates of every star in the cluster

Parameters:
clusterclass

StarCluster

Returns:
r,theta,phi,vr,vtheta,vphifloat

stellar positions and velocities in spherical coordinates

clustertools.util.coordinates.sphere_to_cart(r, phi, theta, vr, vphi, vtheta)[source]

Convert cartesian coordinates to spherical coordinates

Parameters:
x,y,z,vx,vy,vzfloat

positions and velocities in cartesian coordinates

Returns:
r,theta,phi,vr,vtheta,vphifloat

positions and velocities in spherical coordinates