Announcement

Collapse
No announcement yet.

[include] Moonrise and Moonset calculations

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [include] Moonrise and Moonset calculations

    Summary

    This script provides functions that will let your scripts calculate the times of moonrise and moonset, the current moon phase, and whether the moon is up, down, rising, or setting. You can specify a date, time, latitude, and longitude, or you can have it use the current date and time, and HomeSeer's lat/long.

    The core algorithm and much of the code in this file are derived from Eric Jilot's VB program, which he kindly shared with me. All the astronomy and science in here is his. All I've done is adapt this to HomeSeer, develop the function interface, remove bits related to sunrise et. al., and simplify the whole thing.

    While credit goes to Eric for the astronomy and the lion's share of the work, all support questions concerning this script should be sent to me. This is posted by kind permission of Eric and he retains rights to his own code. Feel free to use this for your own purposes, but if you want to include it in something separately distributed, check first for permission. Okay, I'm probably being over-cautious in this paragraph, but I want to be sure.

    Installation/Usage

    No other includes are required to use this. Simply put this in your include directory and then include it in other functions. Full instructions are in the top of the file; read carefully to see how to get back all four return values.

    The MoonRiseSetHere() function relies on the hs.GetINISetting() function and thus requires builds of HomeSeer v1.5 later than... oh, I don't remember, somewhere in the 40s I think. But if you avoid that function you can probably get away with any v1.5 or later HomeSeer (perhaps even earlier).

    You might want to grab some moon and sun icons. I've done a set of 16x16s for this, including moons in all phases, sunrise, sunset, sun up, and sun down. See them at Paul's HomeSeer Icons. (It's very hard to come up with distinct sunrise and sunset icons, so I made one be over land and the other over sea. This makes sense if you're living on the coast; I'm not right now, but I did most of my life, so it works for me. But those of you on a West Coast might want to reverse the icon names!)

    Version History
    v1.0 2002-07-14: First public release.

    Nucleus Home Automation
    Attached Files
    News, support, and updates for Rover, Network Monitor, TimeIcons, and more
Working...
X