Skip to content

Strange solar azimuth/altitudes near and below equator #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
warpling opened this issue Jun 23, 2015 · 3 comments
Closed

Strange solar azimuth/altitudes near and below equator #49

warpling opened this issue Jun 23, 2015 · 3 comments

Comments

@warpling
Copy link

I've been building an application for graphing the sun position throughout the day by taking az/alt samples at intervals before and after solar noon. This has worked brilliantly for most places on the globe, but doesn't behave correctly near and below the equator.

By my rough checks the times solarcalc provides at these lat/longs for solar noon/rise/set seem correct, but the altitudes and azimuths definitely aren't. In a lot of cases the graph ends up looking upside-down, or asymptotic.

Before I dive in myself I wanted to check if the experts here had an inkling of what might be going on!


Quito, Equador (0.233, 78.517)

Expected

screen shot 2015-06-23 at 10 34 17 am

Actual

quito equador

Sydney, Australia (–33.868, 151.206)

Expected

screen shot 2015-06-23 at 10 32 13 am

Actual

sydney australia

McMurdo Station, Antartica (–77.850, 166.667)

Expected

screen shot 2015-06-23 at 10 34 28 am

Actual

mcmurdo antartica

@warpling
Copy link
Author

If it helps troubleshoot, SunCalc reports that the sunPosition of noon in Sydney, Australia (-33.867487, 151.206990) today has an azimuth of 6.2829 when it's expected that the azimuth of solar noon always be near 3.1415.

@warpling warpling reopened this Jun 24, 2015
@warpling
Copy link
Author

Okay my graphs may be off due to sorting points by azimuth before plotting, but the strange azimuth at solar noon is still a concern. In the southern hemisphere it seems to be fixed by removing the fix mentioned in #6. I don't fully understand the math, but I believe π should only be added when evaluating solar positions in the northern hemisphere. @mourner does this sound possible?

@warpling
Copy link
Author

Sorry for the moment of panic. I didn't know to expect the sunPositions returned for the southern hemisphere to use a different scale than the northern hemisphere.

The solar plots I was comparing my results to use a [π, 0, π] x axis scale in the southern hemisphere and the [0, π, 2π] in the northern (for example, this means solar noon usually has an azimuth of π in the northern hemisphere, but 0 in the southern hemisphere). With that knowledge I was able to adjust my plotting accordingly and get the correct looking graphs. :)

I hope this can help someone else out in the future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant