moondial

A sun clock that shows moon and planet positions along with the moon's terminator, a strip with mean time at every longitude, and selected cities with lines to their respective civil time.
git clone https://code.literati.org/moondial.git
Log | Files | Refs | README | LICENSE

README.md (2183B)


      1 About
      2 =====
      3 
      4 This is a Python implementation of an extremely expensive physical sun
      5 clock I saw at Brookstone or something. In addition to showing the
      6 lighted areas of the world with visually distinct sunset, civil,
      7 nautical, and astronomical twilight terminators, it also shows the
      8 current surface location of the sun, the moon, and all the planets,
      9 and the lunar terminator. A strip at the bottom shows the current mean
     10 time for every longitude, with lines drawn from cities to their
     11 respective civil time, making the difference clear.
     12 
     13 I originally wrote this back in 2006. I polished it up and did the
     14 minimum work necessary to port it to Python 3 (and from Astrolabe to
     15 Astronomia) in 2013, adding the lunar terminator and making some other
     16 minor tweaks at the same time.
     17 
     18 
     19 Requirements
     20 ============
     21 
     22 * Python 3 (confirmed to work with 3.6.4)
     23 * [Pygame 2.0](http://thorbrian.com/pygame/builds.php)
     24 * [Astronomia](https://pypi.python.org/pypi/astronomia)
     25 * [Pytz](https://pypi.python.org/pypi/pytz)
     26 * Numpy
     27 
     28 
     29 Usage
     30 =====
     31 
     32 Running
     33 -------
     34 
     35 Once all the dependencies are installed, you should just be able to
     36 run moondial.py, possibly passing it as an argument to the Python
     37 executable. You probably need to be in the same directory as the
     38 "cities" and "continent.json" files for things to work right. This is
     39 a bug I'll eventually get around to fixing. It's not that it's hard to
     40 fix; I'm just practing ESR's "release early, release often"
     41 mantra. Well, at least the "release early" part.
     42 
     43 
     44 Adding cities
     45 -------------
     46 
     47 Edit the "cities" file. The format is whitespace separated with
     48 coordinates given in decimal degrees. Latitude is first with positive
     49 numbers being north, then the longitude with positive values being
     50 east, then the city name in quotes, then "timezone=" followed by the
     51 timezone in
     52 [Olson format](http://www.ibm.com/developerworks/aix/library/au-aix-posix/)
     53 (POSIX will probably work too). I don't recall exactly where this
     54 somewhat silly file format comes from; it was probably xplanet. I'll
     55 probably switch to YAML in the future.
     56 
     57 To do
     58 =====
     59 
     60 * Better format for cities
     61 * Less naive algorithm for drawing arcs
     62 * Scale circles & glyphs based on window size
     63