Testing the accuracy of solar calculator

This is only one case of comparing the calculated solar position results
a) Using NOAA method in a Haskell program I recently made
b) Using the Python ephem to define exactly the noon time, i.e when Sun is passing the meridian of the given observation location. It is the time azimuth angle is 180 degr as calculated by ephem for the given longitude.
c) Comparing the Solar altitudes
Using the previous examples can also the max altitudes of day be determined and compared. The max solar altitude happens to be just at noon.

  1. Ephem results
MacBook-Pro mypythons % python3
Python 3.9.6 (default, Feb  3 2024, 15:58:27) 
[Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ephem
>>> gatech = ephem.Observer()
>>> gatech.lat = '65.85'
>>> gatech.lon = '24.18'
>>> gatech.date = '2024/9/8 10:20:48.41'
>>> s = ephem.Sun(gatech)
>>> print('Altitude %s  Azimuth %s' % (s.alt, s.az))
Altitude 29:35:48.1  Azimuth 180:00:00.1
>>> 29 + 35/60 + 48.1/3600
29.59669444444444
>>> 

The noon time today was calculated to be at 10:20:49
The calculated solar altitude 29°35´48´´= 29.5967°

  1. Haskell program results

The calculator program hyper-helios was manually launched at the precalculated time.


It can be seen that the calculation results correspond very near eachother.

3 Likes

Very good.

You might want to use something like prettyprinter-ansi-terminal (or even ansi-terminal by itself) for displaying output. It is easier and clearer than to deal with ANSI escape codes.

1 Like

Thanks for good idea, yesterday also Brandon Chinn has suggested ansi-terminal in connection to the same program in my earlier writing. Well, maybe I’ll give a try for ansi-printer package.

if you just need colours, I can also recommend the very simple and easy to use colourista

2 Likes