Height in DEM.
If the Lat:Lon is within one of the provided DEM's, return the data for that pixel.
345 double decrow, deccol, cutc;
346 int32_t erow, ecol, dci, cidx, cbdy;
348 uint32_t
i, j, dsize, m;
356 if (
bodies[body-1] == NULL)
361 if (std::isnan(lat) || std::isnan(lon) || lat<-DPI2 || lat>
DPI || lon<-DPI || lon>
DPI)
364 if (
bodies[body-1] == NULL)
371 ecol = (int32_t)(400.*(lon + DPI)/
D2PI);
377 erow = (int32_t)(200.*(lat +
DPI2)/
DPI);
388 if (lon >=
bodies[body-1]->dems[j].lonul-1
e-13 && lon <=
bodies[body-1]->dems[j].lonlr+1
e-13 && lat >=
389 bodies[body-1]->dems[j].latlr-1
e-13 && lat <=
bodies[body-1]->dems[j].latul+1
e-13)
393 if (res/
bodies[body-1]->dems[j].psize >= 2.)
404 if (sdem->
pixel.size() == 0)
418 if (
bodies[m]->dems[i].pixel.size())
420 if (
bodies[m]->dems[i].utc < cutc)
446 fname +=
"/mapping/";
450 fp = fopen(fname.c_str(),
"rb");
457 for (i=0; i<sdem->
ycount; i++)
482 decrow = ((sdem->
latul - lat) /sdem->
psize) - .5;
486 drow = (uint32_t)decrow;
489 deccol = ((lon - sdem->
lonul) /sdem->
psize) + .5;
493 dcol = (int32_t)deccol;
497 pixel = sdem->
pixel[drow][dcol];
vector< vector< dem_pixel > > pixel
Definition: demlib.h:105
float nmap[3]
Definition: demlib.h:85
Definition: eci2kep_test.cpp:33
int i
Definition: rw_test.cpp:37
int count
Definition: rw_test.cpp:36
int iretn
Definition: rw_test.cpp:37
double latul
Definition: demlib.h:96
map_dem_body * map_dem_open(int bodynum)
Definition: demlib.cpp:149
uint16_t demcount
Definition: demlib.h:123
const double DPI2
Double precision PI/2.
Definition: math/constants.h:18
float alt
Definition: demlib.h:84
double utc
Definition: demlib.h:93
double lonul
Definition: demlib.h:95
string get_cosmosresources(bool create_flag)
Return COSMOS Resources Directory.
Definition: datalib.cpp:1337
static uint32_t maxalloc
Definition: demlib.cpp:44
DEM support structure.
Definition: demlib.h:91
static uint32_t totalloc
Definition: demlib.cpp:44
uint16_t demindexc[200][400]
Definition: demlib.h:126
static char fname[100]
Definition: geomag.cpp:89
static int running
Definition: demlib.cpp:48
uint32_t xcount
Definition: demlib.h:101
double psize
Definition: demlib.h:99
map_dem_body * bodies[20]
Definition: demlib.cpp:42
double currentmjd(double offset)
Current UTC in Modified Julian Days.
Definition: timelib.cpp:65
uint32_t ycount
Definition: demlib.h:102
static std::mutex bsem
Definition: demlib.cpp:46
const double D2PI
Double precision 2*PI.
Definition: math/constants.h:16
#define MAX_DEM_BODIES
Definition: demlib.h:71
double htov
Definition: demlib.h:119
double vscale
Definition: demlib.h:117
FILE * fp
Definition: rw_test.cpp:38
const double DPI
Double precision PI.
Definition: math/constants.h:14
Location value.
Definition: demlib.h:82
string name
Definition: demlib.h:113
map_dem_dem dems[30000]
Definition: demlib.h:124
char name[50]
Definition: demlib.h:94
int16_t demindexi[200][400][100]
Definition: demlib.h:125