Spacecraft Control Framework 1.0
Spacecraft Control Library
sc_earth_elevation.h
Go to the documentation of this file.
1/*
2 * sc_earth_elevation.h
3 * SCControl
4 *
5 * Created by Ken Worley on 4/5/10.
6 * Copyright 2010 Princeton Satellite Systems. All rights reserved.
7 *
8 * Note: Requires the libz.dylib library
9 */
10
11
41#ifndef __SC_EARTH_ELEVATION__
42#define __SC_EARTH_ELEVATION__
43
44#ifdef AS_OS_WINDOWS
45#include "matrixlib.h"
46#else
47#include <MatrixLib/MatrixLib.h>
48#endif
49
50#include "sc_constants.h"
51
53#define kDegreesPerPixel 0.0083333333333
54
56typedef enum
57{
58 elev_precision_none = 0,
59 elev_precision_10 = 1, // 10 deg x 10 deg
60 elev_precision_1 = 2, // 1 deg x 1 deg
61 elev_precision_01 = 3, // .1 deg x .1 deg
62 elev_precision_001 = 4 // .01 deg x .01 deg
63}
65
66extern "C++"
67{
68
70double earth_surface_elevation(double lat, double lon);
72double earth_surface_elevation(const ml_matrix &efpos, double f=FLATTENING_FACTOR);
74ml_matrix earth_surface_ef_pos(const ml_matrix &efpos, double f=FLATTENING_FACTOR, double a=RADIUS_EARTH);
75
77class ml_matrix;
78
80
86{
87 public:
88
91
93 sc_earth_elevation(const char *pathToDemFiles);
94
97
99 double elevationForLatLon(double lat, double lon);
100
102 double elevationForEFPos(const ml_matrix& efPos, double f=FLATTENING_FACTOR);
103
105 bool hasLandInGridSquare(double lat, double lon, ElevationPrecision gridSize);
106
107 private:
108
110 static sc_earth_elevation *defaultManager;
111
113 sc_earth_elevation_square* squareForLatLon(double lat, double lon);
114
116 sc_earth_elevation_square* squares[9][3];
117
119 sc_earth_elevation_square* southSquares[6];
120};
121
122} // extern "C++"
123
124#endif // ifndef __SC_EARTH_ELEVATION__
An object used internally to manage data from a single DEM file.
Definition: sc_earth_elevation.cc:205
Manages requests for earth elevation.
Definition: sc_earth_elevation.h:86
static sc_earth_elevation * default_manager()
Get a default singleton manager which uses the maps at the default location kDefaultElevationMapsPath...
Definition: sc_earth_elevation.cc:680
double elevationForLatLon(double lat, double lon)
Return an approximate land elevation for the given actual lat & lon (degrees) - return value in km.
Definition: sc_earth_elevation.cc:767
~sc_earth_elevation()
destructor
Definition: sc_earth_elevation.cc:721
bool hasLandInGridSquare(double lat, double lon, ElevationPrecision gridSize)
Returns true if there is any land in the grid square containing the lat/lon.
Definition: sc_earth_elevation.cc:800
double elevationForEFPos(const ml_matrix &efPos, double f=FLATTENING_FACTOR)
Return an approximate land elevation for the given EF coordinate position - return value in km.
Definition: sc_earth_elevation.cc:787
sc_earth_elevation(const char *pathToDemFiles)
constructor
Definition: sc_earth_elevation.cc:694
Physical and mathematical constants.
const double FLATTENING_FACTOR
Flattening factor default value which is for the earth.
Definition: sc_constants.h:65
const double RADIUS_EARTH
Earth equatorial radius in km.
Definition: sc_constants.h:59
ElevationPrecision
Elevation precision.
Definition: sc_earth_elevation.h:57
double earth_surface_elevation(double lat, double lon)
Return surface elevation above sea level for the given lat & lon (degrees)
Definition: sc_earth_elevation.cc:158
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.
Definition: sc_earth_elevation.cc:185