-
Notifications
You must be signed in to change notification settings - Fork 126
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
Argument to asin() above 1 in get_azimuth_fast? #52
Comments
I suspect you're on the right track here. Any thoughts on when or why asin is getting called with values above 1? I'm hesitant to just wipe out values above 1 without understanding why they're appearing in the first place. |
Brandon,
I too am not sure just why the adjustment should be required….
So this morning in a little spare time - I sat down to try and replicate this issue. I have had issues in the past when dealing with GPS data, having to “adjust” E/W and N/S functions. So I suspect that this is the issue …. BUT I have not seen that.
New virtual python environment; And I tried to replicate the work I was doing the other day.
Generate 10 minute “sun plots” for a position…. This time, I added a structure to have multiple locations.
After generating these values - then some pyplot to check the sense of the Altitude and Az values.
I could not create any issues at all … I was however using the code
alt = sol.get_altitude(loc[0], loc[1], aware_datetime)
az = sol.get_azimuth(loc[0], loc[1], aware_datetime)
If I change this to
alt = sol.get_altitude_fast(loc[0], loc[1], aware_datetime)
az = sol.get_azimuth_fast(loc[0], loc[1], aware_datetime)
Then data loss and exceptions are thrown. So 100% the issue is in the “fast” algorithm section.
Please find attached, an iPython notebook. Which I hope you can find useful - Python 3.5.
Regards
Tim
… On Jul 10, 2017, at 8:36 PM, Brandon Stafford ***@***.***> wrote:
I suspect you're on the right track here. Any thoughts on when or why asin is getting called with values above 1? I'm hesitant to just wipe out values above 1 without understanding why they're appearing in the first place.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#52 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AKtOMwnXwtxD8RQq0p95nm0emNGSe5ktks5sMlL5gaJpZM4ORtUm>.
|
If anyone can replicate this, I'd be interested in the details. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As previously reported this method returns an error:
This fails using
The reason for there failure is the asin function is being given a value of (1.1); Which is out of bounds... This can be resolved by using %1.
The solution is to change the line in Solar.py
From:
To:
azimuth_rad = math.asin( (math.cos(declination_rad) * math.sin(hour_angle_rad) / math.cos(altitude_rad))%1)
I have not checked to see if this may occur in the get_azimuth method.
The text was updated successfully, but these errors were encountered: