Spacecraft Control Framework 1.0
Spacecraft Control Library
Classes | Macros | Enumerations | Functions
sc_earth_elevation.h File Reference

Earth elevation model. More...

Go to the source code of this file.

Classes

class  sc_earth_elevation
 Manages requests for earth elevation. More...
 

Macros

#define kDegreesPerPixel   0.0083333333333
 Degrees per pixel.
 

Enumerations

enum  ElevationPrecision {
  elev_precision_none = 0 , elev_precision_10 = 1 , elev_precision_1 = 2 , elev_precision_01 = 3 ,
  elev_precision_001 = 4
}
 Elevation precision.
 

Functions

double earth_surface_elevation (double lat, double lon)
 Return surface elevation above sea level for the given lat & lon (degrees) More...
 
double earth_surface_elevation (const ml_matrix &efpos, double f=FLATTENING_FACTOR)
 Return surface elevation above sea level for the given EF position. More...
 
ml_matrix earth_surface_ef_pos (const ml_matrix &efpos, double f=FLATTENING_FACTOR, double a=RADIUS_EARTH)
 Compensate for Earth land elevation at the given position by increasing or decreasing magnitude. More...
 

Detailed Description

Earth elevation model.

Accesses elevation figures in DEM files

An sc_earth_elevation_square represents one of the tiled DEM (Digital Elevation Model) files used to map lat/lon to elevations. We currently use DEM files from the GTOPO30 data set obtained via download from the US Geological Service Earth Resources Observation & Sciencer (EROS) Center. The files were current as of 02/16/2010. At that date, the web location was: http://eros.usgs.gov/#/Find_Data/Products_and_Data_Available/gtopo30_info

The DEM files represent a grid of 3 rows of 9 tiles covering 40 degress of longitude and 50 degrees of latitude each for everything above -60 deg latitude, and 1 row of 6 tiles covering 60 degrees of longitude and 30 degrees of latitude for everything south of -60 deg latitude. Each of the 27 tiles has 6000 rows and 4800 columns of 16 bit integers in big-ending byte-order. They are in row-major order, so the first 12000 bytes represent the first row. Each of the 6 tiles covering the southern portion of the globe has 3600 rows and 7200 columns. Longitudes increase as you move across each row of data, and latitudes decrease as you move down each column of data. Each "pixel" of data represents approximately 0.0083333333333 degrees of latitude/longitude. Values in the tables are in METERS, but values returned by sc_earth_elevation are converted to KILOMETERS.

If using compressed DEM files, we break the files into strips of 1200 rows (10 degrees) and use zlib compression on them.

Function Documentation

◆ earth_surface_elevation() [1/2]

double earth_surface_elevation ( double  lat,
double  lon 
)

Return surface elevation above sea level for the given lat & lon (degrees)

Return surface elevation above sea level for the given lat & lon (degrees)

A negative return value would be land below sea level (i.e. Death Valley)

Parameters
latlatitude in degrees from -90 to 90
lonlongitude in degrees from -180 to 180
Returns
Difference in kilometers between sea level and the land surface at the given location

References sc_earth_elevation::default_manager(), and sc_earth_elevation::elevationForLatLon().

◆ earth_surface_elevation() [2/2]

double earth_surface_elevation ( const ml_matrix &  efpos,
double  f 
)

Return surface elevation above sea level for the given EF position.

Return surface elevation above sea level for the given EF position.

A negative return value would be land below sea level (i.e. Death Valley)

Parameters
efposLocation coordinate in the Earth Fixed coordinate frame
fFlattening factor
Returns
Difference in kilometers between sea level and the land surface at the given location

References sc_earth_elevation::default_manager(), and sc_earth_elevation::elevationForEFPos().

◆ earth_surface_ef_pos()

ml_matrix earth_surface_ef_pos ( const ml_matrix &  efpos,
double  f,
double  a 
)

Compensate for Earth land elevation at the given position by increasing or decreasing magnitude.

Compensate for Earth land elevation at the given position by increasing or decreasing magnitude.

Looks up Earth elevations in DEM (Digital Elevation Map) files via class in sc_earth_elevation.

Parameters
efposLocation coordinate in the Earth Fixed coordinate frame
fFlattening factor
aEquatorial radius
Returns
Location on the actual land surface in the Earth Fixed coordinate frame

References sc_earth_elevation::default_manager(), sc_earth_elevation::elevationForEFPos(), lat_lon_alt_to_pos(), and pos_to_lat_lon_alt().