Moon Bounce Day

Mark K6HX is wickedly smart. He seems to write chunks of code for all kinds of things.

http://brainwagon.org/2010/03/25/moon-bounce-day-where-do-i-aim-the-antenna/


So there is a back story here....    The fine folks at the Arecibo Radio Observatory in Puerto Rico will be operating moon bounce on 432MHz soon.  (I will post more details on this later in this LONG post.)

Mark asked the question that most people with "The Knack" would ask... where will the moon be in the sky from my QTH. Instead of just going to the internet to look up the data he wrote a program to figure it out. It turns out that it is moderately simple to get this work on your PC.

I am running Ubuntu so my instructions will describe how to do this on Linux.
  • Python is already installed by default.
  • sudo apt-get install python-setuptools
  • sudo easy_install pyephem
  • then copy the code (below) into an editor
  • change the latitude and longitude
  • save it as: moon.py
  • run it: python moon.py
Here is the code:

#!/usr/bin/env python

#Script copied from K6HX
#http://brainwagon.org/2010/03/25/moon-bounce-day-where-do-i-aim-the-antenna/


import sys
import os
import optparse
import ephem
from math import degrees

from datetime import date, datetime

h = ephem.Observer()
m = ephem.Moon()

# K1JT mentioned these as likely times for moonbounce operations
# from the Arecibo Radio Observatory in Puerto Rico...

datetimes = [('2010/4/16 16:45', '2010/4/16 19:30'),
             ('2010/4/17 17:40', '2010/4/17 20:20'),
             ('2010/4/18 18:40', '2010/4/18 21:25')]

# I'm currently in grid EN25ue, which is centered here.

me = ephem.Observer()
me.lat, me.long = ('45.192990', '-94.310570')

moon = ephem.Moon()

print " MOON LOCATION ".center(55, "=")
print ("Observer at %.2f, %.2f" % (degrees(me.lat), degrees(me.long))).center(55, '-')
print

for sd, ed in datetimes:
    sd = ephem.Date(sd)
    ed = ephem.Date(ed)
    me.date = sd
    print "Time (UTC)           Time (Local)            Alt   Az  "
    print "--------------------+---------------------+-----------+"
    while me.date <= ed:
        moon.compute(me)
        print "%02d/%02d/%02d %02d:%02d:%02d |" % me.date.tuple(),
        lt = ephem.localtime(me.date)
        print "%02d/%02d/%02d %02d:%02d:%02d |" % (lt.year, lt.month, lt.day, lt.hour, lt.minute, lt.second),
        print '%4.1f %5.1f|' % (degrees(moon.alt), degrees(moon.az))
        me.date = ephem.Date(me.date + 5 * ephem.minute)
    print "--------------------+---------------------+-----------+"
    print

Here is the result:
==================== MOON LOCATION ====================
---------------Observer at 45.19, -94.31---------------

