forked from cubehub/libgpredict
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpredict-tools.h
More file actions
135 lines (107 loc) · 4.49 KB
/
predict-tools.h
File metadata and controls
135 lines (107 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Gpredict: Real-time satellite tracking and orbit prediction program
Copyright (C) 2001-2009 Alexandru Csete, OZ9AEC.
Authors: Alexandru Csete <oz9aec@gmail.com>
Comments, questions and bugreports should be submitted via
http://sourceforge.net/projects/gpredict/
More details can be found at the project home page:
http://gpredict.oz9aec.net/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, visit http://www.fsf.org/
*/
#ifndef PREDICT_TOOLS_H
#define PREDICT_TOOLS_H 1
#include <glib.h>
#include "sgpsdp/sgp4sdp4.h"
#include "gtk-sat-data.h"
#include "sat-vis.h"
#ifdef __cplusplus
extern "C" {
#endif
/** \brief Brief satellite pass info. */
typedef struct {
gchar *satname; /*!< satellite name */
gdouble aos; /*!< AOS time in "jul_utc" */
gdouble tca; /*!< TCA time in "jul_utc" */
gdouble los; /*!< LOS time in "jul_utc" */
gdouble max_el; /*!< Maximum elevation during pass */
gdouble aos_az; /*!< Azimuth at AOS */
gdouble los_az; /*!< Azimuth at LOS */
guint orbit; /*!< Orbit number */
gdouble maxel_az; /*!< Azimuth at maximum elevation */
gchar vis[4]; /*!< Visibility string, e.g. VSE, -S-, V-- */
GSList *details; /*!< List of pass_detail_t entries */
} pass_t;
/** \brief Pass detail entry.
*
* In order to ensure maximum flexibility at a minimal effort, only the
* raw position and velocity is calculated. Calculations of the
* "human readable" parameters are the responsibility of the consumer.
* This way we can use the same prediction engine for various consumers
* without having too much overhead and complexity in the low level code.
*/
typedef struct {
gdouble time; /*!< time in "jul_utc" */
vector_t pos; /*!< Raw unprocessed position at time */
vector_t vel; /*!< Raw unprocessed velocity at time */
gdouble velo;
gdouble az;
gdouble el;
gdouble range;
gdouble range_rate;
gdouble lat;
gdouble lon;
gdouble alt;
gdouble ma;
gdouble phase;
gdouble footprint;
sat_vis_t vis;
guint orbit;
} pass_detail_t;
/** \brief Global settings emulation */
typedef struct {
double min_elevation;
double pred_resolution;
double pred_num_entries;
} settings_t;
/* type casting macros */
#define PASS(x) ((pass_t *) x)
#define PASS_DETAIL(x) ((pass_detail_t *) x)
/* SGP4/SDP4 driver */
void predict_calc (sat_t *sat, qth_t *qth, gdouble t);
/* AOS/LOS time calculators */
gdouble find_aos (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt);
gdouble find_los (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt);
gdouble find_prev_aos (sat_t *sat, qth_t *qth, gdouble start);
/* next events */
pass_t *get_next_pass (sat_t *sat, qth_t *qth, gdouble maxdt, settings_t *settings);
GSList *get_next_passes (sat_t *sat, qth_t *qth, gdouble maxdt, guint num, settings_t *settings);
/* future events */
pass_t *get_pass (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt, settings_t *settings);
GSList *get_passes (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt, guint num, settings_t *settings);
pass_t *get_current_pass (sat_t *sat, qth_t *qth, gdouble start, settings_t *settings);
pass_t *get_pass_no_min_el (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt, settings_t *settings);
/* copying */
pass_t *copy_pass (pass_t *pass);
GSList *copy_pass_details (GSList *details);
pass_detail_t *copy_pass_detail (pass_detail_t *detail);
/* memory cleaning */
void free_pass (pass_t *pass);
void free_passes (GSList *passes);
void free_pass_detail (pass_detail_t *detail);
void free_pass_details (GSList *details);
/* initailize local settings */
void init_settings_by_default(settings_t *settings);
#ifdef __cplusplus
}
#endif
#endif