coords¶
Coordinate transformations.
- skysegmentor.cart2sphere(x, y, z, center=[0.0, 0.0, 0.0])[source]¶
Return polar coordinates for a given set of cartesian coordinates.
- Parameters:
x (array) – x coordinate.
y (array) – y coordinate.
z (array) – z coordinate.
center (list) – Center point of polar coordinate grid.
- Returns:
r (array) – Radial coordinates.
phi (array) – Phi coordinates [0, 2pi].
theta (array) – Theta coordinates [0, pi].
- skysegmentor.sphere2cart(r, phi, theta, center=[0.0, 0.0, 0.0])[source]¶
Converts spherical polar coordinates into cartesian coordinates.
- Parameters:
r (array) – Radial distance.
phi (array) – Longitudinal coordinates (radians = [0, 2pi]).
theta (array) – Latitude coordinates (radians = [0, pi]).
center (list) – Center point of spherical polar coordinate grid.
- Returns:
x, y, z – Euclidean coordinates.
- Return type:
array