[amsat-bb] Re: Satellite Orbit Prediction in Python
Mark, I dug into the PyEphem code a bit and slapped together my own script that will: - snatch the latest keps from amsat.org - find all passes taking place within the next N minutes ( this is configurable) - provide the user with text / verbal status updates on whatever interval desired. Feel free to take a look here: http://libjoe.blogspot.com/2009/10/where-is-my-satellite-in-python.html For the record, DO NOT SET LAT OR LONG TO A DOUBLE VALUE. Sorry for screaming but... sometimes... you just have to :-) I had a bit of test code that I wrote and took forever trying to figure out why my local pass times were not coming out correctly. It turned out that the UTC times were off as well... I traced this back to initializing my lat/long observer values using a doubleobject as opposed to a stringobject. You have been warned. I sure hope I didn't miss this in the documentation somewhere... All I could find on these in the documentation (without any digging into any of the code) was: These are the attributes you can set: date — Date and time epoch — Epoch for astrometric RA/dec lat — Latitude long — Longitude elevation — Elevation (m) temp — Temperature (°C) pressure — Atmospheric pressure (mBar) Joe On Sep 28, 2009, at 2:06 AM, Mark VandeWettering wrote: > I just thought I'd drop a quick note here about some fun I've been > having today with satellite orbit prediction in Python. When I > started mucking around with satellites, I used "predict", which was > pretty good, but at some point I wanted to answer some questions which > weren't easy to answer using predict. Questions like "when will > AO-51 be visible from both my home in CM87 and locations in Hawaii", > or "what was the radius of the circle of visibility for AO-7 compared > to ISS"? > > Luckily, I'm a programmer. In fact, I'm a programmer who programs > for fun. So, I did a bit of research, and then coded up a version of > G3RUH's "Plan 13" algorithm in Python, and then wrote some scripts to > download elements from celestrak, and then a simple one to print data > on the next pass of any named satellite. And, they worked pretty > good. I've used them for the last year or so to do all my pass > predictions. But there are still a couple of minor issues with the > library. It didn't handle geosynchronous satellites very well. It > implemented only the most basic of orbital models. I was never > confident that the "is this satellite in eclipse" stuff working > exactly right. > > Luckily though, it turns out that someone else has been busy writing a > more complete library: PyEphem http://rhodesmill.org/pyephem/ > > It's a library whose primary purpose is to calculate the positions of > astronomical objects.I've used it a couple of times to (for > instance) figure out the size of Mars compared to Jupiter, and found > it very easy to use. But today, I realized that it had a full > implementation of the SGP4 and SDP4 orbital models built in, and could > be used to predict satellite passes.As a proof of concept, I > hacked together a 23 line script that could print the details of > upcoming ISS passes. It seems to work great, and is really quite > easy to use. > > You can find some of the simple example code at my blog: > > http://brainwagon.org/2009/09/27/how-to-use-python-to-predict-satellite-locations/ > > I'll probably be porting all of my existing scripts to use this soon. > In the mean time, if you have a similar task, you might look to it to > solve your custom satellite prediction problems. > > 73 Mark K6HX > ___ > Sent via amsat...@amsat.org. Opinions expressed are those of the > author. > Not an AMSAT-NA member? Join now to support the amateur satellite > program! > Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb ___ Sent via amsat...@amsat.org. Opinions expressed are those of the author. Not an AMSAT-NA member? Join now to support the amateur satellite program! Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb
[amsat-bb] Re: Satellite Orbit Prediction in Python
Bryan, Thanks for the link especially to the source as I am very interested in implementing something very similar. (for my QTH of course) Thanks Josh Smith KD8HRX email/jabber: juice...@gmail.com phone: 304.237.9369(c) On Mon, Sep 28, 2009 at 2:41 PM, Bryan Klofas wrote: > Hey Mark-- > > We also use pyephem for web-based pass times calculations at Cal Poly. > http://mstl.atl.calpoly.edu/~ops/passtimes/ > > Source is here, but it was written a few years back, and uses the older > (now depreciated) ephem.Body attributes. It also sometimes has trouble > with the formatting on the webpage, although that may be a firefox bug, > I'm not sure. > http://mstl.atl.calpoly.edu/~ops/passtimes/passtimes.py > -- > Bryan Klofas, KF6ZEO > > > Mark VandeWettering wrote: >> I just thought I'd drop a quick note here about some fun I've been >> having today with satellite orbit prediction in Python. When I >> started mucking around with satellites, I used "predict", which was >> pretty good, but at some point I wanted to answer some questions which >> weren't easy to answer using predict. Questions like "when will >> AO-51 be visible from both my home in CM87 and locations in Hawaii", >> or "what was the radius of the circle of visibility for AO-7 compared >> to ISS"? >> >> Luckily, I'm a programmer. In fact, I'm a programmer who programs >> for fun. So, I did a bit of research, and then coded up a version of >> G3RUH's "Plan 13" algorithm in Python, and then wrote some scripts to >> download elements from celestrak, and then a simple one to print data >> on the next pass of any named satellite. And, they worked pretty >> good. I've used them for the last year or so to do all my pass >> predictions. But there are still a couple of minor issues with the >> library. It didn't handle geosynchronous satellites very well. It >> implemented only the most basic of orbital models. I was never >> confident that the "is this satellite in eclipse" stuff working >> exactly right. >> >> Luckily though, it turns out that someone else has been busy writing a >> more complete library: PyEphem http://rhodesmill.org/pyephem/ >> >> It's a library whose primary purpose is to calculate the positions of >> astronomical objects. I've used it a couple of times to (for >> instance) figure out the size of Mars compared to Jupiter, and found >> it very easy to use. But today, I realized that it had a full >> implementation of the SGP4 and SDP4 orbital models built in, and could >> be used to predict satellite passes. As a proof of concept, I >> hacked together a 23 line script that could print the details of >> upcoming ISS passes. It seems to work great, and is really quite >> easy to use. >> >> You can find some of the simple example code at my blog: >> >> http://brainwagon.org/2009/09/27/how-to-use-python-to-predict-satellite-locations/ >> >> I'll probably be porting all of my existing scripts to use this soon. >> In the mean time, if you have a similar task, you might look to it to >> solve your custom satellite prediction problems. >> >> 73 Mark K6HX >> ___ >> Sent via amsat...@amsat.org. Opinions expressed are those of the author. >> Not an AMSAT-NA member? Join now to support the amateur satellite program! >> Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb > ___ > Sent via amsat...@amsat.org. Opinions expressed are those of the author. > Not an AMSAT-NA member? Join now to support the amateur satellite program! > Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb > ___ Sent via amsat...@amsat.org. Opinions expressed are those of the author. Not an AMSAT-NA member? Join now to support the amateur satellite program! Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb
[amsat-bb] Re: Satellite Orbit Prediction in Python
Hey Mark-- We also use pyephem for web-based pass times calculations at Cal Poly. http://mstl.atl.calpoly.edu/~ops/passtimes/ Source is here, but it was written a few years back, and uses the older (now depreciated) ephem.Body attributes. It also sometimes has trouble with the formatting on the webpage, although that may be a firefox bug, I'm not sure. http://mstl.atl.calpoly.edu/~ops/passtimes/passtimes.py -- Bryan Klofas, KF6ZEO Mark VandeWettering wrote: > I just thought I'd drop a quick note here about some fun I've been > having today with satellite orbit prediction in Python. When I > started mucking around with satellites, I used "predict", which was > pretty good, but at some point I wanted to answer some questions which > weren't easy to answer using predict. Questions like "when will > AO-51 be visible from both my home in CM87 and locations in Hawaii", > or "what was the radius of the circle of visibility for AO-7 compared > to ISS"? > > Luckily, I'm a programmer. In fact, I'm a programmer who programs > for fun. So, I did a bit of research, and then coded up a version of > G3RUH's "Plan 13" algorithm in Python, and then wrote some scripts to > download elements from celestrak, and then a simple one to print data > on the next pass of any named satellite. And, they worked pretty > good. I've used them for the last year or so to do all my pass > predictions. But there are still a couple of minor issues with the > library. It didn't handle geosynchronous satellites very well. It > implemented only the most basic of orbital models. I was never > confident that the "is this satellite in eclipse" stuff working > exactly right. > > Luckily though, it turns out that someone else has been busy writing a > more complete library: PyEphem http://rhodesmill.org/pyephem/ > > It's a library whose primary purpose is to calculate the positions of > astronomical objects.I've used it a couple of times to (for > instance) figure out the size of Mars compared to Jupiter, and found > it very easy to use. But today, I realized that it had a full > implementation of the SGP4 and SDP4 orbital models built in, and could > be used to predict satellite passes.As a proof of concept, I > hacked together a 23 line script that could print the details of > upcoming ISS passes. It seems to work great, and is really quite > easy to use. > > You can find some of the simple example code at my blog: > > http://brainwagon.org/2009/09/27/how-to-use-python-to-predict-satellite-locations/ > > I'll probably be porting all of my existing scripts to use this soon. > In the mean time, if you have a similar task, you might look to it to > solve your custom satellite prediction problems. > > 73 Mark K6HX > ___ > Sent via amsat...@amsat.org. Opinions expressed are those of the author. > Not an AMSAT-NA member? Join now to support the amateur satellite program! > Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb ___ Sent via amsat...@amsat.org. Opinions expressed are those of the author. Not an AMSAT-NA member? Join now to support the amateur satellite program! Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb
[amsat-bb] Re: Satellite Orbit Prediction in Python
Joseph Armbruster wrote: > Awesome stuff!! I'll have to check out this library tonight. I > started hacking at something similar but started digging into the > internals of SGP4/SDP4, then got distracted and never finished. If > you have a rotator, it'd be a cool quick project to slap pyserial on > there and control your rotator. It'd be pretty awesome to have a Kep > to Rotator Control in about 10 lines of code :-) > > Joe That reminds me, I should give thanks to Howard, G6LVB. I've never met Howard, but his G6LVB tracker project first put me onto G3RUH's Plan 13 work. Howards PIC based tracker implements Plan 13 to do automatic antenna guiding, and seems very cool. I have actually experimented with using my library to predict and compensate for Doppler shift using my FT-817.I used pyserial to send out frequency change commands as documented in the FT-817 manual. It worked reasonably well. For example, following is a simple visual display of a pass of the three small satellites COMPASS-1, CUTE-1.7 APD and SEEDS that I did back on Jun 13, 2008. WARNING: this JPG is 1.7Mb, and 1600x8000 or so in size. Don't blame me if your computer melts trying to display it. http://brainwagon.org/wp-content/uploads/2008/06/three.jpg You can see COMPASS-1 at the beginning, with its sharply whistling tones. Then CUTE will step in, and finally SEEDS. You can clearly see the steps in frequency every second or so. If you'd rather have the audio, you can get it here: http://brainwagon.org/wp-content/uploads/2008/06/threefer-20080613.mp3 73 Mark K6HX ___ Sent via amsat...@amsat.org. Opinions expressed are those of the author. Not an AMSAT-NA member? Join now to support the amateur satellite program! Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb
[amsat-bb] Re: Satellite Orbit Prediction in Python
Mark, Thanks for the link - I've been considering trying to cobble together a "web service" that will create an ical or rss feed of upcoming passes over my QTH. Hopefully this library is the kick in the rear end I need to get working on this. Thanks, Josh Smith KD8HRX email/jabber: juice...@gmail.com phone: 304.237.9369(c) On Mon, Sep 28, 2009 at 2:06 AM, Mark VandeWettering wrote: > I just thought I'd drop a quick note here about some fun I've been > having today with satellite orbit prediction in Python. When I > started mucking around with satellites, I used "predict", which was > pretty good, but at some point I wanted to answer some questions which > weren't easy to answer using predict. Questions like "when will > AO-51 be visible from both my home in CM87 and locations in Hawaii", > or "what was the radius of the circle of visibility for AO-7 compared > to ISS"? > > Luckily, I'm a programmer. In fact, I'm a programmer who programs > for fun. So, I did a bit of research, and then coded up a version of > G3RUH's "Plan 13" algorithm in Python, and then wrote some scripts to > download elements from celestrak, and then a simple one to print data > on the next pass of any named satellite. And, they worked pretty > good. I've used them for the last year or so to do all my pass > predictions. But there are still a couple of minor issues with the > library. It didn't handle geosynchronous satellites very well. It > implemented only the most basic of orbital models. I was never > confident that the "is this satellite in eclipse" stuff working > exactly right. > > Luckily though, it turns out that someone else has been busy writing a > more complete library: PyEphem http://rhodesmill.org/pyephem/ > > It's a library whose primary purpose is to calculate the positions of > astronomical objects. I've used it a couple of times to (for > instance) figure out the size of Mars compared to Jupiter, and found > it very easy to use. But today, I realized that it had a full > implementation of the SGP4 and SDP4 orbital models built in, and could > be used to predict satellite passes. As a proof of concept, I > hacked together a 23 line script that could print the details of > upcoming ISS passes. It seems to work great, and is really quite > easy to use. > > You can find some of the simple example code at my blog: > > http://brainwagon.org/2009/09/27/how-to-use-python-to-predict-satellite-locations/ > > I'll probably be porting all of my existing scripts to use this soon. > In the mean time, if you have a similar task, you might look to it to > solve your custom satellite prediction problems. > > 73 Mark K6HX > ___ > Sent via amsat...@amsat.org. Opinions expressed are those of the author. > Not an AMSAT-NA member? Join now to support the amateur satellite program! > Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb > ___ Sent via amsat...@amsat.org. Opinions expressed are those of the author. Not an AMSAT-NA member? Join now to support the amateur satellite program! Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb
[amsat-bb] Re: Satellite Orbit Prediction in Python
Awesome stuff!! I'll have to check out this library tonight. I started hacking at something similar but started digging into the internals of SGP4/SDP4, then got distracted and never finished. If you have a rotator, it'd be a cool quick project to slap pyserial on there and control your rotator. It'd be pretty awesome to have a Kep to Rotator Control in about 10 lines of code :-) Joe On Mon, Sep 28, 2009 at 4:12 AM, Rich Dailey (Gmail) wrote: > Great stuff, Mark. I'm an old, dusty assembler, and later a C programmer. > Used to program for fun, > then for profit, then after a few years of life I looked around and the art > had snuck ahead of me. > > I used to hack up the PREDICT code for my own devious purposes, and just to > have fun > with the source. > > Your blog post reminded me of how fun it is to cobble together one's own > code to > solve a particular problem. Keep it up! > > Rich, N8UX > > > Mark wrote: > >You can find some of the simple example code at my blog: > > > > > http://brainwagon.org/2009/09/27/how-to-use-python-to-predict-satellite-locations/ > > > >I'll probably be porting all of my existing scripts to use this soon. > > In the mean time, if you have a similar task, you might look to it to > >solve your custom satellite prediction problems. > > > >73 Mark K6HX > >___ > > ___ > Sent via amsat...@amsat.org. Opinions expressed are those of the author. > Not an AMSAT-NA member? Join now to support the amateur satellite program! > Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb > ___ Sent via amsat...@amsat.org. Opinions expressed are those of the author. Not an AMSAT-NA member? Join now to support the amateur satellite program! Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb
[amsat-bb] Re: Satellite Orbit Prediction in Python
Great stuff, Mark. I'm an old, dusty assembler, and later a C programmer. Used to program for fun, then for profit, then after a few years of life I looked around and the art had snuck ahead of me. I used to hack up the PREDICT code for my own devious purposes, and just to have fun with the source. Your blog post reminded me of how fun it is to cobble together one's own code to solve a particular problem. Keep it up! Rich, N8UX Mark wrote: >You can find some of the simple example code at my blog: > >http://brainwagon.org/2009/09/27/how-to-use-python-to-predict-satellite-locations/ > >I'll probably be porting all of my existing scripts to use this soon. > In the mean time, if you have a similar task, you might look to it to >solve your custom satellite prediction problems. > >73 Mark K6HX >___ ___ Sent via amsat...@amsat.org. Opinions expressed are those of the author. Not an AMSAT-NA member? Join now to support the amateur satellite program! Subscription settings: http://amsat.org/mailman/listinfo/amsat-bb