pingswept / pysolar

Pysolar is a collection of Python libraries for simulating the irradiation of any point on earth by the sun. It includes code for extremely precise ephemeris calculations.
http://pysolar.org
GNU General Public License v3.0
373 stars 125 forks source link

Values are slightly off #64

Closed jvhaarst closed 6 years ago

jvhaarst commented 6 years ago

I'm trying to create a solar path graph, and what I see is that instead of a nice smooth transition I get kinks. So instead of ravsunimage10

(from https://permaculturenews.org/wp-content/uploads/2015/10/ravsunImage10.jpg)

I get download

Code is here : https://gist.github.com/jvhaarst/6ee7c6c5972afcddfa1904777fe7d5a8

Are the path that I calculate the truth, and thus the other ones an perfection, or is pysolar slightly off when calculating the positions ?

pingswept commented 6 years ago

It looks to me like the kinks are just in the hour contour lines, not in the trajectories of the sun, which look smooth. I'd guess that's because you have only 7 data points for each hour, and matplotlib is connecting them with straight lines. (I think-- am I right about the 7 data points? Or how are you interpolating between months?)

As far as general accuracy, some efforts at validation are here: http://docs.pysolar.org/en/latest/#validation A rough summary would be that "The azimuth estimations correlated much more closely than the altitude estimations, but both agreed with [those of the US Naval Observatory] to within less than 0.1 degrees on average." We don't really know which party is closer to the truth.

jvhaarst commented 6 years ago

It is a lot simpler than that, the kinks are true, as the analemma is plotted not smooth because I only have a couple of datapoints.

If I correct that (zoomed in to noon), I get this : clipboard01

So the library performs as expected, the solar path graphs that are used elsewhere are simplified. The accuracy doesn't come into play here, as all data is "wrong" in the same way.

jvhaarst commented 6 years ago

For me this is fixed, so I'm closing this now.