-
Notifications
You must be signed in to change notification settings - Fork 19
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
Reassignment throws error in calculate_cos_solar_zenith_angle_integrated #27
Comments
@jarataraj many thanks for pointing out this issue. |
@tlmquintino Will do! Is it ok for me to change all instances of |
@jarataraj sorry for the late reply, I've been traveling. |
this is now fixed as part of the code moved to another python module (earthkit-meteo) and the rest of the fixed was added directly to develop branch. |
The Bug
While attempting to use calculate_cos_solar_zenith_angle_integrated via xr.apply_ufunc as in:
I get the following error:
ValueError: non-broadcastable output operand with shape (571,1) doesn't match the broadcast shape (571,1440)
The Solution
An answer to a related stack overflow question suggests eliminating the
+=
operator, as in changinga += b
toa = a + b
. Sure enough, when I change line 316 in thermofeel.py fromintegral += w[n] * calculate_cos_solar_zenith_angle(
tointegral = integral + w[n] * calculate_cos_solar_zenith_angle(
, everything works as expected. The stack overflow answer includes an explanation as to why.The text was updated successfully, but these errors were encountered: