shupp / predict Goto Github PK
View Code? Open in Web Editor NEWA partial PHP port of the Gpredict program for real-time satellite tracking and orbit prediction.
A partial PHP port of the Gpredict program for real-time satellite tracking and orbit prediction.
Hi there and thanks for your work.
I would like to retrieve the actual position (lat,long,alt) of a satellite using it tle
is there an easy way to achieve this with your library ?
thx
Firstly, many thanks for your work on this, it's been a number of years since you developed it but it's still working well with PHP 7.4 today!
As I understand it the orbit data is derived from the epoch timestamp in the TLE, if I want to run a prediction for orbit data for the next X hours how can I pass in a custom epoch timestamp?
I run the visible_passes.php and it only outputs the execution time. I run the update_iss_tle.php, switched to the Munich coordinates no change. (PHP 7.3.11)
I also run the tests:
test-001:
DEEP_SPACE_EPHEM: 0 (expected: 0)
+-----------+-------+-------------------+----------------+
| step time | label | result | expected |
+-----------+-------+-------------------+----------------+
| 0 | X | 2328.970679894 | 2328.97048951 |
| | Y | -5995.2208365303 | -5995.22076416 |
| | Z | 1719.970675003 | 1719.97067261 |
| | VX | 2.9120722684876 | 2.9120723 |
| | VY | -0.98341533361961 | -0.98341546 |
| | VZ | -7.0908169591995 | -7.09081703 |
| 360 | X | 2456.1078185219 | 2456.10705566 |
| | Y | -6071.9386872949 | -6071.9385376 |
| | Z | 1222.8956529742 | 1222.89727783 |
| | VX | 2.6793891170929 | 2.67938992 |
| | VY | -0.44828850697443 | -0.44829041 |
| | VZ | -7.2287926088171 | -7.22879231 |
| 720 | X | 2567.5628174962 | 2567.56195068 |
| | Y | -6112.5038266594 | -6112.50384522 |
| | Z | 713.96223091205 | 713.963974 |
| | VX | 2.4402450448499 | 2.44024599 |
| | VY | 0.098110705997632 | 0.09810869 |
| | VZ | -7.3199594406421 | -7.31995916 |
| 1080 | X | 2663.089901107 | 2663.0907898 |
| | Y | -6115.4828512355 | -6115.4822998 |
| | Z | 196.39997365938 | 196.39640427 |
| | VX | 2.1961212031747 | 2.19611958 |
| | VY | 0.65241593650208 | 0.65241995 |
| | VZ | -7.3628241569699 | -7.36282432 |
| 1440 | X | 2742.5539796449 | 2742.55133057 |
| | Y | -6079.6701380186 | -6079.67144775 |
| | Z | -326.38990977996 | -326.38095856 |
| | VX | 1.9484977623213 | 1.94850229 |
| | VY | 1.2110724358902 | 1.21106251 |
| | VZ | -7.3561931161315 | -7.35619372 |
+-----------+-------+-------------------+----------------+
Execution time: 1.42ms
test-002:
DEEP_SPACE_EPHEM: 64 (expected: 64)
+-----------+-------+-------------------+------------------+
| step time | label | result | expected |
+-----------+-------+-------------------+------------------+
| 0 | X | 7495.2201411522 | 7473.3706665 |
| | Y | 462.94809890153 | 428.95261765 |
| | Z | 5835.8349041958 | 5828.74786377 |
| | VX | 5.0882603867801 | 5.1071513 |
| | VY | 6.443501397454 | 6.44468284 |
| | VZ | -0.19471250013834 | -0.18613096 |
| 360 | X | -3288.9442643066 | -3305.22537232 |
| | Y | 32406.513820666 | 32410.86328125 |
| | Z | -24698.039221757 | -24697.17675781 |
| | VX | -1.3007845995153 | -1.30113538 |
| | VY | -1.152411491841 | -1.15131518 |
| | VZ | -0.28406152599689 | -0.28333528 |
| 720 | X | 14274.027501406 | 14271.28759766 |
| | Y | 24124.319408041 | 24110.46411133 |
| | Z | -4717.544641732 | -4725.76837158 |
| | VX | -0.31979616237533 | -0.32050445 |
| | VY | 2.6780090133369 | 2.67984074 |
| | VZ | -2.083730161548 | -2.08405289 |
| 1080 | X | -9974.2370793588 | -9990.05883789 |
| | Y | 22705.004307077 | 22717.35522461 |
| | Z | -23620.751174898 | -23616.890662501 |
| | VX | -1.0168297875949 | -1.01667246 |
| | VY | -2.2917181849532 | -2.29026759 |
| | VZ | 0.72887185127627 | 0.72892364 |
| 1440 | X | 9796.1208521507 | 9787.86975097 |
| | Y | 33758.707410724 | 33753.34667969 |
| | Z | -15022.996600166 | -15030.81176758 |
| | VX | -1.0932750515211 | -1.09425966 |
| | VY | 0.92249936983212 | 0.92358845 |
| | VZ | -1.5229952073342 | -1.52230928 |
+-----------+-------+-------------------+------------------+
Execution time: 1.82ms
I also tried with a well known tle&qth location with a valid pass in ~1 hour in the feature, same result.
While running the examples, system hangs and never returns. I used benchmark.php to pinout the problem.
in find_aos there is a while loop that never returns as it never meets its exit criteria
/* coarse time steps */
while (($sat->el < -1.0) && ($t <= ($start + $maxdt))) {
$t -= 0.00035 * ($sat->el * (($sat->alt / 8400.0) + 0.46) - 2.0);
$this->predict_calc($sat, $qth, $t);
}
I have logged the values pr. iteration but could not upload the file by some reason, but what I see is that $t does not change much pr iteration, the same goes for $sat->el. Result is that the while never returns
The values below is representative for millions of iterations
Questions is if there is php modules that is needed for this to work other than the default installed.
iterations | sat->el | sat->alt | t | start | maxdt |
---|---|---|---|---|---|
0 | -73,975175626402 | -4560,103514259 | 2459617,4481556 | 2459617,4481556 | 10 |
1 | -73,87032519055 | -4561,181733378 | 2459617,44671 | 2459617,4481556 | 10 |
2 | -73,464149095807 | -4560,5291291953 | 2459617,4452641 | 2459617,4481556 | 10 |
3 | -75,310423177676 | -4563,847366679 | 2459617,443832 | 2459617,4481556 | 10 |
4 | -78,015114451347 | -4566,4703585768 | 2459617,442336 | 2459617,4481556 | 10 |
5 | -77,516865451781 | -4560,4099581754 | 2459617,4407525 | 2459617,4481556 | 10 |
6 | -74,636932324811 | -4554,8049470713 | 2459617,4392032 | 2459617,4481556 | 10 |
7 | -73,668009331926 | -4557,434459539 | 2459617,4377549 | 2459617,4481556 | 10 |
8 | -74,451387515641 | -4561,3075714539 | 2459617,4363264 | 2459617,4481556 | 10 |
9 | -73,65694944637 | -4560,7715054378 | 2459617,4348632 | 2459617,4481556 | 10 |
10 | -73,875387357264 | -4561,5292445828 | 2459617,4334248 | 2459617,4481556 | 10 |
11 | -76,699016024553 | -4565,749786223 | 2459617,4319777 | 2459617,4481556 | 10 |
12 | -78,917294329151 | -4565,075014268 | 2459617,4304351 | 2459617,4481556 | 10 |
13 | -76,604863196001 | -4557,2245809497 | 2459617,4288298 | 2459617,4481556 | 10 |
14 | -73,886629026637 | -4555,2627792388 | 2459617,4273171 | 2459617,4481556 | 10 |
15 | -74,156655017189 | -4559,6561184997 | 2459617,425889 | 2459617,4481556 | 10 |
16 | -74,689487120297 | -4561,5841579956 | 2459617,4244395 | 2459617,4481556 | 10 |
17 | -73,409089479928 | -4560,6666999958 | 2459617,4229686 | 2459617,4481556 | 10 |
18 | -74,876013372407 | -4563,4031843497 | 2459617,4215376 | 2459617,4481556 | 10 |
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.