Time (UTC)           Time (Local)            Alt   Az 
--------------------+---------------------+-----------+
2010/04/16 16:44:59 | 2010/04/16 11:44:59 | 44.6 104.5|
2010/04/16 16:49:59 | 2010/04/16 11:49:59 | 45.4 105.6|
2010/04/16 16:54:59 | 2010/04/16 11:54:59 | 46.2 106.7|
2010/04/16 16:59:59 | 2010/04/16 11:59:59 | 47.1 107.8|
2010/04/16 17:04:59 | 2010/04/16 12:04:59 | 47.9 108.9|
2010/04/16 17:09:59 | 2010/04/16 12:09:59 | 48.7 110.1|
2010/04/16 17:14:59 | 2010/04/16 12:14:59 | 49.5 111.3|
2010/04/16 17:19:59 | 2010/04/16 12:19:59 | 50.3 112.5|
2010/04/16 17:24:59 | 2010/04/16 12:24:59 | 51.1 113.8|
2010/04/16 17:29:59 | 2010/04/16 12:29:59 | 51.9 115.1|
2010/04/16 17:34:59 | 2010/04/16 12:34:59 | 52.7 116.4|
2010/04/16 17:39:59 | 2010/04/16 12:39:59 | 53.4 117.8|
2010/04/16 17:44:59 | 2010/04/16 12:44:59 | 54.2 119.2|
2010/04/16 17:49:59 | 2010/04/16 12:49:59 | 55.0 120.7|
2010/04/16 17:54:59 | 2010/04/16 12:54:59 | 55.7 122.1|
2010/04/16 17:59:59 | 2010/04/16 12:59:59 | 56.4 123.7|
2010/04/16 18:04:59 | 2010/04/16 13:04:59 | 57.2 125.3|
2010/04/16 18:09:59 | 2010/04/16 13:09:59 | 57.9 126.9|
2010/04/16 18:14:59 | 2010/04/16 13:14:59 | 58.5 128.6|
2010/04/16 18:19:59 | 2010/04/16 13:19:59 | 59.2 130.4|
2010/04/16 18:24:59 | 2010/04/16 13:24:59 | 59.9 132.2|
2010/04/16 18:29:59 | 2010/04/16 13:29:59 | 60.5 134.1|
2010/04/16 18:34:59 | 2010/04/16 13:34:59 | 61.1 136.0|
2010/04/16 18:39:59 | 2010/04/16 13:39:59 | 61.7 138.0|
2010/04/16 18:44:59 | 2010/04/16 13:44:59 | 62.3 140.1|
2010/04/16 18:49:59 | 2010/04/16 13:49:59 | 62.8 142.2|
2010/04/16 18:54:59 | 2010/04/16 13:54:59 | 63.4 144.5|
2010/04/16 18:59:59 | 2010/04/16 13:59:59 | 63.9 146.7|
2010/04/16 19:04:59 | 2010/04/16 14:04:59 | 64.3 149.1|
2010/04/16 19:09:59 | 2010/04/16 14:09:59 | 64.8 151.5|
2010/04/16 19:14:59 | 2010/04/16 14:14:59 | 65.2 154.0|
2010/04/16 19:19:59 | 2010/04/16 14:19:59 | 65.5 156.6|
2010/04/16 19:24:59 | 2010/04/16 14:24:59 | 65.9 159.2|
2010/04/16 19:29:59 | 2010/04/16 14:29:59 | 66.2 161.9|
--------------------+---------------------+-----------+

