| Earth Observation Mission CFI Software Pointing Software User Manual |

Earth Observation Mission CFI Software
POINTING SOFTWARE USER MANUAL

Code | EO-MA-DMS-GS-015
Issue | 4.4
Date | 05/07/12

| Name | Function | Signature
Prepared by: | Carlos Villanueva Muñoz | Project Manager |
Checked by: | Carlos Villanueva Muñoz | Project Manager |
Approved by: | José Antonio González Abeytua | Division Head |

# DOCUMENT INFORMATION

Contract Data | Classification
--- | ---
Contract Number: | 15583/01/NL/GS | Internal |
Public |
Contract Issuer: | ESA / ESTEC | Industry | X
Confidential |

External Distribution
Name | Organization | Copies

Electronic handling
Document generator: | Doxygen 1.7.1
Electronic file name: | eo-ma-dms-gs-015-10

# Document Status Log

Issue | Change Description | Date | Approval
--- | --- | --- | ---
1.0 | First release These libraries corresponds to version 4.0 of C libraries. | 27/03/09 |
4.1 | Second release - Issue in line with C version These libraries corresponds to version 4.1 of C libraries. | 07/05/10 |
4.2 | Third release These libraries corresponds to version 4.2 of C libraries. | 31/01/11 |
4.3 | Fourth release These libraries corresponds to version 4.3 of C libraries. | 06/02/12 |
4.4 | Fifth release These libraries corresponds to version 4.4 of C libraries. | 05/07/12 |

# ACRONYMS, NOMENCLATURE AND TERMINOLOGY

## Acronyms

