NSW Frame¶
rotation_nsw_to_eci builtin ¶
rotation_nsw_to_eci(x_eci: Union[ndarray, Sequence], x_sun: Union[ndarray, Sequence], axis: int = -1) -> ndarray
Computes the rotation matrix transforming a vector in the Nadir, Sun, Normal (NSW) frame to the Earth-Centered Inertial (ECI) frame.
The ECI frame can be any inertial frame centered on the orbited body, such as GCRF or EME2000.
The NSW frame follows the SANA definition: - X: Unit vector toward nadir, opposite the position vector. - Y: As close to the direction of the Sun as possible while normal to X. With s the unit vector from the spacecraft to the Sun, this is the unit vector perpendicular to x that maximizes y . s, which is the Sun direction with its X component removed and renormalized: y = (s - (s . x) x) / |s - (s . x) x|. - Z: X x Y, completing the right-handed set.
x_sun is the Sun's state relative to the same center as x_eci. Because X lies along the position vector, the frame is identical whether the Sun direction is taken from the center or from the spacecraft. When the Sun lies along the nadir line (projected norm below 1e-9) the Y axis falls back to the along-track direction. The SANA definition does not cover that case; the fallback is specific to this implementation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_eci | ndarray or list | 6D state vector in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
x_sun | ndarray or list | 6D state vector of the Sun relative to the same center [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
axis | int | The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: 3x3 rotation matrix transforming from NSW to ECI frame, shape (3, 3), or the batch dimensions followed by (3, 3) for batched input. |
Example
rotation_eci_to_nsw builtin ¶
rotation_eci_to_nsw(x_eci: Union[ndarray, Sequence], x_sun: Union[ndarray, Sequence], axis: int = -1) -> ndarray
Computes the rotation matrix transforming a vector in the Earth-Centered Inertial (ECI) frame to the Nadir, Sun, Normal (NSW) frame.
This is the transpose (inverse) of the NSW-to-ECI rotation matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_eci | ndarray or list | 6D state vector in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
x_sun | ndarray or list | 6D state vector of the Sun relative to the same center [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
axis | int | The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: 3x3 rotation matrix transforming from ECI to NSW frame, shape (3, 3), or the batch dimensions followed by (3, 3) for batched input. |
Example
omega_nsw builtin ¶
omega_nsw(x_eci: Union[ndarray, Sequence], x_sun: Union[ndarray, Sequence], axis: int = -1) -> ndarray
Computes the angular velocity of the Nadir, Sun, Normal (NSW) frame with respect to the Earth-Centered Inertial (ECI) frame, expressed in NSW axes.
The SANA definition gives the axes but no rotation rate. The rate here follows from the time derivatives of the NSW basis vectors and is purely kinematic; it needs no gravitational parameter. Passing a Sun state with zero velocity gives the fixed-Sun approximation, which omits a term of order 2e-7 rad/s for an Earth orbit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_eci | ndarray or list | 6D state vector in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
x_sun | ndarray or list | 6D state vector of the Sun relative to the same center [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
axis | int | The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: Angular velocity of the NSW frame relative to ECI, expressed in NSW axes (rad/s), shape (3,), or the batch dimensions with 3 components along |
state_eci_to_nsw builtin ¶
state_eci_to_nsw(x_chief: Union[ndarray, Sequence], x_deputy: Union[ndarray, Sequence], x_sun: Union[ndarray, Sequence], axis: int = -1) -> ndarray
Transforms the absolute states of a chief and deputy satellite from the Earth-Centered Inertial (ECI) frame to the relative state of the deputy with respect to the chief in the rotating Nadir, Sun, Normal (NSW) frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_chief | ndarray or list | 6D state vector of the chief satellite in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
x_deputy | ndarray or list | 6D state vector of the deputy satellite in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
x_sun | ndarray or list | 6D state vector of the Sun relative to the same center [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
axis | int | The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: 6D relative state of the deputy with respect to the chief in the NSW frame [rho_X, rho_Y, rho_Z, rho_dot_X, rho_dot_Y, rho_dot_Z] (m, m/s), shape (6,), or the layout of the batched argument for batched input. |
Example
state_nsw_to_eci builtin ¶
state_nsw_to_eci(x_chief: Union[ndarray, Sequence], x_rel_nsw: Union[ndarray, Sequence], x_sun: Union[ndarray, Sequence], axis: int = -1) -> ndarray
Transforms the relative state of a deputy satellite with respect to a chief satellite from the rotating Nadir, Sun, Normal (NSW) frame to the absolute state of the deputy in the Earth-Centered Inertial (ECI) frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_chief | ndarray or list | 6D state vector of the chief satellite in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
x_rel_nsw | ndarray or list | 6D relative state of the deputy with respect to the chief in the NSW frame [rho_X, rho_Y, rho_Z, rho_dot_X, rho_dot_Y, rho_dot_Z] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
x_sun | ndarray or list | 6D state vector of the Sun relative to the same center [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or a batch of vectors with the 6 components along | required |
axis | int | The axis along which the 6 components of a single vector lie; the remaining axes enumerate the batch. For a batch of shape (n, 6) the components lie along the last axis, so the default | -1 |
Returns:
| Type | Description |
|---|---|
ndarray | numpy.ndarray: 6D state vector of the deputy satellite in the ECI frame [x, y, z, vx, vy, vz] (m, m/s), shape (6,), or the layout of the batched argument for batched input. |