ssapy_toolkit.Coordinates.unit_conversions

Functions

deg0to360(x)

Normalize angle(s) in degrees to the range [0, 360).

deg0to360array(array_)

Normalize a list/array of angles (deg) to [0, 360).

deg90to90(x)

Normalize angle(s) in degrees to the range [-90, 90].

deg90to90array(array_)

Normalize a list/array of angles (deg) to [-90, 90].

dms_to_deg(coords)

Convert degrees/minutes/seconds (DMS) to decimal degrees.

dms_to_rad(coords)

Convert degrees/minutes/seconds (DMS) to radians.

rad0to2pi(angles)

Normalize angle(s) in radians to the range [0, 2π).

ssapy_toolkit.Coordinates.unit_conversions.deg0to360(x)[source]

Normalize angle(s) in degrees to the range [0, 360).

Parameters:

x (float or array-like of float) – Angle(s) in degrees.

Returns:

Normalized angle(s) in degrees.

Return type:

float or numpy.ndarray

ssapy_toolkit.Coordinates.unit_conversions.deg0to360array(array_)[source]

Normalize a list/array of angles (deg) to [0, 360).

Parameters:

array (sequence of float or numpy.ndarray)

Returns:

Normalized angles in degrees.

Return type:

list of float

ssapy_toolkit.Coordinates.unit_conversions.deg90to90(x)[source]

Normalize angle(s) in degrees to the range [-90, 90].

Note

Uses the standard wrap formula: ((x + 90) % 180) - 90

Parameters:

x (float or array-like of float) – Angle(s) in degrees.

Returns:

Normalized angle(s) in degrees.

Return type:

float or numpy.ndarray

ssapy_toolkit.Coordinates.unit_conversions.deg90to90array(array_)[source]

Normalize a list/array of angles (deg) to [-90, 90].

Parameters:

array (sequence of float or numpy.ndarray)

Returns:

Normalized angles in degrees.

Return type:

list of float

ssapy_toolkit.Coordinates.unit_conversions.dms_to_deg(coords)[source]

Convert degrees/minutes/seconds (DMS) to decimal degrees.

Parameters:

coords (str or sequence of str) – A single DMS string or a list/tuple of such strings.

Returns:

Angle(s) in degrees.

Return type:

float or list of float

ssapy_toolkit.Coordinates.unit_conversions.dms_to_rad(coords)[source]

Convert degrees/minutes/seconds (DMS) to radians.

Parameters:

coords (str or sequence of str) – A single DMS string (e.g., ‘30d30m30s’, ‘45d’) or a list/tuple of such strings.

Returns:

Angle(s) in radians.

Return type:

float or list of float

ssapy_toolkit.Coordinates.unit_conversions.rad0to2pi(angles)[source]

Normalize angle(s) in radians to the range [0, 2π).

Parameters:

angles (float or array-like of float) – Angle(s) in radians.

Returns:

Normalized angle(s) in radians.

Return type:

float or numpy.ndarray