test-003.c 1.93 KB
Newer Older
Jeroen Vreeken's avatar
Jeroen Vreeken committed
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
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
/*
    Gpredict: Real-time satellite tracking and orbit prediction program

    Copyright (C)  2001-2008  Alexandru Csete.

    Authors: Alexandru Csete <csete@users.sourceforge.net>

    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, write to the
          Free Software Foundation, Inc.,
      59 Temple Place, Suite 330,
      Boston, MA  02111-1307
      USA
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "sgp4sdp4.h"

#include "predictlib.h"

#define TEST_STEPS 5


char *tle_str =
"bla bla bla\n"
"1 25544U 98067A   11346.36157800  .00019501  00000-0  25689-3 0  6081\n"
"2 25544  51.6432 344.3748 0024836 155.4957 344.3191 15.58092544748721";

int main (int argc, char **argv)
{
    int i;
    struct predict *predict;
    double t;
    double az, el;
    
    predict = predict_create(tle_str, 51, 5, 25);

    printf ("%s", tle_str);

	t = Julian_Date_of_Year(2012);
	printf("%g\n", t);
	
	printf("JD\taz\tel\n");
	for (i = 0; i < TEST_STEPS; i++) {
		predict_calc_azel(predict, t, &az, &el);
		printf("%f\t%g\t%g\n", t, az, el);		
		t += 1.0/(24.0*60.0);
	}

    return 0;
}