NREL / flasc

A rich floris-driven suite for SCADA analysis
https://nrel.github.io/flasc/
BSD 3-Clause "New" or "Revised" License
32 stars 18 forks source link

Feature: add interactive Bokeh plots in ws_pow_filtering #92

Closed Bartdoekemeijer closed 1 year ago

Bartdoekemeijer commented 1 year ago

This PR is ready to be merged.

Feature or improvement description This adds interactive browser-based Bokeh plot functionality to the windspeed-power curve filtering class. These figures can easily be saved as .htmls while maintaining their interactive functionality. You can zoom in/out, hide/show data with the legend, resize the plots, etc. This facilitates easy data exploring and additional in-depth analysis post-processing.

Related issue, if one exists N/A

Impacted areas of the software ws_pow_filtering

Additional supporting information N/A

Test results, if applicable I will share an example soon.

Bartdoekemeijer commented 1 year ago

I have updated examples_artificial_data/filter_ws_pow_curves.ipynb script to have the option to produce interactive figures with Bokeh, see the Jupyter Notebook on the branch. I'm attaching two interactive figures in .html file format. GitHub won't allow me to upload the .html files directly, hence attaching them as .zip file: figures.zip. After unzipping, you can open them with your browser.

Couple nice features with this Bokeh functionality:

  1. Figure is actively resized to your browser window size.
  2. You can show/hide data points by clicking on them in the legend.
  3. You can hover over data points to get information from them, e.g., the time and dataframe index to which the darapoint corresponds.
  4. You can save these figures interactively, you for to investigate and modify them later. This is particularly helpful for inspecting data outside of the Jupyter notebook.

image

image

image

image

image

I'm not setting it as the default, but it's easy to enable for the interested user.

Last thing to do:

Bartdoekemeijer commented 1 year ago

OK pushed up docstring changes. Ready for review and then merge!

Bartdoekemeijer commented 1 year ago

Great, thank you @paulf81! I updated the ipympl and bokeh dependencies. Merging now.