|
1 | 1 | { |
2 | 2 | "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "id": "intermediate-triangle", |
| 6 | + "metadata": {}, |
| 7 | + "source": [ |
| 8 | + "# Albatross Usage Information\n", |
| 9 | + "\n", |
| 10 | + "_Before using this notebook, make sure to follow the [installation](https://github.com/camirmas/albatross#installation) instructions._\n", |
| 11 | + "\n", |
| 12 | + "**Full installation and module documentation can be found at https://albatross-wind.readthedocs.io/en/latest/index.html**" |
| 13 | + ] |
| 14 | + }, |
3 | 15 | { |
4 | 16 | "cell_type": "code", |
5 | 17 | "execution_count": 1, |
|
12 | 24 | "from albatross import WindTurbine, RequestParams" |
13 | 25 | ] |
14 | 26 | }, |
| 27 | + { |
| 28 | + "cell_type": "markdown", |
| 29 | + "id": "involved-hopkins", |
| 30 | + "metadata": {}, |
| 31 | + "source": [ |
| 32 | + "## The `requests` module\n", |
| 33 | + "\n", |
| 34 | + "This module is responsible for retrieving WIND Toolkit data.\n", |
| 35 | + "\n", |
| 36 | + "Full documentation can be found at https://albatross-wind.readthedocs.io/en/latest/requests.html" |
| 37 | + ] |
| 38 | + }, |
| 39 | + { |
| 40 | + "cell_type": "markdown", |
| 41 | + "id": "foreign-ethiopia", |
| 42 | + "metadata": {}, |
| 43 | + "source": [ |
| 44 | + "`get_regions` returns the full set of available regions with their configuration options. Its optional argument determines whether to pretty print the results alongside returning them." |
| 45 | + ] |
| 46 | + }, |
15 | 47 | { |
16 | 48 | "cell_type": "code", |
17 | 49 | "execution_count": 2, |
|
297 | 329 | "get_regions(True)" |
298 | 330 | ] |
299 | 331 | }, |
| 332 | + { |
| 333 | + "cell_type": "markdown", |
| 334 | + "id": "broke-salon", |
| 335 | + "metadata": {}, |
| 336 | + "source": [ |
| 337 | + "`identify_regions` returns the region associated with a given lat/lon point. By default, it does not make any network requests. However, the kwarg `coordinates=True` will make a network request to include all lat/lon data points associated with the region that includes the specified lat/lon point. Note that multiple regions might be returned: that is because some of the WIND Toolkit's bounding boxes overlap in some places." |
| 338 | + ] |
| 339 | + }, |
300 | 340 | { |
301 | 341 | "cell_type": "code", |
302 | 342 | "execution_count": 3, |
|
369 | 409 | "identify_regions(lat_lon, coordinates=True)" |
370 | 410 | ] |
371 | 411 | }, |
| 412 | + { |
| 413 | + "cell_type": "markdown", |
| 414 | + "id": "anonymous-arrangement", |
| 415 | + "metadata": {}, |
| 416 | + "source": [ |
| 417 | + "In order to make a request, let's first define our parameters using a `RequestParams` instance. We can see the valid fields using the class method `get_fields`. Note that the first four fields (`wind_speed`, `wind_direction`, `pressure`, and `temperature`) must be registered with a `height` parameter. " |
| 418 | + ] |
| 419 | + }, |
372 | 420 | { |
373 | 421 | "cell_type": "code", |
374 | 422 | "execution_count": 6, |
|
399 | 447 | "RequestParams.get_fields()" |
400 | 448 | ] |
401 | 449 | }, |
| 450 | + { |
| 451 | + "cell_type": "markdown", |
| 452 | + "id": "variable-camcorder", |
| 453 | + "metadata": {}, |
| 454 | + "source": [ |
| 455 | + "Here's an example point data request. Note that the region 'nw_pacific' is explicitly specified here. This is only necessary the given lat/lon point falls in multiple regions. Normally, the function will infer the region, so if you aren't sure, leave the `region` kwarg out and the function will raise an error with instructions if it encounters multiple regions." |
| 456 | + ] |
| 457 | + }, |
402 | 458 | { |
403 | 459 | "cell_type": "code", |
404 | 460 | "execution_count": 7, |
|
415 | 471 | "(data, meta) = request_wtk_point_data(lat_lon, year, rp.params, region='nw_pacific', resolution=\"5min\")" |
416 | 472 | ] |
417 | 473 | }, |
| 474 | + { |
| 475 | + "cell_type": "markdown", |
| 476 | + "id": "streaming-style", |
| 477 | + "metadata": {}, |
| 478 | + "source": [ |
| 479 | + "The result of this request is a `pandas.DataFrame` with all specified arguments included." |
| 480 | + ] |
| 481 | + }, |
418 | 482 | { |
419 | 483 | "cell_type": "code", |
420 | 484 | "execution_count": 8, |
|
552 | 616 | "data" |
553 | 617 | ] |
554 | 618 | }, |
| 619 | + { |
| 620 | + "cell_type": "markdown", |
| 621 | + "id": "subject-tournament", |
| 622 | + "metadata": {}, |
| 623 | + "source": [ |
| 624 | + "## The `analysis` module \n", |
| 625 | + "\n", |
| 626 | + "This module is responsible for generating insights from wind data. **This module does not require WIND Toolkit data specifically;** however, if you intend to use your own data, you'll need to specify which fields you want, or meet the field inference requirements as specified in the documentation for each function. In general, unless explicitly overridden, wind speed and direction fields will be **inferred** by looking for data columns that contain the strings `'windspeed'` and `'winddirection'`, respectively.\n", |
| 627 | + "\n", |
| 628 | + "Full module documentation can be found at https://albatross-wind.readthedocs.io/en/latest/analysis.html" |
| 629 | + ] |
| 630 | + }, |
| 631 | + { |
| 632 | + "cell_type": "markdown", |
| 633 | + "id": "attempted-recall", |
| 634 | + "metadata": {}, |
| 635 | + "source": [ |
| 636 | + "`boxplot` generates boxplots of wind speeds. It returns normal `matplotlib` objects for further modification." |
| 637 | + ] |
| 638 | + }, |
555 | 639 | { |
556 | 640 | "cell_type": "code", |
557 | 641 | "execution_count": 9, |
|
577 | 661 | "fig.set_figwidth(8)" |
578 | 662 | ] |
579 | 663 | }, |
| 664 | + { |
| 665 | + "cell_type": "markdown", |
| 666 | + "id": "cordless-iceland", |
| 667 | + "metadata": {}, |
| 668 | + "source": [ |
| 669 | + "`plot_windrose` generates a windrose plot from the given data. It uses the [windrose](https://github.com/python-windrose/windrose) Python package." |
| 670 | + ] |
| 671 | + }, |
580 | 672 | { |
581 | 673 | "cell_type": "code", |
582 | 674 | "execution_count": 10, |
|
598 | 690 | "ax = plot_windrose(data)" |
599 | 691 | ] |
600 | 692 | }, |
| 693 | + { |
| 694 | + "cell_type": "markdown", |
| 695 | + "id": "interracial-gospel", |
| 696 | + "metadata": {}, |
| 697 | + "source": [ |
| 698 | + "`pdf` generates a Weibull probability density plot from the given data. It returns `matplotlib` objects as well as parameters representing shape (2), location, and scale for the Weibull distribution." |
| 699 | + ] |
| 700 | + }, |
601 | 701 | { |
602 | 702 | "cell_type": "code", |
603 | 703 | "execution_count": 11, |
|
642 | 742 | "params" |
643 | 743 | ] |
644 | 744 | }, |
| 745 | + { |
| 746 | + "cell_type": "markdown", |
| 747 | + "id": "charged-given", |
| 748 | + "metadata": {}, |
| 749 | + "source": [ |
| 750 | + "`get_diurnal_stats` returns basic relevant diurnal wind speed statistics for the given data." |
| 751 | + ] |
| 752 | + }, |
645 | 753 | { |
646 | 754 | "cell_type": "code", |
647 | 755 | "execution_count": 13, |
|
972 | 1080 | "get_diurnal_stats(data)" |
973 | 1081 | ] |
974 | 1082 | }, |
| 1083 | + { |
| 1084 | + "cell_type": "markdown", |
| 1085 | + "id": "aggregate-security", |
| 1086 | + "metadata": {}, |
| 1087 | + "source": [ |
| 1088 | + "`plot_diurnal_stats` plots basic relevant diurnal wind speed statistics for the given data." |
| 1089 | + ] |
| 1090 | + }, |
975 | 1091 | { |
976 | 1092 | "cell_type": "code", |
977 | 1093 | "execution_count": 14, |
|
995 | 1111 | "(fig, ax, df) = plot_diurnal_stats(data)" |
996 | 1112 | ] |
997 | 1113 | }, |
| 1114 | + { |
| 1115 | + "cell_type": "markdown", |
| 1116 | + "id": "spoken-clinic", |
| 1117 | + "metadata": {}, |
| 1118 | + "source": [ |
| 1119 | + "`turbulence_std` Calculates the turbulence standard deviation. It requires a `WindTurbine` instance, which provides information about the turbulence intensity based on standard wind turbine specifications according to IEC-61400, Section 6.2." |
| 1120 | + ] |
| 1121 | + }, |
998 | 1122 | { |
999 | 1123 | "cell_type": "code", |
1000 | 1124 | "execution_count": 15, |
|
0 commit comments