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

[Iss 441] Shear by Time of Day bug in _apply() #442

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rach185
Copy link
Contributor

@rach185 rach185 commented Jun 28, 2024

The bw.Shear._apply() function uses integer months to index the shear coefficients. The shear coefficients matrix is labelled with calendar months and begins on the first full month of coverage in the input timeseries, i.e. does not always have the first column as January. This means that the shear coefficients applied to a particular month are not necessarily consistent.

Currently the bw.Shear._apply() function is updated to reference the coefficient matrix using calendar month names. Alternatively the coefficient matrix could be re-ordered to always begin in January - although may not be applicable for timeseries shorter than 1 year.

Sensitivity checks on this fix are within the range of a 0.00%-0.13% impact on wind speeds shear up 60m, with the average impact being 0.04% change in sheared wind speed. However, these sensitivity checks were not extensive.

@rach185 rach185 added the bug Something isn't working label Jun 28, 2024
@rach185 rach185 self-assigned this Jun 28, 2024
@rach185 rach185 changed the title [Iss 441] Shear by Time of Day but in _apply() [Iss 441] Shear by Time of Day bug in _apply() Jul 2, 2024
@rach185 rach185 requested a review from stephenholleran July 2, 2024 09:45
@stephenholleran
Copy link
Collaborator

Hi @rach185,

I think we should get to the source of the problem which seems to be
image

we should order this resulting list so the first item is 1 (if there is a full year of data).

Then, we could use the same method for pulling the unique list of months instead of just 0 to 12 counting.
image

This should hopefully fix the issue?

@rach185
Copy link
Contributor Author

rach185 commented Jul 8, 2024

I have updated the apply function so that it iterates through the sorted list of unique months, I've enumerated through this list to keep the j variable and preserve how df_wspds is called.

This update also allows users to calculate the shear by month when less than 1 year of data is available.

@rach185
Copy link
Contributor Author

rach185 commented Sep 20, 2024

Reported bug when the coverage is too low in a month to calculate shear: column created for shear values but they cannot be filled -> conclusion, shear by TOD can only be used when all calendar months have good enough coverage. Error handling will be included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Awaiting Approval
Development

Successfully merging this pull request may close these issues.

2 participants