Time (UTC)           Time (Local)            Alt   Az 
--------------------+---------------------+-----------+
2010/04/17 17:39:59 | 2010/04/17 12:39:59 | 46.0 102.1|
2010/04/17 17:44:59 | 2010/04/17 12:44:59 | 46.8 103.2|
2010/04/17 17:49:59 | 2010/04/17 12:49:59 | 47.7 104.2|
2010/04/17 17:54:59 | 2010/04/17 12:54:59 | 48.5 105.3|
2010/04/17 17:59:59 | 2010/04/17 12:59:59 | 49.3 106.5|
2010/04/17 18:04:59 | 2010/04/17 13:04:59 | 50.2 107.6|
2010/04/17 18:09:59 | 2010/04/17 13:09:59 | 51.0 108.8|
2010/04/17 18:14:59 | 2010/04/17 13:14:59 | 51.8 110.0|
2010/04/17 18:19:59 | 2010/04/17 13:19:59 | 52.6 111.2|
2010/04/17 18:24:59 | 2010/04/17 13:24:59 | 53.4 112.5|
2010/04/17 18:29:59 | 2010/04/17 13:29:59 | 54.2 113.8|
2010/04/17 18:34:59 | 2010/04/17 13:34:59 | 55.0 115.2|
2010/04/17 18:39:59 | 2010/04/17 13:39:59 | 55.8 116.6|
2010/04/17 18:44:59 | 2010/04/17 13:44:59 | 56.5 118.0|
2010/04/17 18:49:59 | 2010/04/17 13:49:59 | 57.3 119.5|
2010/04/17 18:54:59 | 2010/04/17 13:54:59 | 58.0 121.0|
2010/04/17 18:59:59 | 2010/04/17 13:59:59 | 58.8 122.6|
2010/04/17 19:04:59 | 2010/04/17 14:04:59 | 59.5 124.3|
2010/04/17 19:09:59 | 2010/04/17 14:09:59 | 60.2 126.0|
2010/04/17 19:14:59 | 2010/04/17 14:14:59 | 60.9 127.7|
2010/04/17 19:19:59 | 2010/04/17 14:19:59 | 61.6 129.5|
2010/04/17 19:24:59 | 2010/04/17 14:24:59 | 62.2 131.4|
2010/04/17 19:29:59 | 2010/04/17 14:29:59 | 62.9 133.4|
2010/04/17 19:34:59 | 2010/04/17 14:34:59 | 63.5 135.5|
2010/04/17 19:39:59 | 2010/04/17 14:39:59 | 64.1 137.6|
2010/04/17 19:44:59 | 2010/04/17 14:44:59 | 64.6 139.8|
2010/04/17 19:49:59 | 2010/04/17 14:49:59 | 65.2 142.1|
2010/04/17 19:54:59 | 2010/04/17 14:54:59 | 65.7 144.4|
2010/04/17 19:59:59 | 2010/04/17 14:59:59 | 66.2 146.9|
2010/04/17 20:04:59 | 2010/04/17 15:04:59 | 66.7 149.4|
2010/04/17 20:09:59 | 2010/04/17 15:09:59 | 67.1 152.0|
2010/04/17 20:14:59 | 2010/04/17 15:14:59 | 67.5 154.7|
2010/04/17 20:19:59 | 2010/04/17 15:19:59 | 67.8 157.5|
--------------------+---------------------+-----------+

Time (UTC)           Time (Local)            Alt   Az 
--------------------+---------------------+-----------+
2010/04/18 18:40:00 | 2010/04/18 13:40:00 | 46.9 101.8|
2010/04/18 18:45:00 | 2010/04/18 13:45:00 | 47.7 102.9|
2010/04/18 18:49:59 | 2010/04/18 13:49:59 | 48.5 104.0|
2010/04/18 18:54:59 | 2010/04/18 13:54:59 | 49.4 105.1|
2010/04/18 18:59:59 | 2010/04/18 13:59:59 | 50.2 106.2|
2010/04/18 19:04:59 | 2010/04/18 14:04:59 | 51.0 107.4|
2010/04/18 19:09:59 | 2010/04/18 14:09:59 | 51.8 108.6|
2010/04/18 19:14:59 | 2010/04/18 14:14:59 | 52.6 109.8|
2010/04/18 19:19:59 | 2010/04/18 14:19:59 | 53.5 111.0|
2010/04/18 19:24:59 | 2010/04/18 14:24:59 | 54.2 112.3|
2010/04/18 19:29:59 | 2010/04/18 14:29:59 | 55.0 113.6|
2010/04/18 19:34:59 | 2010/04/18 14:34:59 | 55.8 115.0|
2010/04/18 19:39:59 | 2010/04/18 14:39:59 | 56.6 116.4|
2010/04/18 19:44:59 | 2010/04/18 14:44:59 | 57.4 117.9|
2010/04/18 19:49:59 | 2010/04/18 14:49:59 | 58.1 119.4|
2010/04/18 19:54:59 | 2010/04/18 14:54:59 | 58.9 121.0|
2010/04/18 19:59:59 | 2010/04/18 14:59:59 | 59.6 122.6|
2010/04/18 20:04:59 | 2010/04/18 15:04:59 | 60.3 124.2|
2010/04/18 20:09:59 | 2010/04/18 15:09:59 | 61.0 126.0|
2010/04/18 20:14:59 | 2010/04/18 15:14:59 | 61.7 127.8|
2010/04/18 20:19:59 | 2010/04/18 15:19:59 | 62.4 129.7|
2010/04/18 20:24:59 | 2010/04/18 15:24:59 | 63.0 131.6|
2010/04/18 20:29:59 | 2010/04/18 15:29:59 | 63.6 133.6|
2010/04/18 20:34:59 | 2010/04/18 15:34:59 | 64.2 135.7|
2010/04/18 20:39:59 | 2010/04/18 15:39:59 | 64.8 137.9|
2010/04/18 20:44:59 | 2010/04/18 15:44:59 | 65.4 140.1|
2010/04/18 20:49:59 | 2010/04/18 15:49:59 | 65.9 142.5|
2010/04/18 20:54:59 | 2010/04/18 15:54:59 | 66.4 144.9|
2010/04/18 20:59:59 | 2010/04/18 15:59:59 | 66.9 147.4|
2010/04/18 21:04:59 | 2010/04/18 16:04:59 | 67.4 150.0|
2010/04/18 21:09:59 | 2010/04/18 16:09:59 | 67.8 152.7|
2010/04/18 21:14:59 | 2010/04/18 16:14:59 | 68.2 155.5|
2010/04/18 21:19:59 | 2010/04/18 16:19:59 | 68.5 158.3|
2010/04/18 21:24:59 | 2010/04/18 16:24:59 | 68.8 161.2|
--------------------+---------------------+-----------+


