SunEarthSatGeometry.cpp File Reference


Detailed Description

Include file for various routines related to Sun-Earth-Satellite geometry, including satellite attitude, XYZ->UEN rotation, and (elevation,azimuth) as seen at the satellite.

Used by PhaseWindup and PreciseRange.

Definition in file SunEarthSatGeometry.cpp.

#include "StringUtils.hpp"
#include "geometry.hpp"
#include "icd_200_constants.hpp"
#include "SunEarthSatGeometry.hpp"
#include "SolarPosition.hpp"

Include dependency graph for SunEarthSatGeometry.cpp:

Include dependency graph

Go to the source code of this file.

Namespaces

namespace  gpstk

Functions

Matrix< double > UpEastNorth (Position &P, bool geocentric) throw (Exception)
 Given a Position, compute unit vectors in ECEF coordinates in the Up, East and North directions at that position.
Matrix< double > UpEastNorthGeocentric (Position &P) throw (Exception)
 Same as UpEastNorth, but using geocentric coordinates, so that the -Up direction will meet the center of Earth.
Matrix< double > NorthEastUp (Position &P, bool geocentric) throw (Exception)
 Same as UpEastNorth(), but with rows re-ordered.
Matrix< double > NorthEastUpGeocentric (Position &P) throw (Exception)
 Same as UpEastNorthGeocentric(), but with rows re-ordered.
Matrix< double > SingleAxisRotation (double angle, const int axis) throw (Exception)
 Generate a 3x3 rotation Matrix, for direct rotations about one axis (for XYZ, axis=123), given the rotation angle in radians;.
double ShadowFactor (double AngRadEarth, double AngRadSun, double AngSeparation)
Matrix< double > doSatAtt (const DayTime &tt, const Position &SV, const SolarSystem &SSEph, const EarthOrientation &EO, double &sf) throw (Exception)
Matrix< double > SatelliteAttitude (const DayTime &tt, const Position &SV, double &sf) throw (Exception)
 Version without solar ephemeris - uses lower quality solar position routine Compute the satellite attitude, given the time, the satellite position SV, and a SolarSystem ephemeris.
Matrix< double > SatelliteAttitude (const DayTime &tt, const Position &SV, const SolarSystem &SSEph, const EarthOrientation &EO, double &sf) throw (Exception)
 Compute the satellite attitude, given the time, the satellite position SV, and a SolarSystem ephemeris.
void SatelliteNadirAzimuthAngles (const Position &SV, const Position &RX, const Matrix< double > &Rot, double &nadir, double &azimuth) throw (Exception)
 Compute the azimuth and nadir angle, in the satellite body frame, of receiver Position RX as seen at the satellite Position SV.


Function Documentation

Matrix<double> doSatAtt const DayTime &  tt,
const Position &  SV,
const SolarSystem &  SSEph,
const EarthOrientation &  EO,
double &  sf
throw (Exception)
 

Definition at line 241 of file SunEarthSatGeometry.cpp.

References Triple::cross(), Triple::dot(), GPSTK_RETHROW, GPSTK_THROW, Triple::mag(), Position::radius(), gpstk::ShadowFactor(), gpstk::SolarPosition(), and Position::transformTo().

Referenced by gpstk::SatelliteAttitude().

Matrix< double > NorthEastUp Position &  P,
bool  geoc = false
throw (Exception)
 

Same as UpEastNorth(), but with rows re-ordered.

Definition at line 86 of file SunEarthSatGeometry.cpp.

References GPSTK_RETHROW, and GPSTK_THROW.

Referenced by gpstk::NorthEastUpGeocentric(), and gpstk::UpEastNorth().

Matrix< double > NorthEastUpGeocentric Position &  P  )  throw (Exception)
 

Same as UpEastNorthGeocentric(), but with rows re-ordered.

Definition at line 121 of file SunEarthSatGeometry.cpp.

References GPSTK_RETHROW, and gpstk::NorthEastUp().

Matrix< double > SatelliteAttitude const DayTime &  tt,
const Position &  SV,
const SolarSystem &  SSEph,
const EarthOrientation &  EO,
double &  sf
throw (Exception)
 

Compute the satellite attitude, given the time, the satellite position SV, and a SolarSystem ephemeris.

Return a 3x3 Matrix which contains, as rows, the unit (ECEF) vectors X,Y,Z in the body frame of the satellite, namely Z = along the boresight (i.e. towards Earth center), Y = perpendicular to both Z and the satellite-sun direction, and X = completing the orthonormal triad. X will generally point toward the sun. Thus this rotation matrix R transforms an ECEF XYZ vector into the body frame of the satellite, so R * (ECEF XYZ vector) = components in body frame. Also, R.transpose() * (sat. body. frame vector) = ECEF XYZ components. Also return the shadow factor, which is the fraction of the sun's area not visible to satellite; thus sf == 1 means the satellite is in eclipse.

Parameters:
DayTime tt Time of interest
Position SV Satellite position
SolarSystem SSEph Solar system ephemeris
EarthOrientation EO Earth orientation parameters appropriate for time
double sf Shadow factor: 0 <= sf <= 1 fraction of sun visible
Returns:
Matrix<double>(3,3) Rotation matrix from XYZ to Satellite body frame.
Exceptions:
if SolarSystem is invalid.

Definition at line 330 of file SunEarthSatGeometry.cpp.

References gpstk::doSatAtt(), and GPSTK_THROW.

Referenced by PreciseRange::ComputeAtTransmitTime(), and gpstk::PhaseWindup().

Matrix< double > SatelliteAttitude const DayTime &  tt,
const Position &  SV,
double &  sf
throw (Exception)
 

Version without solar ephemeris - uses lower quality solar position routine Compute the satellite attitude, given the time, the satellite position SV, and a SolarSystem ephemeris.

Return a 3x3 Matrix which contains, as rows, the unit (ECEF) vectors X,Y,Z in the body frame of the satellite, namely Z = along the boresight (i.e. towards Earth center), Y = perpendicular to both Z and the satellite-sun direction, and X = completing the orthonormal triad. X will generally point toward the sun. Thus this rotation matrix R transforms an ECEF XYZ vector into the body frame of the satellite, so R * (ECEF XYZ vector) = components in body frame. Also, R.transpose() * (sat. body. frame vector) = ECEF XYZ components. Also return the shadow factor, which is the fraction of the sun's area not visible to satellite; thus sf == 1 means the satellite is in eclipse.

Parameters:
DayTime tt Time of interest
Position SV Satellite position
double sf Shadow factor: 0 <= sf <= 1 fraction of sun visible
Returns:
Matrix<double>(3,3) Rotation matrix from XYZ to Satellite body frame.

Definition at line 320 of file SunEarthSatGeometry.cpp.

References gpstk::doSatAtt().

void SatelliteNadirAzimuthAngles const Position &  SV,
const Position &  RX,
const Matrix< double > &  Rot,
double &  nadir,
double &  azimuth
throw (Exception)
 

Compute the azimuth and nadir angle, in the satellite body frame, of receiver Position RX as seen at the satellite Position SV.

The nadir angle is measured from the Z axis, which points to Earth center, and azimuth is measured from the X axis.

Parameters:
Position SV Satellite position
Position RX Receiver position
Matrix<double> Rot Rotation matrix (3,3), output of SatelliteAttitude
double nadir Output nadir angle in degrees
double azimuth Output azimuth angle in degrees
Exceptions:
if rotation matrix has wrong dimentions.

Definition at line 355 of file SunEarthSatGeometry.cpp.

References GPSTK_RETHROW, GPSTK_THROW, Triple::mag(), Position::transformTo(), Position::X(), Position::Y(), and Position::Z().

Referenced by PreciseRange::ComputeAtTransmitTime().

double ShadowFactor double  AngRadEarth,
double  AngRadSun,
double  AngSeparation
 

Definition at line 207 of file SunEarthSatGeometry.cpp.

References gpstk::beta(), GPSTK_RETHROW, and GPSTK_THROW.

Referenced by gpstk::doSatAtt().

Matrix< double > SingleAxisRotation double  angle,
int  axis
throw (Exception)
 

Generate a 3x3 rotation Matrix, for direct rotations about one axis (for XYZ, axis=123), given the rotation angle in radians;.

Parameters:
angle in radians.
axis 1,2,3 as rotation about X,Y,Z.
Returns:
Rotation matrix (3x3).
Exceptions:
InvalidInput if axis is anything other than 1, 2 or 3.

Definition at line 134 of file SunEarthSatGeometry.cpp.

References GPSTK_RETHROW, and GPSTK_THROW.

Matrix< double > UpEastNorth Position &  P,
bool  geoc = false
throw (Exception)
 

Given a Position, compute unit vectors in ECEF coordinates in the Up, East and North directions at that position.

Use geodetic coordinates, i.e. 'up' is perpendicular to the geoid, not from center of Earth (UpEastNorthGeocentric()). /// Return the vectors in the form of a 3x3 Matrix<double>, this is in fact the rotation matrix that will take an ECEF vector into an 'up,east,north' vector. Individual unit vectors can be defined from this rotation matrix R by

          Vector<double> U = R.rowCopy(0);
          Vector<double> E = R.rowCopy(1);
          Vector<double> N = R.rowCopy(2);
Parameters:
P Position at which the rotation matrix will be defined.
geoc If true, use geocentric, not geodetic (default is false).
Returns:
3x3 rotation matrix that will transform an ECEF vector into the Up,East,North frame at the position P.

Definition at line 63 of file SunEarthSatGeometry.cpp.

References GPSTK_RETHROW, GPSTK_THROW, and gpstk::NorthEastUp().

Referenced by gpstk::UpEastNorthGeocentric().

Matrix< double > UpEastNorthGeocentric Position &  P  )  throw (Exception)
 

Same as UpEastNorth, but using geocentric coordinates, so that the -Up direction will meet the center of Earth.

Definition at line 78 of file SunEarthSatGeometry.cpp.

References GPSTK_RETHROW, and gpstk::UpEastNorth().


Generated on Thu Jul 29 03:31:44 2010 for GPS ToolKit Software Library by  doxygen 1.3.9.1