After several months of testing/tweaking, the get-USNO-sunmoon.php script has been revised to V3.00.

The major changes are:1) switch to using curl to access api.usno.navy.mil API (better timeout control) and2) addition of built-in calculations to supply sun/moon rise/set and moon %illumination and phase (thanks to Jachym and others for sharing the code!)

You can add a new setting to Settings.php where you can optionally switch the script from using the USNO to using the internal calculations.

$SITE['useUSNO'] = false; // =false: use the internal calculations and no access to the USNO api.usno.navy.mil server

Note that the internal calculations are within a couple of minutes of the more-accurate USNO data, and likewise the % illumination is within a couple percent. For best accuracy, continue to use the USNO. If the USNO server has issues, then switch to using the internal calculations to free your website page load from externally caused delays with the USNO server.

Saratoga template: use the update tool (Base-*, Plugin-*, 11-Oct-2017) (note that get-metar-conditions-inc.php V1.16 is included in the update, and for USA templates, advforecast2.php V5.04 (JSON) is included)

worked better for me.Sun Times where out by one or 2 mins if I used USNO rather than Internal (however I did compare against "www.timeanddate.com" which I am not sure is 100% accurate), but the bonus is it results in yet another non reliance on external data capture which is great.

I also decided to utilise the array in the "Common.php" to make the "Lunar Cycles" more timely, as they where always displaying past times.

That's it, well I would like to make the "Solar Cycle" (Season) section dynamic as well, however that will sit on the drawing board for a while till I figure out a way to turn it into an array , which would then I suppose remove the requirement for the "get_localdate" and "get_utcdate" for it, or at worst have to adjust them.

I also modified the Class Moon() in Brians "LiveData.php" file as per your mods :

And that works perfect, removing the need to use the Homeweather Templates (Moon/Fine Tuning) requirement in "easyweathersetup.php".

That coupled with the recent mod I made to remove the need to adjust the Homeweather Templates "UTC" Offset every time we swing from "ST" to "DST" now means the Homeweather Template can run in auto without having to change either of the above mentioned settings. (ref: images below). The first Moon/Fine Adjustment image (displays a "1") as it's an old image, in my case that is now "0" and will remain that way.

Again, Thanks Ken (Legend).

PS. Forgot to add:In the "Common.php" : To change the "GMT" to "UTC" : (For Solar Cycle/Season)FROM: (Around Line "715")

Ah ! : Forgot some additional changes (for the Moon Array) : in order to Display "First Quarter Moon" or "Last Quarter Moon" vs just "First Quarter" or "Last Quarter" above each Moon image, you will need further changes to "Common.php" and "get-USNO-sunmoon.php".

So rather than waffle on more here, I have attached both files, just do the usual (backup/copy/diffmerge/whatever) before using, oh and ensure you have applied the earlier - above mentioned changes first.

Note: also, unless I'm wrong (possible), I reverse my "Summer" / "Winter" Solstice images for "Southern Hemisphere" display. I made this change ages ago Ken as the Switch did not seem to work and never bothered to investigate why, in the end I created new images to be more relevant to Aus/Southern Hemisphere. They are rough and ready, but do me.

almanacnew2.PNG

earth-fall.jpg

earth-winter.jpg

earth-spring.jpg

earth-summer.jpg

And as I no longer have a public website : image attached is of the entire page.

Huon River Vista Weather AlamanaAAAA.png

You do not have the required permissions to view the files attached to this post.

Last edited by HRVistaWeather on Sun Oct 22, 2017 1:36 am, edited 7 times in total.

saratogaWX wrote:After several months of testing/tweaking, the get-USNO-sunmoon.php script has been revised to V3.00.

The major changes are:1) switch to using curl to access api.usno.navy.mil API (better timeout control) and2) addition of built-in calculations to supply sun/moon rise/set and moon %illumination and phase (thanks to Jachym and others for sharing the code!)

You can add a new setting to Settings.php where you can optionally switch the script from using the USNO to using the internal calculations.

$SITE['useUSNO'] = false; // =false: use the internal calculations and no access to the USNO api.usno.navy.mil server

Note that the internal calculations are within a couple of minutes of the more-accurate USNO data, and likewise the % illumination is within a couple percent. For best accuracy, continue to use the USNO. If the USNO server has issues, then switch to using the internal calculations to free your website page load from externally caused delays with the USNO server.

Saratoga template: use the update tool (Base-*, Plugin-*, 11-Oct-2017) (note that get-metar-conditions-inc.php V1.16 is included in the update, and for USA templates, advforecast2.php V5.04 (JSON) is included)

Best regards,Ken

Ken

I downloaded you new get-USNO-sunmoon.php but my moon rise and set dates are showing (01/Jan/1970)