It took me longer to document this than it did to figure out how to install the python module and hack Mark's code.  (Did I mention that he is wickedly smart?)

Ok... here is the rest of the back story:

Subject: KP4AO on 432 EME
Date: Sun, 04 Apr 2010 20:41:26 -0400
From: Joe Taylor
To: moon-net@list-serv.davidv.net, moon@moonbounce.info, Packrats List , wsjtgroup@yahoogroups.com
 
In less that two weeks the Arecibo Observatory Amateur Radio Club will again put the 1000-foot radio telescope on the air for 432 MHz EME.The scheduled times of operation are:
 
April 16: 1645 - 1930 UTC
April 17: 1740 - 2020 UTC
April 18: 1840 - 2125 UTC
 
Callsign: KP4AO
Tx Frequency: 432.045 MHz
Rx Frequency: 432.050 to 432.060+
Tx power: 400 W
Antenna gain: 60 dBi
System noise temp: 120 K (cold sky)
System noise temp: 330 K (when pointed at moon)
 
KP4AO can be heard with a small hand-held yagi pointed at the moon, and a good receiver. A 15 dBi antenna and 100 W will be enough to work us on CW.
 
Operators at KP4AO will do their best to work as many stations as possible. Each session will start with a brief announcement and CQ in SSB. SSB QSOs may continue for 30 minutes to an hour, if the QSO rate remains high. The mode will be shifted to CW as soon as it is judged that higher QSO rates would result.
 
We will listen for calls at frequencies 5-15 kHz higher than our own, and even higher if QRM warrants. Callers who s-p-r-e-a-d o-u-t are more likely to be copied.
 
If you've already worked us in any mode, please do not call again -- give others a chance.
 
If we call "CQ QRP", we will listen for stations running 100 W or less to a single yagi. Please do not answer such a CQ if you are running more power or have a larger antenna.
 
On April 18, if we reach a condition where most calling stations have been worked, and we judge that operating in the digital mode JT65B would produce a higher QSO rate, we will switch to JT65B.
 
Note that any of these planned operating strategies may be changed as circumstances dictate.
 
We are extremely fortunate to have been granted access to the world's largest radio telescope for this amateur radio good-will event. We look forward to working as many stations as possible in the alloted time!


-----------------------
Thanks to Jason NT7S for pointing me towards Mark's code.