COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
demlib.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
34 
54 #ifndef MAP_DEM_H
55 #define MAP_DEM_H
56 
57 #include "support/configCosmos.h"
58 
62 
63 #define MAP_DEM_ERROR_BODY -1
64 #define MAP_DEM_ERROR_SPECS -2
65 
66 #define DEM_TYPE_SINGLE 1
67 #define DEM_TYPE_MULTI 2
68 
69 #define DEM_CACHE_NUM 5
70 #define MAX_DEMINDEX 100
71 #define MAX_DEM_BODIES 20
72 
74 
78 
80 
82 typedef struct
83 {
84  float alt;
85  float nmap[3];
86 } dem_pixel;
87 
89 
91 typedef struct
92 {
93  double utc;
94  char name[50];
95  double lonul;
96  double latul;
97  double lonlr;
98  double latlr;
99  double psize;
100  double scale;
101  uint32_t xcount;
102  uint32_t ycount;
103  double dlon;
104  double dlat;
105  vector< vector<dem_pixel> > pixel;
106 } map_dem_dem;
107 
109 
111 typedef struct
112 {
113  string name;
114  double orbit;
115  double radius;
116  double highest;
117  double vscale;
118  double hscale;
119  double htov;
120  double alt1;
121  double alt2;
122  double alt3;
123  uint16_t demcount;
124  map_dem_dem dems[30000];
125  int16_t demindexi[200][400][MAX_DEMINDEX];
126  uint16_t demindexc[200][400];
127 } map_dem_body;
128 
130 
134 
135 map_dem_body *planet_dem(int body);
136 void map_dem_close(map_dem_body *body);
137 void map_dem_cache(int body,int num);
138 map_dem_body *map_dem_open(int body);
139 void map_dem_scale(map_dem_body *body, double vscale, double hscale);
140 int map_dem_tilt(int body, double lon, double lat, double scale, dem_pixel *pixel);
141 dem_pixel map_dem_pixel(int body, double lon, double lat, double res);
142 dem_pixel map_dem_pixel(int body,double lon, double lat, double res);
143 double map_dem_alt(int body, double lon, double lat, double res);
144 int map_dem_init();
146 
147 #endif
double alt3
Definition: demlib.h:122
vector< vector< dem_pixel > > pixel
Definition: demlib.h:105
#define MAX_DEMINDEX
Definition: demlib.h:70
int map_dem_init()
Definition: demlib.cpp:66
double radius
Definition: demlib.h:115
double hscale
Definition: demlib.h:118
int map_dem_tilt(int body, double lon, double lat, double scale, dem_pixel *pixel)
Definition: demlib.cpp:506
double latul
Definition: demlib.h:96
double alt1
Definition: demlib.h:120
map_dem_body * map_dem_open(int body)
Definition: demlib.cpp:149
uint16_t demcount
Definition: demlib.h:123
float alt
Definition: demlib.h:84
double utc
Definition: demlib.h:93
double lonul
Definition: demlib.h:95
Planetary body support structure.
Definition: demlib.h:111
dem_pixel map_dem_pixel(int body, double lon, double lat, double res)
Height in DEM.
Definition: demlib.cpp:342
DEM support structure.
Definition: demlib.h:91
Headers and definitions common to all COSMOS.
string name
Definition: cubesat2obj.cpp:6
double lonlr
Definition: demlib.h:97
uint32_t xcount
Definition: demlib.h:101
map_dem_body * planet_dem(int body)
Body for DEM.
Definition: demlib.cpp:57
double psize
Definition: demlib.h:99
double dlon
Definition: demlib.h:103
double highest
Definition: demlib.h:116
double orbit
Definition: demlib.h:114
uint32_t ycount
Definition: demlib.h:102
double map_dem_alt(int body, double lon, double lat, double res)
Definition: demlib.cpp:326
double htov
Definition: demlib.h:119
double vscale
Definition: demlib.h:117
double latlr
Definition: demlib.h:98
Location value.
Definition: demlib.h:82
string name
Definition: demlib.h:113
void map_dem_scale(map_dem_body *body, double vscale, double hscale)
Definition: demlib.cpp:319
double alt2
Definition: demlib.h:121
void map_dem_close(map_dem_body *body)
double dlat
Definition: demlib.h:104
void map_dem_cache(int body, int num)
Definition: demlib.cpp:99
double scale
Definition: demlib.h:100