|
52 | 52 | "metadata": {}, |
53 | 53 | "source": [ |
54 | 54 | "## Load the dataset\n", |
55 | | - "The original dataset is a fixed-width-file (fwf), whih can be conveniently parsed using the pandas `read_fwf` function:" |
| 55 | + "The original dataset is a fixed-width-file (fwf), which can be conveniently parsed using the pandas `read_fwf` function:" |
56 | 56 | ] |
57 | 57 | }, |
58 | 58 | { |
59 | 59 | "cell_type": "code", |
60 | | - "execution_count": 13, |
| 60 | + "execution_count": 3, |
61 | 61 | "metadata": {}, |
62 | 62 | "outputs": [ |
63 | 63 | { |
|
160 | 160 | "4 76 1 1 1 15 0.88 0.00 -2.78" |
161 | 161 | ] |
162 | 162 | }, |
163 | | - "execution_count": 13, |
| 163 | + "execution_count": 3, |
164 | 164 | "metadata": {}, |
165 | 165 | "output_type": "execute_result" |
166 | 166 | } |
167 | 167 | ], |
168 | 168 | "source": [ |
169 | 169 | "data_url = 'https://www.nrel.gov/grid/solar-resource/assets/data/f06.txt'\n", |
170 | 170 | "\n", |
171 | | - "# Read file as a fixed-with-file (fwf)\n", |
| 171 | + "# Read file\n", |
172 | 172 | "df_barstow = pd.read_fwf(data_url, skiprows=[0,2])\n", |
173 | 173 | "\n", |
174 | 174 | "# Only keep data from 1976\n", |
|
183 | 183 | "source": [ |
184 | 184 | "<br>\n", |
185 | 185 | "\n", |
186 | | - "Next, we set the index to datetime:" |
| 186 | + "Then, we set the index to datetime:" |
187 | 187 | ] |
188 | 188 | }, |
189 | 189 | { |
190 | 190 | "cell_type": "code", |
191 | | - "execution_count": 14, |
| 191 | + "execution_count": 4, |
192 | 192 | "metadata": { |
193 | 193 | "tags": [ |
194 | 194 | "hide-input" |
|
265 | 265 | "1976-01-01 01:15:00-08:00 0.88 0.00 -2.78" |
266 | 266 | ] |
267 | 267 | }, |
268 | | - "execution_count": 14, |
| 268 | + "execution_count": 4, |
269 | 269 | "metadata": {}, |
270 | 270 | "output_type": "execute_result" |
271 | 271 | } |
272 | 272 | ], |
273 | 273 | "source": [ |
274 | | - "# This step requires defining a custom function (*convert_to_datetime*) for converting\n", |
275 | | - "# the timestamps to datetime, as the time timestamps do not following the ISO convention\n", |
| 274 | + "# This step requires defining a custom function (convert_to_datetime) for converting\n", |
| 275 | + "# the timestamps to datetime, as the time timestamps do not follow the ISO convention\n", |
276 | 276 | "# for denoting midnight as 00:00, but rather represents midnight as 24:00.\n", |
277 | 277 | "def convert_to_datetime(time):\n", |
278 | 278 | " \"\"\"Convert string with instances of midnight as\n", |
|
305 | 305 | "source": [ |
306 | 306 | "<br>\n", |
307 | 307 | "\n", |
308 | | - "Next, the columns are renamed in order to conform to the standard pvlib names:" |
| 308 | + "Next, the columns are renamed in order to conform to the [standard pvlib names](https://pvlib-python.readthedocs.io/en/stable/variables_style_rules.html):" |
309 | 309 | ] |
310 | 310 | }, |
311 | 311 | { |
312 | 312 | "cell_type": "code", |
313 | | - "execution_count": 17, |
| 313 | + "execution_count": 5, |
314 | 314 | "metadata": {}, |
315 | 315 | "outputs": [ |
316 | 316 | { |
|
383 | 383 | "1976-01-01 01:15:00-08:00 0.88 0.00 -2.78" |
384 | 384 | ] |
385 | 385 | }, |
386 | | - "execution_count": 17, |
| 386 | + "execution_count": 5, |
387 | 387 | "metadata": {}, |
388 | 388 | "output_type": "execute_result" |
389 | 389 | } |
|
410 | 410 | }, |
411 | 411 | { |
412 | 412 | "cell_type": "code", |
413 | | - "execution_count": 18, |
| 413 | + "execution_count": 6, |
414 | 414 | "metadata": {}, |
415 | 415 | "outputs": [ |
416 | 416 | { |
|
539 | 539 | "1976-01-01 01:15:00-08:00 -3.212865 1413.981805 " |
540 | 540 | ] |
541 | 541 | }, |
542 | | - "execution_count": 18, |
| 542 | + "execution_count": 6, |
543 | 543 | "metadata": {}, |
544 | 544 | "output_type": "execute_result" |
545 | 545 | } |
|
559 | 559 | "source": [ |
560 | 560 | "## Removal of erroneous data\n", |
561 | 561 | "\n", |
562 | | - "The removal of erroneous data has been done by manually inspecting each day.\n", |
| 562 | + "The identification of erroneous data has been done by manually inspecting each day.\n", |
563 | 563 | "\n", |
564 | 564 | "The identified erroneous values are set to nan:" |
565 | 565 | ] |
566 | 566 | }, |
567 | 567 | { |
568 | 568 | "cell_type": "code", |
569 | | - "execution_count": 19, |
| 569 | + "execution_count": 7, |
570 | 570 | "metadata": {}, |
571 | 571 | "outputs": [], |
572 | 572 | "source": [ |
|
632 | 632 | }, |
633 | 633 | { |
634 | 634 | "cell_type": "code", |
635 | | - "execution_count": 25, |
| 635 | + "execution_count": 8, |
636 | 636 | "metadata": {}, |
637 | 637 | "outputs": [], |
638 | 638 | "source": [ |
639 | | - "df['dni_inplane'] = (df['dni'] * np.cos(np.deg2rad(df['apparent_zenith']))).clip(lower=0)\n", |
640 | | - "df['dhi'] = (df['ghi'] - df['dni_inplane']).clip(lower=0)\n", |
| 639 | + "# Calculate beam/direct horizontal irradiance (BHI)\n", |
| 640 | + "df['bhi'] = (df['dni'] * np.cos(np.deg2rad(df['apparent_zenith']))).clip(lower=0)\n", |
| 641 | + "# Calculate diffuse horizontal irradiance (DHI)\n", |
| 642 | + "df['dhi'] = (df['ghi'] - df['bhi']).clip(lower=0)\n", |
641 | 643 | "\n", |
642 | 644 | "# Calculate normalized irradiance values\n", |
643 | 645 | "df['Kn'] = df['dni'] / df['dni_extra']\n", |
|
661 | 663 | }, |
662 | 664 | { |
663 | 665 | "cell_type": "code", |
664 | | - "execution_count": 26, |
| 666 | + "execution_count": 9, |
665 | 667 | "metadata": { |
666 | 668 | "tags": [ |
667 | 669 | "hide-input" |
|
722 | 724 | "\n", |
723 | 725 | "In order to detect possible shading from nearby objects and hills, it is useful to visualize the maximum irradiance as a function of solar elevation and zenith angle. Particularly the DNI plot is helpful in identifiying the local obstruction free horizon line.\n", |
724 | 726 | "\n", |
725 | | - "Due to the 15-minute resolution a 2-degree angle resolution is used." |
| 727 | + "Due to the 15-minute resolution a 2-degree resolution is used." |
726 | 728 | ] |
727 | 729 | }, |
728 | 730 | { |
729 | 731 | "cell_type": "code", |
730 | | - "execution_count": 27, |
| 732 | + "execution_count": 10, |
731 | 733 | "metadata": { |
732 | 734 | "tags": [ |
733 | 735 | "hide-input" |
|
740 | 742 | "Text(0.5, 1.0, 'Maximum irradiance as a function of solar elevation and azimuth')" |
741 | 743 | ] |
742 | 744 | }, |
743 | | - "execution_count": 27, |
| 745 | + "execution_count": 10, |
744 | 746 | "metadata": {}, |
745 | 747 | "output_type": "execute_result" |
746 | 748 | }, |
|
791 | 793 | "cell_type": "markdown", |
792 | 794 | "metadata": {}, |
793 | 795 | "source": [ |
794 | | - "### Quality-check plots" |
| 796 | + "### Quality-check plots\n", |
| 797 | + "The below plots visualize the normalize irradiance values. The blue lines represents the [quality-control limits recommend by the BSRN](https://epic.awi.de/id/eprint/30083/1/BSRN_recommended_QC_tests_V2.pdf)." |
795 | 798 | ] |
796 | 799 | }, |
797 | 800 | { |
798 | 801 | "cell_type": "code", |
799 | | - "execution_count": 28, |
| 802 | + "execution_count": 11, |
800 | 803 | "metadata": { |
801 | 804 | "tags": [ |
802 | 805 | "hide-input" |
|
845 | 848 | }, |
846 | 849 | { |
847 | 850 | "cell_type": "code", |
848 | | - "execution_count": 30, |
| 851 | + "execution_count": 12, |
849 | 852 | "metadata": {}, |
850 | 853 | "outputs": [ |
851 | 854 | { |
|
856 | 859 | "dtype: object" |
857 | 860 | ] |
858 | 861 | }, |
859 | | - "execution_count": 30, |
| 862 | + "execution_count": 12, |
860 | 863 | "metadata": {}, |
861 | 864 | "output_type": "execute_result" |
862 | 865 | } |
|
869 | 872 | "cell_type": "markdown", |
870 | 873 | "metadata": {}, |
871 | 874 | "source": [ |
872 | | - "Clearly, the DNI measurements are errornous to a much higher degree than the GHI measurements. This can partly be due to the fact that it is much easier to detect a faulty DNI measurements, and also that the DNI sensor is much more prone to soiling and is affected by tracker errors and misalignment." |
| 875 | + "Clearly, the DNI measurements are errornous to a much higher degree than the GHI measurements. This is partly due to the fact that it is much easier to detect a faulty DNI measurement, but also that DNI sensors are much more prone to soiling and affected by tracker errors and misalignment." |
873 | 876 | ] |
874 | 877 | }, |
875 | 878 | { |
|
0 commit comments