Skip to content
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

Incorrect refraction elevation cutoff in ephemeris solar position algorithm #2323

Open
AdamRJensen opened this issue Dec 4, 2024 · 3 comments

Comments

@AdamRJensen
Copy link
Member

The refraction correction used in the ephemeris solar position algorithm has a cutoff at -1 degree, which is not mentioned in the original publication or the provided Fortran code:

Refract[(Elevation > -1) & (Elevation <= -0.575)] = -20.774 / TanEl

To be consistent with the publication I suggest that we remove the lower limit and apply refraction correction to all negative solar elevation angles.

image

@AdamRJensen
Copy link
Member Author

ICYMI @IoannisSifnaios @kandersolar

@cwhanse
Copy link
Member

cwhanse commented Dec 4, 2024

The reference publication is here: https://pvpmc.sandia.gov/app/uploads/sites/243/2022/10/Engineering-Astronomy.pdf

It doesn't mention correction below -0.575 degrees, that I can find.

My guess is that the -1 degree limit was added to the Matlab code because we didn't think refraction correction was meaningful when the sun's disc was below the horizon.

I have no objection to removing the limit, or adding a comment pointing back to the Matlab code. I also have no objection to removing the ephemeris function as long as there is an equally fast solar position algorithm in the library.

@kandersolar
Copy link
Member

+1 to removing ephemeris eventually, and leaving it as-is in the meantime. But good to document the issue regardless.

A bit of context: @AdamRJensen, @IoannisSifnaios, and I have a project underway comparing solar position algorithms. We plan to contribute implementations of one or more algorithms to pvlib-python, depending on the results of the comparison. We expect some of them to be better than ephemeris in all respects (speed, accuracy, period of validity, clear reference).

@kandersolar kandersolar removed this from the v0.11.2 milestone Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants