[Gpredict-svn] SF.net SVN: gpredict:[784] trunk/src/predict-tools.c
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <aa...@us...> - 2011-03-13 03:10:38
|
Revision: 784
http://gpredict.svn.sourceforge.net/gpredict/?rev=784&view=rev
Author: aa1vs
Date: 2011-03-13 03:10:32 +0000 (Sun, 13 Mar 2011)
Log Message:
-----------
Add check for slope of elevation in find_los.
Modified Paths:
--------------
trunk/src/predict-tools.c
Modified: trunk/src/predict-tools.c
===================================================================
--- trunk/src/predict-tools.c 2011-03-06 13:18:03 UTC (rev 783)
+++ trunk/src/predict-tools.c 2011-03-13 03:10:32 UTC (rev 784)
@@ -32,7 +32,7 @@
#include <glib/gi18n.h>
#include "sgpsdp/sgp4sdp4.h"
#ifdef HAVE_CONFIG_H
-# include <build-config.h>
+#include <build-config.h>
#endif
#include "gtk-sat-data.h"
#include "time-tools.h"
@@ -229,8 +229,8 @@
{
gdouble t = start;
gdouble lostime = 0.0;
+ gdouble eltemp;
-
predict_calc (sat, qth, start);
/* check whether satellite has aos */
@@ -269,8 +269,19 @@
t += sat->el * sqrt(sat->alt)/502500.0;
predict_calc (sat, qth, t);
- if (fabs(sat->el) < 0.005)
- lostime = t;
+ if (fabs (sat->el) < 0.005) {
+ /* two things are true at LOS time
+ The elevation is a zero and descending.
+ This checks that those two are true.
+ */
+ eltemp = sat->el;
+
+ /*check elevation 1 second earlier*/
+ predict_calc (sat, qth, t-1.0/86400.0);
+
+ if (sat->el > eltemp)
+ lostime = t;
+ }
}
}
@@ -289,8 +300,19 @@
t += sat->el * sqrt(sat->alt)/502500.0;
predict_calc (sat, qth, t);
- if (fabs(sat->el) < 0.005)
- lostime = t;
+ if (fabs(sat->el) < 0.005){
+ /* two things are true at LOS time
+ The elevation is a zero and descending.
+ This checks that those two are true.
+ */
+ eltemp = sat->el;
+
+ /*check elevation 1 second earlier*/
+ predict_calc (sat,qth,t-1.0/86400.0);
+
+ if (sat->el > eltemp)
+ lostime = t;
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|