ANX | Ascending Node Crossing
AOCS | Attitude and Orbit Control Subsystem
ASCII | American Standard Code for Information Interchange
CFI | Customer Furnished Item
CS | Coordinate System
DRS | Data Relay Satellite
ESA | European Space Agency
ESTEC | European Space Technology and Research Centre
GPL | GNU Public License
GPS | Global Positioning System
GS | Ground Station
IERS | International Earth Rotation Service
I/F | Interface
LOS | Line Of Sight
LUT | Look-Up Table
OBT | On-board Binary Time
OSF | Orbit Scenario File
RAM | Random Access Memory
SBT | Satellite Binary Time
SRAR | Satellite Relative Actual Reference
SSP | Sub Satellite Point
SUM | Software User Manual
S/W | Software
TAI | International Atomic Time
UTC | Coordinated Universal Time
UT1 | Universal Time UT1
WGS[84 | World Geodetic System 1984

## Nomenclature

CFI | A group of CFI functions, and related software and documentation. that will be distributed by ESA to the users as an independent unit
CFI function | A single function within a CFI that can be called by the user
Library | A software library containing all the CFI functions included within a CFI plus the supporting functions used by those CFI functions (transparently to the user)

## Notes in Terminology

In order to keep compatibility with legacy CFI libraries, the Earth Observation Mission CFI Software makes use of terms that are linked with missions already or soon in the operational phase like the Earth Explorers. This may be reflected in the rest of the document when examples of Mission CFI Software usage are proposed or description of Mission Files is given.

# APPLICABLE AND REFERENCE DOCUMENTS

## Applicable Documents

[GEN_SUM] | Earth Observation Mission CFI Software. General Software User Manual. EO-MA-DMS-GS-017. Issue 4.4 05/07/12

## Reference Documents

[MCD] | Earth Observation Mission CFI Software. Conventions Document. EO-MA-DMS-GS-0001. Issue 4.4 05/07/12.
[MSC] | Earth Observation Mission CFI Software. Mission Specific Customizations. EO-MA-DMS-GS-0018. Issue 4.4 05/07/12.
[EE_COMMON_SUM] | Earth Observation Mission CFI Software. EECommon Software User Manual. EO-MA-DMS-GS-010. Issue 4.4 05/07/12.
[F_H_SUM] | Earth Observation Mission CFI Software. FileHandling Software User Manual. EO-MA-DMS-GS-011. Issue 4.4 05/07/12.
[D_H_SUM] | Earth Observation Mission CFI Software. DataHandling Software User Manual. EO-MA-DMS-GS-012. Issue 4.4 05/07/12.
[LIB_SUM] | Earth Observation Mission CFI Software. Lib Software User Manual. EO-MA-DMS-GS-013 Issue 4.4 05/07/12.
[LOS_ALG] | LOS Intersection. PE-TN-ESA-SY-0043

# INTRODUCTION

## Classes Overview

This software library contains the CFI classes with the methods required to perform accurate computation of pointing parameters from and to a satellite for various types of targets. It includes a set of methods to initialize the attitude of the platform and the instruments. The values provided by these methods are later used by all the other methods of the library.
The following CFI classes are included:

- AtmosId: Class for the atmospheric model.
- Attitude: Class for attitude data and configuration.
- DemId: Class for DEM parameters.
- InstrTransId: Class for Instrument Attitude.
- SatNomTransId: Class for satellite nominal attitude.
- SatTransId: Class for satellite attitude.
- Target: Class for target calculations.

and the following auxiliary classes:

- AttDataRec: Attitude data.
- AtmosIdData: Atmospheric Id data.
- AttFileModel: File Model for Nominal attitude and instrument attitude.
- AttitudeData: Attitude id data.
- AzElDefinition: Azimuth/elevation definition.
- CsTra: Coordinate system matrix.
- GenericTargetData: Generic target data.
- ParDer: Parameter.
- QuatPlusAnglesModel: Quaternion plus angles model.
- QuatPlusMatrixModel: Quaternion plus matrix model.
- SatAttFileModel: File Model for satellite attitude.
- StarTrackerAux: Star tracker aux data.
- TargetData: Target data.
- TargetIdData: Target id data.

For furher information, please refer also to:

- [MCD] for a detailed description of the time references and formats, coordinate systems, parameters and models used in this document
- [GEN_SUM] for a complete overview of the CFI, and in particular the detailed description of the Id concept and usage and the error handling functions

### Attitude Data Flow

The following figure shows the tipical data flow for the attitude methods. First, the different transformations between the various reference frames are initialised. Then, given the spacecraft position, the attitude is calculated:

Each different transformation can be initialised with different models:

## Geolocation Routines Data Flow

The following figure shows the tipical data flow for the geolocation routines functions. First, the attitude should be calculated, and, if needed, the refraction and Digital Elevation Models initialised.

The table below and the diagrams on the next pages describe the various Target::targetXXX methods.

Target::targetXXX method | Description
--- | ---
Target::targetInter / Target::multiTargetInter | It calculates the intersection point(s) of the line of sight defined by an elevation and an azimuth angle expressed in the input Attitude frame, with a surface(s) located at a certain geodetic altitude(s) over the Earth.
Target::targetTravelTime / Target::multiTargetTravelTime | It calculates the point of the line or sight from the satellite (defined by an elevation and an azimuth angle expressed in the selected Attitude Frame) at a given travel time(s) along the (curved) line of sight.
Target::targetGroundRange | It calculates the location of a point that is placed on a surface at a certain geodetic altitude over the Earth, that lays on the plane defined by theS/C position, the nadir and a reference point, and that is at a certain distance or ground range measured along that surface from that reference point. This reference point is calculated being the intersection of the previous surface with the line of sight defined by an elevation and azimuth angle in the input Attitude coordinate system.
Target::targetIncidenceAngle | It calculates the location of a point that is placed on a surface at a certain geodetic altitude over the Earth and that is seen from the S/C on a line of sight that forms a certain azimuth angle in the input Attitude frame and that intersects that surface with a certain incidence angle.
Target::targetRange | It calculates the location of a point that is placed on a surface at a certain geodetic altitude over the Earth, that is seen from the S/C on a line of sight that forms a certain azimuth angle in the input Attitude frame, and that is at a certain range or slant-range from the S/C.
Target::targetRangeRate | It calculates the location of a point that is placed on a surface at a certain geodetic altitude over the Earth, that is at a certain range from S/C, and whose associated Earth-fixed target has a certain range-rate value.
Target::targetTangent | It calculates the location of the tangent point over the Earth that is located on the line of sight defined by an elevation and azimuth angles expressed in the input Attitude frame.
Target::targetAltitude | It calculates the location of the tangent point over the Earth that is located on a surface at a certain geodetic altitude over the Earth and that is on a line of sight that forms a certain azimuth angle in the input Attitude frame.
Target::targetStar | It calculates the location of the tangent point over the Earth that is located on the line of sight that points to a star defined by its right ascension and declination coordinates.
Target::targetGeneric | The cartesian state vector of the target is taken as an input.
Target::targetTangentSun | It calculates the location of the tangent point over the Earth that is located on the line of sight that points to the Sun
Target::targetTangentMoon | It calculates the location of the tangent point over the Earth that is located on the line of sight that points to the Moon
Target::targetStation | It calculates the most relevant observation parameters of the link between the satellite and a ground station |
Target::targetSc | It calculates the most relevant observation parameters of the link between one source satellite and anothr target satellite.

As it can be seen from the list of functions, there are some functions that calculate several targets (Target::multiTargetXXX). The number of targets found by the functions is stored in the Target object. In addition to these "user" targets, two other categories of targets can be defined, "LOS" targets and "DEM" targets.

### LOS targets

The idea is to get information about all the ray path points computed by a specific target routine along the Line of Sight (LOS) trajectory. For every target method, the Target parameter numLosTarget will store the number of points in the path. It applies when the variable "targetType" is equal to XPCFI_LOS_TARGET_TYPE.

1. Start point of LOS. The spacecraft position (Instrument CS) shall be considered as the start point for the LOS path.
2. Stop point of LOS. The stop point for the LOS path will be different depending on the selected target function; nominally it will be the resulting target point.

- Target::targetInter and Target::multiTargetInter: 1st or 2nd intersection point (Point corresponding to the last altitude for the multi_target routine)
- Target::targetGround: Target point
- Target::targetIncidenceAngle: Target point
- Target::targetRange: Target point
- Target::targetRangeRate: Target point
- Target::targetTangent: Two different cases to consider depending on whether refraction is selected or not:
  - No refraction mode: Tangent point
  - Refraction mode:
    - The 2nd intersection point with a surface located at Refraction Model Maximum Height (geodetic altitude) over the Earth if tangent height <= Refraction Model Maximum Height
    - The tangent point if tangent height > Refraction Model Maximum Height
- Target::targetAltitude: Point at selected altitude
- Target::targetStar: Two different cases to consider depending on whether refraction is selected or not:
  - No refraction mode: Tangent point
  - Refraction mode:
    - The 2nd intersection point with a surface located at Refraction Model Maximum Height (geodetic altitude) over the Earth if tangent height <= Refraction Model Maximum Height
    - The tangent point if tangent height > Refraction Model Maximum Height
- Target::targetStation: Ground Station position
- Target::targetDRS: DRS position
- Target::targetGeneric: Target position
- Target::targetReflected: Reflection point
- Target::targetTravelTime and Target::multiTargetTravelTime: Point at selected travel time (Point corresponding to the last travel time for the multiTarget routine)
- Target::targetTangentSun: Tangent point
- Target::targetTangentMoon: Tangent point

### DEM targets

A DEM Target is defined as the intersection of a line of sight with the Earth Surface defined using a digital elevation model (DEM).
A DEM Target is calculated using as line of sight the LOS targets that has been computed previously with a target routine (Note that such LOS consist in a polygonal line, no necessarily a straight line). Consequently, to get a DEM target it is neccessary to follow these steps:

- Initialize the DEM model creating a DemId object and using the DemId::init method and a configuration file.
- One call to the target method for getting the LOS targets.
- One call to the target extra routine requesting the DEM target.

The digital elevation model of the Earth consists in a set of points defining a grid for which a measure of the altitude over the Earth reference elipsoid is given. The altitude of the points within each cell of the grid is computed by the CFI using a bilinear interpolation with the points of the corner of the cell. Details about the bilinear algorithm used to compute the intersection can be seen in [LOS_ALG].[LOS_ALG]

# LIBRARY INSTALLATION

For a detailed description of the installation of any CFI library, please refer to [GEN_SUM].

# LIBRARY USAGE

Note that to use the POINTING software library, the following other CFI software libraries are required:

- EE_COMMON
- FILE_HANDLING
- DATA_HANDLING
- LIB
- ORBIT

It is needed to have properly installed in the system the following external GPL library:

- LIBXML2 (MIT license, see [GEN_SUM])
- POSIX thread library: libpthread.so (pthread.lib for WINDOWS, with license LGPL)

To use the POINTING software library in an user application, that application must include in its source code the header files where the classes that are going to be used are defined.
To link correctly this application, the user must include in his linking command flags like (assuming cfi_lib_dir and cfi_include_dir are the directories where respectively all CFI libraries and include files have been installed, see [GEN_SUM] for installation procedures):

- LINUX:
  -Icfi_include_dir -Lcfi_lib_dir
  -lCfiPointing -lCfiOrbit -lCfiLib -lCfiDataHandling -lCfiFileHandling -lCfiEECommon -lxml2 -lpthread
- MacOS:
  -Icfi_include_dir -Lcfi_lib_dir
  -lCfiPointing -lCfiOrbit -lCfiLib -lCfiDataHandling -lCfiFileHandling -lCfiEECommon -lpthread
  -framework libxml
- WINDOWS (dynamic libraries):
  /I "cfi_include_dir" /libpath:"cfi_lib_dir"
  libCfiPointing.lib libCfiOrbit.lib libCfiLib.lib libCfiDataHandling.lib libCfiFileHandling.lib libCfiEECommon.lib
- WINDOWS (static libraries):
  /I "cfi_include_dir" /libpath:"cfi_lib_dir"
  libCfiPointing.lib libCfiOrbit.lib libCfiLib.lib libCfiDataHandling.lib libCfiFileHandling.lib libCfiEECommon.lib libxml2.lib pthread.lib

Note that, as Earth Observation CFI libraries are dynamic, cfi_lib_dir must be included in the path where the system looks for dynamic libraries (LD_LIBRARY_PATH in LINUX, DYLD_LIBRARY_PATH in MacOs). For WINDOWS sytem, the executable will look for .dll libraries, not the .lib ones that are used to create the executable, so they must be in the path described by PATH variable.
All the classes described in this document are defined in EECFI namespace, to avoid any possible conflict with classes of other libraries, so the user must choose one of the following two options in order to use the classes:

- Inserting using namespace EECFI; in the code.
- Using the classes with the namespace prefix (e.g.: EECFI::OrbitFile orbitFile;)

# ERROR HANDLING

The error management in C++ POINTING is made throw exceptions, that is, if any error is produced, an exception of type CfiError is thrown and it must be catched putting the code inside a try-catch block.
See [GEN_SUM] to know more about how to handle the CFI errors. For a descripton about the CfiError class and its methods, see [EE_COMMON_SUM].