Skip to content

bw.Shear.Timeseries - Timeseries calculates Shear twice and generates plot based on Average method #341

Open

Description

@Ilirmc

Timeseries calculates shear as timeseries on lines 86/93. Then on line 103 shear is calculated as average in order to display the average shear plot. This increases the computation time, and displays the same plot that would be obtained with the Shear.Average approach. Perhaps the plot could be made optional?

Activity

  1. removed theissue type on Mar 11, 2025
  2. moved this from To do to No status in brightwind kanbanon Mar 12, 2025
  3. added
    function improvementAdd improvements to an existing function or feature
    and removed
    bugSomething isn't working
    on Mar 12, 2025
  4. added this to the v2.8.0 milestone on Sep 10, 2026
  5. olivia-bentley commented on Sep 28, 2026

    @olivia-bentley
    Contributor

    @BiancaMorandi @stephenholleran are we OK to change this plotting behaviour would anyone be reliant on this as it would be a breaking change. Additionally is the average shear plot the right one to be returning anyway given this is within the time series shear code? Should we completely remove the plot as it could be confusing? I have made it optional in PR #635 but think it should be removed. As it calls the Shear.Average plot from instead the Shear.TimeSeries function which is not representative of what is applied.

                    roughness_coefficient = pd.Series(Shear._calc_roughness(slope=slope, intercept=intercept),
                                                      name='roughness_coefficient')
                    self._roughness = roughness_coefficient
    
                clear_output()
                avg_plot = Shear.Average(wspds=wspds, heights=heights, calc_method=calc_method,
                                         max_plot_height=max_plot_height)
    
                self.origin = 'TimeSeries'
                self.calc_method = calc_method
                self.wspds = wspds
                self.plot = avg_plot.plot
    

    current behaviour

    Image
  6. stephenholleran commented on Sep 29, 2026

    @stephenholleran
    Collaborator

    Hi,

    We can't make any breaking changes. We can make it optional but the default should make it behave the way that it is currently working.

    What plot could be returned for informing the user about timeseries shear?

  7. olivia-bentley commented on Sep 29, 2026

    @olivia-bentley
    Contributor

    @stephenholleran I think a plot at one particular time step would be informative and representative than the average which isn't what this function applies. The user can supply which time step they want to see the profile for

  8. stephenholleran commented on Sep 29, 2026

    @stephenholleran
    Collaborator

    @olivia-bentley there could be hundred thousand timestamps. How would the user know what timestamp to pick? Scrolling through on a plot is a good thing to do but how would it perform with 100,000 timesteps? Any other plot we could come up with?

  9. BiancaMorandi commented on Sep 29, 2026

    @BiancaMorandi
    Contributor

    @olivia-bentley and @stephenholleran can we not plot all timestamps using a density colour plot or color defined based on same stats (e.g. by hour or month or direction or others)? see below few example options of colouring for e.g. wind speed by hour that could be used for the shear by speed

    Image
  10. olivia-bentley commented on Sep 29, 2026

    @olivia-bentley
    Contributor

    @BiancaMorandi @stephenholleran Yes I think this could work Bianca, was about to propose:

    • Distribution of α (histogram): shows the spread, how often shear is negative, and the outliers.
    • Profile envelope: the fitted profiles for the P10, P50 and P90 α values, drawn through the measured means. It's still a profile plot like the current one, but it shows the range of what's actually applied.

    I still think a widget to view the timestep by timestep profiles is useful particularly too investigate interesting features like inverse shear LLJ etc.

  11. olivia-bentley commented on Sep 29, 2026

    @olivia-bentley
    Contributor

    @BiancaMorandi i don't think we should plot by hour of day or month etc. though as we have separate shear functions for those

  12. stephenholleran commented on Sep 29, 2026

    @stephenholleran
    Collaborator

    These seem like a good path to go down. Not sure which one would work with a shear plot and all the different curves that could be produced.

    Changing what is plotted I don't think is a breaking change, it could be considered just evolving. It doesn't actually break.

  13. olivia-bentley commented on Sep 29, 2026

    @olivia-bentley
    Contributor

    some examples possible from the test dataset

    Image
  14. olivia-bentley commented on Sep 29, 2026

    @olivia-bentley
    Contributor

    A further point for the record, although we're planning to remove this plot anyway: the plot created by Shear.TimeSeries calls Shear.Average without passing the user's min_speed, so it always uses the default 3 m/s even when a different min_speed is given. If the plot is kept in any form, it should use the user's min_speed.

  15. olivia-bentley commented on Oct 2, 2026

    @olivia-bentley
    Contributor

    @BiancaMorandi @stephenholleran
    Updated plot:

    Image

    and without normalising it:

    Image

    this for the test data. I'll share some for other datasets later

  16. BiancaMorandi commented on Oct 15, 2026

    @BiancaMorandi
    Contributor

    how plot look like if instead of wind speed you use density color?

  17. olivia-bentley commented on Oct 19, 2026

    @olivia-bentley
    Contributor

    23. how plot look like if instead of wind speed you use density color?

    Image what do we think of this version?

    Actually that one loses the shape of the profiles, I think the below is better:

    Image Neither of these really help you understand why it's a p50 profile though as it isn't density related to alpha value
  18. stephenholleran commented on Oct 19, 2026

    @stephenholleran
    Collaborator

    @olivia-bentley the second plot definitely looks better than the first one.

    Are there 5,000 lines in this plot out of a possible 79,514?

    I am confused about comparing the P50 shear profile with where the majority of the shear profiles are. The dense area of profiles is between 5 and 7.5 m/s however the P50 shear profile is way over to the left. I would have expected the P50 profile to be in the middle of the dense area.

    What is the alpha of that P50 profile? And what is the alpha when you just use the average shear function?

    Seen as we are leaning towards not normalising the shear profiles, how would the below plots you did previously look without the normalising?

    Image
  19. olivia-bentley commented on Oct 20, 2026

    @olivia-bentley
    Contributor

    @stephenholleran that is probably because colouring by density of the lines is misleading for P50. Density of the lines effectively tells you how distribution changes with wind speed but what it is P50 of is actually shear exponent. A plot where we colour by shear exponent is here:

    Image

    It also looks deceptive as a shear alpha of 0.5 looks different at surface wind speeds of 2m/s than at 10m/s on a plot like this.

    Average shear method gives alpha = 0.123

  20. stephenholleran commented on Oct 21, 2026

    @stephenholleran
    Collaborator

    OK, I'm getting really confused about these plots but before I delve deeper it might be worth redoing those other plots I mentioned in my last comment without normalisation. Thanks.

  21. BiancaMorandi commented on Oct 22, 2026

    @BiancaMorandi
    Contributor

    As discussed on #641 (comment), as part of this issue can you also address issue that plot doesn't follow maximise_data. TimeSeries builds its plot via Shear.Average(wspds=...) (shear.py:107) without passing maximise_data. The profile plot therefore uses only timestamps with every height valid, while alpha/roughness use the larger dataset.

  22. olivia-bentley commented on Oct 29, 2026

    @olivia-bentley
    Contributor

    27. OK, I'm getting really confused about these plots but before I delve deeper it might be worth redoing those other plots I mentioned in my last comment without normalisation. Thanks.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

function improvementAdd improvements to an existing function or feature

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions