Thread: [Gpredict-svn] SF.net SVN: gpredict:[265] trunk/src/predict-tools.c
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <cs...@us...> - 2009-04-13 10:39:03
|
Revision: 265
http://gpredict.svn.sourceforge.net/gpredict/?rev=265&view=rev
Author: csete
Date: 2009-04-13 10:38:53 +0000 (Mon, 13 Apr 2009)
Log Message:
-----------
Fixed a bug that could cause find_aos() to go into infinite loop.
Modified Paths:
--------------
trunk/src/predict-tools.c
Modified: trunk/src/predict-tools.c
===================================================================
--- trunk/src/predict-tools.c 2009-04-13 00:29:32 UTC (rev 264)
+++ trunk/src/predict-tools.c 2009-04-13 10:38:53 UTC (rev 265)
@@ -148,7 +148,7 @@
t = find_los (sat, qth, start, maxdt) + 0.014; // +20 min
/* invalid time (potentially returned by find_los) */
- if (t < 0.014)
+ if (t < 0.1)
return 0.0;
/* update satellite data */
@@ -159,7 +159,6 @@
/* coarse time steps */
while ((sat->el < -1.0) && (t <= (start + maxdt))) {
-
t -= 0.00035 * (sat->el * ((sat->alt / 8400.0) + 0.46) - 2.0);
predict_calc (sat, qth, t);
}
@@ -622,6 +621,7 @@
for (i = 0; i < num; i++) {
pass = get_pass (sat, qth, t, maxdt);
+ g_print ("%s: %d\n", __FUNCTION__, i);
if (pass != NULL) {
passes = g_slist_prepend (passes, pass);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2010-01-17 21:39:53
|
Revision: 592
http://gpredict.svn.sourceforge.net/gpredict/?rev=592&view=rev
Author: csete
Date: 2010-01-17 21:39:37 +0000 (Sun, 17 Jan 2010)
Log Message:
-----------
Applied patch 2933879 from Charles Suprin AA1VS.
Modified Paths:
--------------
trunk/src/predict-tools.c
Modified: trunk/src/predict-tools.c
===================================================================
--- trunk/src/predict-tools.c 2010-01-17 21:31:58 UTC (rev 591)
+++ trunk/src/predict-tools.c 2010-01-17 21:39:37 UTC (rev 592)
@@ -39,9 +39,9 @@
#include "sat-cfg.h"
#include "orbit-tools.h"
#include "predict-tools.h"
+#include "sat-log.h"
-
/** \brief SGP4SDP4 driver for doing AOS/LOS calculations.
* \param sat Pointer to the satellite data.
* \param qth Pointer to the QTH data.
@@ -619,7 +619,6 @@
t = start;
for (i = 0; i < num; i++) {
-
pass = get_pass (sat, qth, t, maxdt);
if (pass != NULL) {
@@ -639,6 +638,14 @@
}
}
+ /*make a log entry in case num is set too small*/
+ /*i=num+1 if kicked out of loop due to internal condition*/
+
+ if (i == num){
+ sat_log_log (SAT_LOG_LEVEL_ERROR,
+ _("More future passes than requested in time window %f %f than requested %d in %s"),start,maxdt,num,
+ __FUNCTION__);
+ }
if (passes != NULL)
passes = g_slist_reverse (passes);
@@ -738,15 +745,15 @@
void
free_pass (pass_t *pass)
{
- free_pass_details (pass->details);
-
- if (pass->satname != NULL) {
- g_free (pass->satname);
- pass->satname = NULL;
- }
-
- g_free (pass);
- pass = NULL;
+ free_pass_details (pass->details);
+
+ if (pass->satname != NULL) {
+ g_free (pass->satname);
+ pass->satname = NULL;
+ }
+
+ g_free (pass);
+ pass = NULL;
}
@@ -1016,6 +1023,13 @@
t = get_current_daynum ();
predict_calc (sat, qth, t);
+ /* check whether satellite has aos */
+ if (has_aos (sat, qth)) {
+
+ return NULL;
+
+ }
+
/* find a time before AOS */
while (sat->el > -2.0) {
predict_calc (sat, qth, t);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cs...@us...> - 2010-01-28 14:09:39
|
Revision: 596
http://gpredict.svn.sourceforge.net/gpredict/?rev=596&view=rev
Author: csete
Date: 2010-01-28 14:09:33 +0000 (Thu, 28 Jan 2010)
Log Message:
-----------
Replaced incorrect error message with info. The pass condition are 'either or' and only one of the conditions have to be met before stopping the search for future passes.
Modified Paths:
--------------
trunk/src/predict-tools.c
Modified: trunk/src/predict-tools.c
===================================================================
--- trunk/src/predict-tools.c 2010-01-21 20:55:36 UTC (rev 595)
+++ trunk/src/predict-tools.c 2010-01-28 14:09:33 UTC (rev 596)
@@ -638,18 +638,14 @@
}
}
- /*make a log entry in case num is set too small*/
- /*i=num+1 if kicked out of loop due to internal condition*/
-
- if (i == num){
- sat_log_log (SAT_LOG_LEVEL_ERROR,
- _("More future passes than requested in time window %f %f than requested %d in %s"),start,maxdt,num,
- __FUNCTION__);
- }
if (passes != NULL)
passes = g_slist_reverse (passes);
+ sat_log_log (SAT_LOG_LEVEL_MSG,
+ _("%s: Found %d passes for %s in time window [%f;%f]"),
+ __FUNCTION__, g_slist_length (passes), sat->nickname, start, start+maxdt);
+
return passes;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa...@us...> - 2010-10-29 02:10:43
|
Revision: 694
http://gpredict.svn.sourceforge.net/gpredict/?rev=694&view=rev
Author: aa1vs
Date: 2010-10-29 02:10:37 +0000 (Fri, 29 Oct 2010)
Log Message:
-----------
Explitly compute pass LOS_AZ
Modified Paths:
--------------
trunk/src/predict-tools.c
Modified: trunk/src/predict-tools.c
===================================================================
--- trunk/src/predict-tools.c 2010-10-27 16:01:35 UTC (rev 693)
+++ trunk/src/predict-tools.c 2010-10-29 02:10:37 UTC (rev 694)
@@ -571,6 +571,8 @@
pass->details = g_slist_reverse (pass->details);
+ /* calculate satellite data */
+ predict_calc (sat, qth, pass->los);
/* store los_az, max_el and tca */
pass->los_az = sat->az;
pass->max_el = max_el;
@@ -996,6 +998,8 @@
pass->details = g_slist_reverse (pass->details);
+ /* calculate satellite data */
+ predict_calc (sat, qth, pass->los);
/* store los_az, max_el and tca */
pass->los_az = sat->az;
pass->max_el = max_el;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa...@us...> - 2010-11-05 11:23:33
|
Revision: 705
http://gpredict.svn.sourceforge.net/gpredict/?rev=705&view=rev
Author: aa1vs
Date: 2010-11-05 11:23:27 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
get_pass and get_pass_no_min_el now work on copies of sat_t structure to address bug 3099314
Modified Paths:
--------------
trunk/src/predict-tools.c
Modified: trunk/src/predict-tools.c
===================================================================
--- trunk/src/predict-tools.c 2010-11-01 19:54:24 UTC (rev 704)
+++ trunk/src/predict-tools.c 2010-11-05 11:23:27 UTC (rev 705)
@@ -418,7 +418,7 @@
* reversed
*/
pass_t *
-get_pass (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt)
+get_pass (sat_t *sat_in, qth_t *qth, gdouble start, gdouble maxdt)
{
gdouble aos = 0.0; /* time of AOS */
gdouble tca = 0.0; /* time of TCA */
@@ -433,9 +433,12 @@
pass_detail_t *detail = NULL;
gboolean done = FALSE;
guint iter = 0; /* number of iterations */
-
+ sat_t *sat,sat_working;
/* FIXME: watchdog */
+ /*copy sat_in to a working structure*/
+ sat = memcpy(&sat_working,sat_in,sizeof(sat_t));
+
/* get time resolution; sat-cfg stores it in seconds */
tres = sat_cfg_get_int (SAT_CFG_INT_PRED_RESOLUTION) / 86400.0;
@@ -862,7 +865,7 @@
* reversed
*/
pass_t *
-get_pass_no_min_el (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt)
+get_pass_no_min_el (sat_t *sat_in, qth_t *qth, gdouble start, gdouble maxdt)
{
gdouble aos = 0.0; /* time of AOS */
gdouble tca = 0.0; /* time of TCA */
@@ -876,10 +879,13 @@
pass_t *pass = NULL;
pass_detail_t *detail = NULL;
gboolean done = FALSE;
+ sat_t *sat,sat_working;
-
/* FIXME: watchdog */
+ /*copy sat_in to a working structure*/
+ sat = memcpy(&sat_working,sat_in,sizeof(sat_t));
+
/* get time resolution; sat-cfg stores it in seconds */
tres = sat_cfg_get_int (SAT_CFG_INT_PRED_RESOLUTION) / 86400.0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <aa...@us...> - 2010-11-07 01:01:47
|
Revision: 709
http://gpredict.svn.sourceforge.net/gpredict/?rev=709&view=rev
Author: aa1vs
Date: 2010-11-07 01:01:41 +0000 (Sun, 07 Nov 2010)
Log Message:
-----------
get_current_pass now works on a copy of sat_t structure to address bug 3099314
Modified Paths:
--------------
trunk/src/predict-tools.c
Modified: trunk/src/predict-tools.c
===================================================================
--- trunk/src/predict-tools.c 2010-11-06 15:17:48 UTC (rev 708)
+++ trunk/src/predict-tools.c 2010-11-07 01:01:41 UTC (rev 709)
@@ -986,7 +986,7 @@
default:
break;
}
-
+
pass->details = g_slist_prepend (pass->details, detail);
/* store elevation if greater than the
@@ -1036,11 +1036,14 @@
*
*/
pass_t *
-get_current_pass (sat_t *sat, qth_t *qth, gdouble start)
+get_current_pass (sat_t *sat_in, qth_t *qth, gdouble start)
{
gdouble t;
+ sat_t *sat,sat_working;
+
+ /*copy sat_in to a working structure*/
+ sat = memcpy(&sat_working,sat_in,sizeof(sat_t));
-
if (start > 0.0)
t = start;
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|