| Earth Observation Mission CFI Software Visibility Software User Manual |

Earth Observation Mission CFI Software
VISIBILITY SOFTWARE USER MANUAL

Code | EO-MA-DMS-GS-016
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-016-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 | Fouth 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
CFI | Customer Furnished Item
EF | Earth Fixed reference frame
ESA | European Space Agency
ESTEC | European Space Technology and Research Centre
FOS | Flight Operations Segment
GS | Ground Station
OSF | Orbit Scenario File
SCF | Swath Control File
SDF | Swath Definition File
SRAR | Satellite Relative Actual Reference
SSP | Sub Satellite Point
STF | Swath Template File
SUM | Software User Manual
TOD | True of Date reference frame
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.
[ORBIT_SUM] | Earth Observation Mission CFI Software. Orbit Software User Manual. EO-MA-DMS-GS-014. Issue 4.4 05/07/12.
[POINT_SUM] | Earth Observation Mission CFI Software. Pointing Software User Manual. EO-MA-DMS-GS-015. Issue 4.4 05/07/12.
[FORMATS] | Earth Explorer File Format Guidelines. CS-TN-ESA-GS-0148.

# INTRODUCTION

## Classes and methods overview

This software library contains the CFI classes required to compute time segments at which an Earth Observation satellite, or one of its instruments is in view of various targets:

- zones (defined as polygons or circles, on the earth ellipsoid or at a given altitude)
- ground stations
- data relay satellites
- stars

The following classes are included:

- DRSVis: Class for data relay satellite visibility.
- OrbitExtra: Class to extract orbital extra information.
- Swath: Class to make operations involving a swath for zone and station visibility.
- SwathStar: Class to make operations involving a swath for star visibility.
- VisibilityList: Class to store list of visibility segments.
- VisibilitySegment: Class to store a visibility segment.

and the following auxiliary classes also (defined in VisibilityData.h):

- VisExtraInfo: Base class for visibility extra information.
- ZoneExtraInfo: Additional information to visibility segments computed for one zone.
- StationExtraInfo: Additional information to visibility segments computed for one station.
- MultiZonesExtraInfo: Additional information to visibility segments computed for multiple zones.
- MultiStationsExtraInfo: Additional information to visibility segments computed for multiple zones.
- MappingExtraInfo: Additional information to visibility segments computed for mapping.
- StarExtraInfo: Additional information to star visibility segments.
- OrbitExtraInfo: Orbit extra information.
- ScfAppear: Swath Control File appearance data structure.

This library is to be used for planning of Earth Observation operations. It includes, the following CFI methods:

- DrsVis::drsVisTime: computes visibility time segments for a data relay satellite
- SwathStar::starVisTime: computes visibility time segments for a star.
- Swath::stationVisTime: compute visibility time segments for a ground station
- Swath::zoneVisTime: compute visibility time segments for an instrument swath in visibility of a zone.
- Swath::getPos: computes location of a swath at a given time (additional routine to help refine the results of zoneVisTime)
- Swath::multiZonesVisTime: computes the visibility segments of several zones and sort them to different criteria.
- Swath::multiStationsVisTime: computes the visibility segments of several ground stations and sort them according to different criteria.
- Swath::genSwath generate the instrument swath template file for a given satellite, instrument mode and orbit.
- Swath::genScf generates a swath control file for the ESOV tool.
- Time Segments Manipulation Routines:
  - VisList::not: returns the complement of 1 vector of time segments.
  - VisList::and: returns the intersection segments from 2 vectors of time segments.
  - VisList::or: returns the joined segments from 2 vectors of time segments
  - VisList::delta: add or subtract time durations at the beginning and end of each time segment in a vector.
  - VisList::sort: returns the vector of time segments sorted according to absolute or relative orbits.
  - VisList::merge: merges all the overlapped segments in a list.
  - Swath::mapping: returns a subset of the time segments vector, such that this subset covers entirely a zone or line swath.

Several files are required to operate properly the above methods:

- Orbit Scenario File (all functions)
- Swath Template Files (Swath::stationVisTime, Swath::zoneVisTime, Swath::getPos)
- Ground Stations Database File (Swath::stationVisTime)
- (optionally) Zones Database File (Swath::zoneVisTime)
- (optionally) Star Database File (Swath::starVisTime)

## Calling Sequence

An overview of the data flow is presented in following figure:

# 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 Visibility software library, the following other CFI software libraries are required:

- EE_COMMON
- FILE_HANDLING
- DATA_HANDLING
- LIB
- ORBIT
- POINTING

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 Visibility 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
  -lCfiVisibility -lCfiPointing -lCfiOrbit -lCfiLib -lCfiDataHandling -lCfiFileHandling -lCfiEECommon -lxml2 -lpthread
- MacOS:
  -Icfi_include_dir -Lcfi_lib_dir
  -lCfiVisibility -lCfiPointing -lCfiOrbit -lCfiLib -lCfiDataHandling -lCfiFileHandling -lCfiEECommon -lpthread
  -framework libxml
- WINDOWS (dynamic libraries):
  /I "cfi_include_dir" /libpath:"cfi_lib_dir"
  libCfiVisibility.lib libCfiPointing.lib libCfiOrbit.lib libCfiLib.lib libCfiDataHandling.lib libCfiFileHandling.lib libCfiEECommon.lib
- WINDOWS (static libraries):
  /I "cfi_include_dir" /libpath:"cfi_lib_dir"
  libCfiVisibility.lib 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 system, 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++ Visibility 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].