NASA Logo
Ocean Color Science Software

ocssw V2022
ocorient.c File Reference
#include "libnav.h"
#include "nav.h"
#include "ocorient.h"
#include "math_utils.h"
Include dependency graph for ocorient.c:

Go to the source code of this file.

Functions

void matmpy (const float xm1[3][3], const float xm2[3][3], float xm3[3][3])
 
void matmpy_ (const float xm1[3][3], const float xm2[3][3], float xm3[3][3])
 
void oceuler (float a[3], float xm[3][3])
 
void ocorient_ (float pos[3], float vel[3], float att[3], float rm[3][3], float coef[10])
 

Function Documentation

◆ matmpy()

void matmpy ( const float  xm1[3][3],
const float  xm2[3][3],
float  xm3[3][3] 
)

c Computes matrix product of 3x3 matrices xm1 and xm2

Parameters
xm1R*4 I Input Matrix
xm2R*4 I Input Matrix
xm3R*4 O Output Matrix

Definition at line 5 of file ocorient.c.

◆ matmpy_()

void matmpy_ ( const float  xm1[3][3],
const float  xm2[3][3],
float  xm3[3][3] 
)

Definition at line 16 of file ocorient.c.

◆ oceuler()

void oceuler ( float  a[3],
float  xm[3][3] 
)

c Computes coordinate transformation matrix corresponding to Euler c sequence. The order of angles in the input array is yaw, roll, c pitch; according to OSC, the order of the rotations is the reverse c of this; the roll and pitch angles are about the negative Y and Z c axes, respectively, while the yaw angle is about the positive X axis. c Reference: Wertz, Appendix E; OSC, personal communication c Modification history: c c c Modified to change order of rotations to pitch, roll, yaw (-Z, -Y, -X) c F. S. Patt, GSC, September 29, 1996. c c Removed negative signs on Y and Z rotations for OCTS; order of rotations c is yaw, pitch, roll (Z, Y, X)

Parameters
aR*4 I Input Array of Euler Angles (degrees)
xmR*4 O Output Transformation Matrix

Definition at line 25 of file ocorient.c.

◆ ocorient_()

void ocorient_ ( float  pos[3],
float  vel[3],
float  att[3],
float  rm[3][3],
float  coef[10] 
)

c This subroutine performs a simple calculation of the sensor c orientation from the orbit position vector and input values of the c attitude offset angles. The calculations assume that the angles c represent the roll, pitch and yaw offsets between the local vertical c reference frame (at the spacecraft position) and the sensor frame. c Sensor tilt angles are assumed to be included in the pitch angle. c The outputs are the matrix which represents the transformation from c the geocentric rotating to sensor frame, and the coefficients which c represent the Earth scan track in the sensor frame. c The reference ellipsoid uses an equatorial radius of 6378.137 km and c a flattening factor of 1/298.257 (WGS 1984). c Subprograms Called (attached): c CROSSP Compute cross product of two vectors c EULER Compute matrix from Euler angles c MATMPY Multiply two 3x3 matrices c c Program written by: Frederick S. Patt c General Sciences Corporation c July 22, 1992 c c Modification History: c Added improved calculation of local vertical reference frame and c modified calling argument names. c F. S. Patt, September 30, 1992 c Expanded vector normalization in-line to eliminate subroutine c call. F. S. Patt, October 19, 1992 c Eliminated redundant calculations, changed to correspond to c paper, "Exact closed-form geolocation algorithm for earth c survey sensors", International Journal of Remote Sensing, Patt c and Gregg, 1993. W. Gregg, 4/5/93. c Modified to support three-dimensional view vectors by computing c coefficients array with all 10 ellipsoid terms. c F. S. Patt, November 25, 1996

Parameters
posI Orbit Position Vector ECEF (km)
velOrbit Velocity Vector ECEF (km/sec)
attAttitude Offsets (Euler angles in degrees); referenced to local vertical coordinates; order is roll, pitch, yaw (X, Y, Z)
rmSensor orientation matrix
coefScan path coefficients

c Compute correction to orbit velocity vector in Earth-centered c Earth-fixed (ECEF) frame; this involves subtracting effect of Earth c rotation rate on velocity to get correct scan plane orientation in c ECEF frame.

c Determine nadir frame reference axes c Uses method of local ellipsoid approximation good to 0.3 arcsecond c Compute Z axis as local nadir vector

Definition at line 103 of file ocorient.c.