galmon/tle.hh

41 lines
778 B
C++
Raw Normal View History

2019-09-02 08:13:49 -06:00
#pragma once
#include <string>
#include <map>
#include <memory>
#include <ctime>
2019-09-02 08:13:49 -06:00
class SGP4;
class Tle;
class TLERepo
{
public:
TLERepo();
~TLERepo();
void parseFile(std::string_view fname);
struct Match
{
std::string name;
int norad;
std::string internat;
double inclination{360}; // radians
2019-09-02 08:13:49 -06:00
double ran; // radians
double e{-1};
double ecefX{0}; // m
double ecefY{0}; // m
double ecefZ{0}; // m
2019-09-02 08:13:49 -06:00
double eciX{0}, eciY{0}, eciZ{0}; // m
2019-09-02 08:13:49 -06:00
double distance{-1}; // m
2019-09-03 12:05:40 -06:00
double latitude, longitude, altitude;
2019-09-02 08:13:49 -06:00
};
Match getBestMatch(time_t, double x, double y, double z, Match* secondbest=0);
private:
std::map<std::string,
std::unique_ptr<std::tuple<SGP4, Tle>>
> d_sgp4s;
};