Forecast Tutorial

This tutorial will walk through forecast data from Unidata forecast model data using the forecast.py module within pvlib.

Table of contents:

  1. Setup
  2. Intialize and Test Each Forecast Model

This tutorial has been tested against the following package versions:

  • Python 3.5.2
  • IPython 5.0.0
  • pandas 0.18.0
  • matplotlib 1.5.1
  • netcdf4 1.2.1
  • siphon 0.4.0

It should work with other Python and Pandas versions. It requires pvlib >= 0.3.0 and IPython >= 3.0.

Authors:

  • Derek Groenendyk (@moonraker), University of Arizona, November 2015
  • Will Holmgren (@wholmgren), University of Arizona, November 2015, January 2016, April 2016, July 2016

Setup

In [1]:
%matplotlib inline
import matplotlib.pyplot as plt

# built in python modules
import datetime
import os

# python add-ons
import numpy as np
import pandas as pd

# for accessing UNIDATA THREDD servers
from siphon.catalog import TDSCatalog
from siphon.ncss import NCSS

import pvlib
from pvlib.forecast import GFS, HRRR_ESRL, NAM, NDFD, HRRR, RAP
c:\users\kanderso\software\anaconda3\envs\pvlib-dev\lib\site-packages\pvlib\forecast.py:19: UserWarning: The forecast module algorithms and features are highly experimental. The API may change, the functionality may be consolidated into an io module, or the module may be separated into its own package.
  'The forecast module algorithms and features are highly experimental. '
In [2]:
# Choose a location and time.
# Tucson, AZ
latitude = 32.2
longitude = -110.9 
tz = 'America/Phoenix'

start = pd.Timestamp(datetime.date.today(), tz=tz) # today's date
end = start + pd.Timedelta(days=7) # 7 days from today
print(start, end)
2020-07-07 00:00:00-07:00 2020-07-14 00:00:00-07:00

GFS (0.5 deg)

In [3]:
from pvlib.forecast import GFS, HRRR_ESRL, NAM, NDFD, HRRR, RAP 
In [4]:
# GFS model, defaults to 0.5 degree resolution
fm = GFS()
In [5]:
# retrieve data
data = fm.get_data(latitude, longitude, start, end)
In [6]:
data[sorted(data.columns)]
Out[6]:
Downward_Short-Wave_Radiation_Flux_surface_Mixed_intervals_Average Temperature_surface Total_cloud_cover_boundary_layer_cloud_Mixed_intervals_Average Total_cloud_cover_convective_cloud Total_cloud_cover_entire_atmosphere_Mixed_intervals_Average Total_cloud_cover_high_cloud_Mixed_intervals_Average Total_cloud_cover_low_cloud_Mixed_intervals_Average Total_cloud_cover_middle_cloud_Mixed_intervals_Average Wind_speed_gust_surface u-component_of_wind_isobaric v-component_of_wind_isobaric
2020-07-07 09:00:00-07:00 0.0 300.237488 0.0 0.0 57.0 0.0 0.0 57.0 1.955965 1.875361 -0.662417
2020-07-07 12:00:00-07:00 0.0 298.100006 0.0 0.0 59.0 0.0 0.0 59.0 3.808908 3.145774 2.099924
2020-07-07 15:00:00-07:00 180.0 310.383728 0.0 0.0 0.0 0.0 0.0 0.0 3.342430 1.852296 2.729048
2020-07-07 18:00:00-07:00 467.0 327.000000 0.0 0.0 0.0 0.0 0.0 0.0 3.484897 0.939204 -3.090686
2020-07-07 21:00:00-07:00 1010.0 330.007477 0.0 0.0 0.0 0.0 0.0 0.0 3.503251 1.645287 -3.527871
2020-07-08 00:00:00-07:00 878.0 319.885193 0.0 0.0 0.0 0.0 0.0 0.0 4.145447 0.859436 -4.305269
2020-07-08 03:00:00-07:00 175.0 305.436615 0.0 0.0 0.0 0.0 0.0 0.0 3.496038 -2.588877 -2.352002
2020-07-08 06:00:00-07:00 88.0 303.200012 0.0 0.0 0.0 0.0 0.0 0.0 5.642923 4.412341 -0.192209
2020-07-08 09:00:00-07:00 0.0 301.231689 0.0 0.0 0.0 0.0 0.0 0.0 11.133477 2.878274 7.444138
2020-07-08 12:00:00-07:00 0.0 298.600006 0.0 0.0 0.0 0.0 0.0 0.0 3.954767 1.669788 2.695730
2020-07-08 15:00:00-07:00 170.0 310.934265 0.0 0.0 0.0 0.0 0.0 0.0 2.846232 0.675632 2.159890
2020-07-08 18:00:00-07:00 457.0 327.200012 0.0 0.0 0.0 0.0 0.0 0.0 2.526505 1.020662 -2.779041
2020-07-08 21:00:00-07:00 990.0 332.571381 0.0 0.0 0.0 0.0 0.0 0.0 3.021044 0.729756 -2.064746
2020-07-09 00:00:00-07:00 805.0 314.414703 0.0 0.0 18.0 0.0 0.0 18.0 4.330414 3.606665 -4.088640
2020-07-09 03:00:00-07:00 41.0 308.700012 0.0 0.0 100.0 0.0 0.0 100.0 2.586901 2.561328 -0.240759
2020-07-09 06:00:00-07:00 21.0 306.399963 0.0 0.0 100.0 0.0 0.0 100.0 7.266234 4.327090 3.482671
2020-07-09 09:00:00-07:00 0.0 301.799988 0.0 0.0 16.0 0.0 0.0 16.0 6.027924 2.559023 3.946294
2020-07-09 12:00:00-07:00 0.0 300.312103 0.0 0.0 20.0 12.0 0.0 8.0 7.331892 2.869182 4.760039
2020-07-09 15:00:00-07:00 150.0 309.799988 0.0 0.0 100.0 100.0 0.0 0.0 3.562258 1.973667 3.297007
2020-07-09 18:00:00-07:00 428.0 327.500000 0.0 0.0 88.0 88.0 0.0 0.0 1.750235 0.281367 -2.057359
2020-07-09 21:00:00-07:00 950.0 331.358795 0.0 0.0 100.0 100.0 0.0 0.0 1.806583 0.356209 -2.617424
2020-07-10 00:00:00-07:00 818.0 319.844086 0.0 0.0 100.0 100.0 0.0 0.0 2.919531 1.026206 -4.103455
2020-07-10 03:00:00-07:00 139.0 307.399994 0.0 0.0 100.0 100.0 0.0 0.0 5.142653 3.009106 -2.178784
2020-07-10 06:00:00-07:00 69.0 304.126465 0.0 0.0 84.0 84.0 0.0 0.0 5.642010 2.768996 3.140728
2020-07-10 09:00:00-07:00 0.0 301.573212 0.0 0.0 100.0 100.0 0.0 0.0 3.079594 2.008838 2.264627
2020-07-10 12:00:00-07:00 0.0 300.241547 0.0 0.0 100.0 100.0 0.0 0.0 2.636170 2.148355 1.317654
2020-07-10 15:00:00-07:00 160.0 311.341553 0.0 0.0 95.0 95.0 0.0 0.0 2.512109 1.947288 1.006641
2020-07-10 18:00:00-07:00 437.0 326.595123 0.0 0.0 68.0 68.0 0.0 0.0 4.216958 1.732542 -4.185076
2020-07-10 21:00:00-07:00 990.0 330.899994 0.0 0.0 14.0 14.0 0.0 0.0 4.335027 2.310635 -4.163330
2020-07-11 00:00:00-07:00 859.0 322.000000 0.0 0.0 7.0 7.0 0.0 0.0 3.447549 3.446514 -3.067827
2020-07-11 03:00:00-07:00 169.0 307.475525 0.0 35.0 0.0 0.0 0.0 0.0 8.386095 3.354326 -4.990854
2020-07-11 06:00:00-07:00 84.0 305.467468 0.0 0.0 14.0 1.0 0.0 14.0 7.229870 5.174636 -0.331689
2020-07-11 09:00:00-07:00 0.0 302.167480 0.0 0.0 29.0 0.0 0.0 29.0 2.677630 2.493284 -0.217234
2020-07-11 12:00:00-07:00 0.0 300.002533 0.0 0.0 27.0 12.0 0.0 14.0 4.625916 2.010862 3.442834
2020-07-11 15:00:00-07:00 170.0 312.741547 0.0 0.0 0.0 0.0 0.0 0.0 2.073312 1.571885 1.050894
2020-07-11 18:00:00-07:00 451.0 328.068329 0.0 0.0 0.0 0.0 0.0 0.0 3.150879 1.393000 -3.531040
2020-07-11 21:00:00-07:00 990.0 333.799988 0.0 0.0 0.0 0.0 0.0 0.0 2.701148 0.883069 -2.655833
2020-07-12 00:00:00-07:00 853.0 322.815033 0.0 0.0 1.0 0.0 0.0 1.0 5.145863 1.808108 -4.700403
2020-07-12 03:00:00-07:00 165.0 308.796600 0.0 0.0 0.0 0.0 0.0 0.0 11.954372 2.256226 -8.296606
2020-07-12 06:00:00-07:00 82.0 304.471375 0.0 0.0 19.0 0.0 0.0 19.0 3.129498 2.008174 1.969055
2020-07-12 09:00:00-07:00 0.0 301.814972 0.0 0.0 0.0 0.0 0.0 0.0 3.023448 1.731963 2.384458
2020-07-12 12:00:00-07:00 0.0 299.899963 0.0 0.0 0.0 0.0 0.0 0.0 3.412988 1.867207 2.861882
2020-07-12 15:00:00-07:00 170.0 313.207458 0.0 0.0 0.0 0.0 0.0 0.0 1.042386 0.875273 0.769448
2020-07-12 18:00:00-07:00 452.0 328.807465 0.0 0.0 0.0 0.0 0.0 0.0 2.766832 1.178728 -3.081250
2020-07-12 21:00:00-07:00 990.0 334.907471 0.0 0.0 0.0 0.0 0.0 0.0 2.665824 0.076318 -1.928381
2020-07-13 00:00:00-07:00 863.0 323.407471 0.0 0.0 0.0 0.0 0.0 0.0 4.139158 1.368088 -4.395081
2020-07-13 03:00:00-07:00 170.0 309.119324 0.0 0.0 0.0 0.0 0.0 0.0 8.994596 2.589487 -6.237558
2020-07-13 06:00:00-07:00 85.0 305.363434 0.0 0.0 0.0 0.0 0.0 0.0 9.281939 5.982869 -0.788149
2020-07-13 09:00:00-07:00 0.0 302.078064 0.0 0.0 0.0 0.0 0.0 0.0 3.311322 1.182983 3.093572
2020-07-13 12:00:00-07:00 0.0 300.072693 0.0 0.0 0.0 0.0 0.0 0.0 2.408803 0.783616 2.256890
2020-07-13 15:00:00-07:00 170.0 313.468323 0.0 0.0 0.0 0.0 0.0 0.0 1.830473 1.144658 1.580906
2020-07-13 18:00:00-07:00 452.0 330.289215 0.0 0.0 0.0 0.0 0.0 0.0 3.639479 2.268677 -2.415698
2020-07-13 21:00:00-07:00 990.0 333.497101 0.0 0.0 0.0 0.0 0.0 0.0 2.909790 2.478157 -3.644780
2020-07-14 00:00:00-07:00 843.0 322.899994 0.0 0.0 3.0 0.0 0.0 3.0 3.420156 2.113437 -3.438135
In [7]:
data = fm.process_data(data)
In [8]:
data[['ghi', 'dni', 'dhi']].plot();
In [9]:
cs = fm.location.get_clearsky(data.index)
In [10]:
fig, ax = plt.subplots()
cs['ghi'].plot(ax=ax, label='ineichen')
data['ghi'].plot(ax=ax, label='gfs+larson')
ax.set_ylabel('ghi')
ax.legend();
In [11]:
fig, ax = plt.subplots()
cs['dni'].plot(ax=ax, label='ineichen')
data['dni'].plot(ax=ax, label='gfs+larson')
ax.set_ylabel('ghi')
ax.legend();
In [12]:
# retrieve data
data = fm.get_processed_data(latitude, longitude, start, end)
In [13]:
data[sorted(data.columns)]
Out[13]:
dhi dni ghi high_clouds low_clouds mid_clouds temp_air total_clouds wind_speed
2020-07-07 09:00:00-07:00 313.248107 143.860292 411.558827 0.0 0.0 57.0 27.087494 57.0 1.988913
2020-07-07 12:00:00-07:00 491.012347 121.402886 609.925582 0.0 0.0 59.0 24.950012 59.0 3.782271
2020-07-07 15:00:00-07:00 168.912693 780.228478 809.627894 0.0 0.0 0.0 37.233734 0.0 3.298288
2020-07-07 18:00:00-07:00 70.760082 530.377043 230.422477 0.0 0.0 0.0 53.850006 0.0 3.230239
2020-07-07 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 56.857483 0.0 3.892665
2020-07-08 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 46.735199 0.0 4.390213
2020-07-08 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 32.286621 0.0 3.497742
2020-07-08 06:00:00-07:00 34.862378 67.546325 41.944462 0.0 0.0 0.0 30.050018 0.0 4.416526
2020-07-08 09:00:00-07:00 122.512815 776.323959 652.254371 0.0 0.0 0.0 28.081696 0.0 7.981206
2020-07-08 12:00:00-07:00 249.427638 754.817268 988.451127 0.0 0.0 0.0 25.450012 0.0 3.170986
2020-07-08 15:00:00-07:00 169.516668 778.921066 809.020321 0.0 0.0 0.0 37.784271 0.0 2.263096
2020-07-08 18:00:00-07:00 71.052011 527.549866 229.634467 0.0 0.0 0.0 54.050018 0.0 2.960543
2020-07-08 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 59.421387 0.0 2.189913
2020-07-09 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 18.0 41.264709 18.0 5.452065
2020-07-09 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 100.0 35.550018 100.0 2.572619
2020-07-09 06:00:00-07:00 14.205950 0.000000 14.205950 0.0 0.0 100.0 33.249969 100.0 5.554521
2020-07-09 09:00:00-07:00 208.128821 550.239650 583.033593 0.0 0.0 16.0 28.649994 16.0 4.703385
2020-07-09 12:00:00-07:00 418.455435 450.334646 859.170057 12.0 0.0 8.0 27.162109 20.0 5.557893
2020-07-09 15:00:00-07:00 269.912608 15.859244 282.929731 100.0 0.0 0.0 36.649994 100.0 3.842605
2020-07-09 18:00:00-07:00 97.913975 0.000000 97.913975 88.0 0.0 0.0 54.350006 88.0 2.076509
2020-07-09 21:00:00-07:00 0.000000 0.000000 0.000000 100.0 0.0 0.0 58.208801 100.0 2.641551
2020-07-10 00:00:00-07:00 0.000000 0.000000 0.000000 100.0 0.0 0.0 46.694092 100.0 4.229827
2020-07-10 03:00:00-07:00 0.000000 0.000000 0.000000 100.0 0.0 0.0 34.250000 100.0 3.715080
2020-07-10 06:00:00-07:00 17.807345 0.000000 17.807345 84.0 0.0 0.0 30.976471 84.0 4.187065
2020-07-10 09:00:00-07:00 219.115542 11.884918 227.200922 100.0 0.0 0.0 28.423218 100.0 3.027204
2020-07-10 12:00:00-07:00 327.138972 18.589746 345.323059 100.0 0.0 0.0 27.091553 100.0 2.520246
2020-07-10 15:00:00-07:00 292.043694 20.588178 308.936802 95.0 0.0 0.0 38.191559 95.0 2.192089
2020-07-10 18:00:00-07:00 111.536148 52.063971 127.129906 68.0 0.0 0.0 53.445129 68.0 4.529521
2020-07-10 21:00:00-07:00 0.000000 0.000000 0.000000 14.0 0.0 0.0 57.750000 14.0 4.761549
2020-07-11 00:00:00-07:00 0.000000 0.000000 0.000000 7.0 0.0 0.0 48.850006 7.0 4.614111
2020-07-11 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 34.325531 0.0 6.013330
2020-07-11 06:00:00-07:00 32.410255 19.991689 34.406614 1.0 0.0 14.0 32.317474 14.0 5.185256
2020-07-11 09:00:00-07:00 272.996723 371.745286 525.503042 0.0 0.0 29.0 29.017487 29.0 2.502729
2020-07-11 12:00:00-07:00 423.734172 397.854986 812.715566 12.0 0.0 14.0 26.852539 27.0 3.987063
2020-07-11 15:00:00-07:00 171.241365 775.042702 806.941040 0.0 0.0 0.0 39.591553 0.0 1.890820
2020-07-11 18:00:00-07:00 71.871804 518.458888 226.815142 0.0 0.0 0.0 54.918335 0.0 3.795879
2020-07-11 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 60.649994 0.0 2.798796
2020-07-12 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 1.0 49.665039 1.0 5.036173
2020-07-12 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 35.646606 0.0 8.597919
2020-07-12 06:00:00-07:00 31.407641 5.727079 31.969610 0.0 0.0 19.0 31.321381 19.0 2.812462
2020-07-12 09:00:00-07:00 123.597280 770.287279 645.980963 0.0 0.0 0.0 28.664978 0.0 2.947089
2020-07-12 12:00:00-07:00 251.700892 750.169989 984.760886 0.0 0.0 0.0 26.749969 0.0 3.417138
2020-07-12 15:00:00-07:00 171.785521 773.764466 806.158942 0.0 0.0 0.0 40.057465 0.0 1.165399
2020-07-12 18:00:00-07:00 72.125097 515.217614 225.721669 0.0 0.0 0.0 55.657471 0.0 3.299015
2020-07-12 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 61.757477 0.0 1.929891
2020-07-13 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 50.257477 0.0 4.603086
2020-07-13 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 35.969330 0.0 6.753708
2020-07-13 06:00:00-07:00 31.631191 35.946186 35.094839 0.0 0.0 0.0 32.213440 0.0 6.034558
2020-07-13 09:00:00-07:00 123.863613 768.774072 644.378896 0.0 0.0 0.0 28.928070 0.0 3.312044
2020-07-13 12:00:00-07:00 252.244188 749.032885 983.797746 0.0 0.0 0.0 26.922699 0.0 2.389059
2020-07-13 15:00:00-07:00 172.313466 772.493439 805.330549 0.0 0.0 0.0 40.318329 0.0 1.951795
2020-07-13 18:00:00-07:00 72.367731 511.866632 224.550427 0.0 0.0 0.0 57.139221 0.0 3.313984
2020-07-13 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 60.347107 0.0 4.407458
2020-07-14 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 3.0 49.750000 3.0 4.035764
In [14]:
data['temp_air'].plot()
plt.ylabel('temperature (%s)' % fm.units['temp_air']);
In [15]:
cloud_vars = ['total_clouds', 'low_clouds', 'mid_clouds', 'high_clouds']
In [16]:
for varname in cloud_vars:
    data[varname].plot()
plt.ylabel('Cloud cover' + ' %')
plt.xlabel('Forecast Time ('+str(data.index.tz)+')')
plt.title('GFS 0.5 deg')
plt.legend(bbox_to_anchor=(1.18,1.0));
In [17]:
total_cloud_cover = data['total_clouds']
In [18]:
total_cloud_cover.plot(color='r', linewidth=2)
plt.ylabel('Total cloud cover' + ' (%s)' % fm.units['total_clouds'])
plt.xlabel('Forecast Time ('+str(data.index.tz)+')')
plt.title('GFS 0.5 deg');

GFS (0.25 deg)

In [19]:
# GFS model at 0.25 degree resolution
fm = GFS(resolution='quarter')
In [20]:
# retrieve data
data = fm.get_processed_data(latitude, longitude, start, end)
In [21]:
for varname in cloud_vars:
    data[varname].plot(ls='-', linewidth=2)
plt.ylabel('Cloud cover' + ' %')
plt.xlabel('Forecast Time ('+str(data.index.tz)+')')
plt.title('GFS 0.25 deg')
plt.legend(bbox_to_anchor=(1.18,1.0));
In [22]:
data[sorted(data.columns)]
Out[22]:
dhi dni ghi high_clouds low_clouds mid_clouds temp_air total_clouds wind_speed
2020-07-07 09:00:00-07:00 310.839136 116.292585 390.310736 0.0 0.0 62.0 34.575043 62.0 1.787665
2020-07-07 12:00:00-07:00 453.770869 60.944245 513.465309 0.0 0.0 74.0 32.850006 74.0 2.423746
2020-07-07 15:00:00-07:00 168.912693 780.228478 809.627894 0.0 0.0 0.0 37.496277 0.0 1.410278
2020-07-07 18:00:00-07:00 70.760082 530.377043 230.422477 0.0 0.0 0.0 48.050018 0.0 3.543175
2020-07-07 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 52.350006 0.0 4.786015
2020-07-08 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 48.335205 0.0 4.732661
2020-07-08 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 40.649994 0.0 3.480565
2020-07-08 06:00:00-07:00 34.862378 67.546325 41.944462 0.0 0.0 0.0 36.850006 0.0 6.538927
2020-07-08 09:00:00-07:00 122.512815 776.323959 652.254371 0.0 0.0 0.0 34.904907 0.0 3.320535
2020-07-08 12:00:00-07:00 249.427638 754.817268 988.451127 0.0 0.0 0.0 33.149994 0.0 2.014901
2020-07-08 15:00:00-07:00 169.516668 778.921066 809.020321 0.0 0.0 0.0 37.715729 0.0 1.841223
2020-07-08 18:00:00-07:00 71.052011 527.549866 229.634467 0.0 0.0 0.0 49.478119 0.0 1.394670
2020-07-08 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 53.950012 0.0 2.560847
2020-07-09 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 1.0 49.264709 1.0 4.971548
2020-07-09 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 15.0 41.250000 15.0 6.925235
2020-07-09 06:00:00-07:00 30.035439 0.000000 30.035439 0.0 0.0 40.0 37.449982 40.0 5.893103
2020-07-09 09:00:00-07:00 152.422162 700.283619 629.559115 0.0 0.0 5.0 35.449982 5.0 1.654496
2020-07-09 12:00:00-07:00 274.885878 715.103728 974.713600 0.0 0.0 2.0 33.962128 2.0 1.597388
2020-07-09 15:00:00-07:00 392.378832 212.342735 566.667822 46.0 0.0 0.0 37.850006 46.0 2.283257
2020-07-09 18:00:00-07:00 101.900183 293.936168 190.108667 26.0 0.0 0.0 49.549988 26.0 1.539361
2020-07-09 21:00:00-07:00 0.000000 0.000000 0.000000 100.0 0.0 0.0 52.950928 100.0 3.225189
2020-07-10 00:00:00-07:00 0.000000 0.000000 0.000000 100.0 0.0 0.0 48.694092 100.0 4.062025
2020-07-10 03:00:00-07:00 0.000000 0.000000 0.000000 100.0 0.0 0.0 41.006195 100.0 5.409892
2020-07-10 06:00:00-07:00 17.807345 0.000000 17.807345 84.0 0.0 0.0 36.524536 84.0 5.699416
2020-07-10 09:00:00-07:00 219.115542 11.884918 227.200922 100.0 0.0 0.0 34.624542 100.0 2.970064
2020-07-10 12:00:00-07:00 344.284808 20.730030 364.562474 97.0 0.0 0.0 33.399719 97.0 2.596959
2020-07-10 15:00:00-07:00 269.697844 15.830635 282.687270 100.0 0.0 0.0 37.291565 100.0 3.636530
2020-07-10 18:00:00-07:00 111.536148 52.063971 127.129906 68.0 0.0 0.0 47.241425 68.0 4.687857
2020-07-10 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 52.149994 0.0 6.150292
2020-07-11 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 48.950012 0.0 7.242578
2020-07-11 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 41.487885 0.0 6.984845
2020-07-11 06:00:00-07:00 32.656176 29.847886 35.636770 0.0 0.0 9.0 38.250000 9.0 5.764334
2020-07-11 09:00:00-07:00 216.995867 522.356675 571.804297 0.0 0.0 18.0 35.450012 18.0 3.260127
2020-07-11 12:00:00-07:00 363.057813 577.874146 928.043294 0.0 0.0 9.0 33.919739 9.0 1.497668
2020-07-11 15:00:00-07:00 171.241365 775.042702 806.941040 0.0 0.0 0.0 38.414734 0.0 2.341921
2020-07-11 18:00:00-07:00 71.871804 518.458888 226.815142 0.0 0.0 0.0 48.118317 0.0 3.527511
2020-07-11 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 53.649994 0.0 3.191378
2020-07-12 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 50.165039 0.0 4.961523
2020-07-12 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 41.649994 0.0 8.273394
2020-07-12 06:00:00-07:00 31.589893 11.118122 32.680857 0.0 0.0 16.0 37.721405 16.0 3.271754
2020-07-12 09:00:00-07:00 123.597280 770.287279 645.980963 0.0 0.0 0.0 35.364960 0.0 3.389639
2020-07-12 12:00:00-07:00 251.700892 750.169989 984.760886 0.0 0.0 0.0 33.970856 0.0 1.788770
2020-07-12 15:00:00-07:00 171.785521 773.764466 806.158942 0.0 0.0 0.0 38.557465 0.0 2.124879
2020-07-12 18:00:00-07:00 72.125097 515.217614 225.721669 0.0 0.0 0.0 48.608276 0.0 3.080019
2020-07-12 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 54.357483 0.0 2.384970
2020-07-13 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 50.649994 0.0 4.839526
2020-07-13 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 42.550018 0.0 6.735958
2020-07-13 06:00:00-07:00 31.631191 35.946186 35.094839 0.0 0.0 0.0 38.394165 0.0 7.721436
2020-07-13 09:00:00-07:00 123.863613 768.774072 644.378896 0.0 0.0 0.0 36.050018 0.0 3.335639
2020-07-13 12:00:00-07:00 252.244188 749.032885 983.797746 0.0 0.0 0.0 34.558502 0.0 1.268467
2020-07-13 15:00:00-07:00 172.313466 772.493439 805.330549 0.0 0.0 0.0 39.418304 0.0 1.308521
2020-07-13 18:00:00-07:00 72.367731 511.866632 224.550427 0.0 0.0 0.0 49.850006 0.0 2.825097
2020-07-13 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 54.561859 0.0 4.730281
2020-07-14 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 51.050018 0.0 3.827553

NAM

In [23]:
fm = NAM()
In [24]:
# retrieve data
data = fm.get_processed_data(latitude, longitude, start, end)
In [25]:
for varname in cloud_vars:
    data[varname].plot(ls='-', linewidth=2)
plt.ylabel('Cloud cover' + ' %')
plt.xlabel('Forecast Time ('+str(data.index.tz)+')')
plt.title('NAM')
plt.legend(bbox_to_anchor=(1.18,1.0));
In [26]:
data['ghi'].plot(linewidth=2, ls='-')
plt.ylabel('GHI W/m**2')
plt.xlabel('Forecast Time ('+str(data.index.tz)+')');
In [27]:
data[sorted(data.columns)]
Out[27]:
dhi dni ghi high_clouds low_clouds mid_clouds temp_air total_clouds wind_speed
2020-07-07 07:00:00-07:00 77.796838 503.843144 234.225562 0.0 0.0 4.0 25.275696 4.0 4.236579
2020-07-07 08:00:00-07:00 104.009679 665.030760 441.350258 0.0 0.0 5.0 24.096741 5.0 2.084390
2020-07-07 09:00:00-07:00 190.737687 602.967499 602.791408 0.0 0.0 12.0 23.259369 12.0 2.430394
2020-07-07 10:00:00-07:00 394.900880 220.640944 577.332947 0.0 0.0 45.0 22.637360 45.0 2.287011
2020-07-07 11:00:00-07:00 371.471781 491.815818 827.792990 0.0 0.0 17.0 21.548645 17.0 2.146314
... ... ... ... ... ... ... ... ... ...
2020-07-10 18:00:00-07:00 71.608260 521.593060 227.831386 0.0 0.0 0.0 47.524323 0.0 4.186076
2020-07-10 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 51.004333 0.0 4.479259
2020-07-11 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 45.404327 0.0 5.495673
2020-07-11 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 33.342041 0.0 6.391275
2020-07-11 06:00:00-07:00 32.984857 48.730501 37.851059 0.0 0.0 0.0 27.653412 0.0 6.174289

64 rows × 9 columns

NDFD

In [28]:
fm = NDFD()
In [29]:
# retrieve data
data = fm.get_processed_data(latitude, longitude, start, end)
In [30]:
total_cloud_cover = data['total_clouds']
temp = data['temp_air']
wind = data['wind_speed']
In [31]:
total_cloud_cover.plot(color='r', linewidth=2)
plt.ylabel('Total cloud cover' + ' (%s)' % fm.units['total_clouds'])
plt.xlabel('Forecast Time ('+str(data.index.tz)+')')
plt.title('NDFD')
plt.ylim(0,100);
In [32]:
temp.plot(color='r', linewidth=2)
plt.ylabel('Temperature' + ' (%s)' % fm.units['temp_air'])
plt.xlabel('Forecast Time ('+str(data.index.tz)+')')    
Out[32]:
Text(0.5, 0, 'Forecast Time (America/Phoenix)')
In [33]:
wind.plot(color='r', linewidth=2)
plt.ylabel('Wind Speed' + ' (%s)' % fm.units['wind_speed'])
plt.xlabel('Forecast Time ('+str(data.index.tz)+')')   
Out[33]:
Text(0.5, 0, 'Forecast Time (America/Phoenix)')
In [34]:
data[sorted(data.columns)]
Out[34]:
dhi dni ghi temp_air total_clouds wind_speed
2020-07-07 07:00:00-07:00 99.890925 347.091344 207.652749 29.950012 21.0 3.6
2020-07-07 08:00:00-07:00 184.088292 372.718701 373.151942 28.850006 28.0 3.6
2020-07-07 09:00:00-07:00 267.819401 396.893774 539.047214 27.750000 27.0 3.6
2020-07-07 10:00:00-07:00 369.615267 328.202640 640.982335 26.649994 33.0 2.6
2020-07-07 11:00:00-07:00 329.899278 582.259130 870.136458 25.550018 10.0 2.6
... ... ... ... ... ... ...
2020-07-10 12:00:00-07:00 435.480046 373.322681 800.656204 26.649994 29.0 2.6
2020-07-10 15:00:00-07:00 328.683112 417.412468 671.180334 32.250000 26.0 3.1
2020-07-10 18:00:00-07:00 99.200042 315.749296 193.770591 38.350006 23.0 4.1
2020-07-10 21:00:00-07:00 0.000000 0.000000 0.000000 42.250000 26.0 5.1
2020-07-11 00:00:00-07:00 0.000000 0.000000 0.000000 41.649994 28.0 6.2

68 rows × 6 columns

RAP

In [35]:
fm = RAP(resolution=20)
In [36]:
# retrieve data
data = fm.get_processed_data(latitude, longitude, start, end)
In [37]:
cloud_vars = ['total_clouds', 'high_clouds', 'mid_clouds', 'low_clouds']
In [38]:
for varname in cloud_vars:
    data[varname].plot(ls='-', linewidth=2)
plt.ylabel('Cloud cover' + ' %')
plt.xlabel('Forecast Time ('+str(data.index.tz)+')')
plt.title('RAP')
plt.legend(bbox_to_anchor=(1.18,1.0));
In [39]:
data[sorted(data.columns)]
Out[39]:
dhi dni ghi high_clouds low_clouds mid_clouds temp_air total_clouds wind_speed
2020-07-07 07:00:00-07:00 71.635540 543.826680 240.477996 0.0 0.0 0.0 28.347504 0.0 2.327517
2020-07-07 08:00:00-07:00 86.596496 728.586324 456.175991 0.0 0.0 0.0 27.904663 0.0 2.175546
2020-07-07 09:00:00-07:00 122.236626 777.829389 653.786825 0.0 0.0 0.0 26.495667 0.0 1.384346
2020-07-07 10:00:00-07:00 171.241827 779.819561 816.018322 0.0 0.0 0.0 25.294281 0.0 1.382019
2020-07-07 11:00:00-07:00 219.288315 766.669947 930.627284 0.0 0.0 0.0 24.858032 0.0 2.235861
2020-07-07 12:00:00-07:00 248.835940 756.003554 989.335867 0.0 0.0 0.0 23.831116 0.0 1.536941
2020-07-07 13:00:00-07:00 248.107815 756.279866 987.969156 0.0 0.0 0.0 23.937256 0.0 1.048759
2020-07-07 14:00:00-07:00 217.396559 767.306217 926.616347 0.0 0.0 0.0 30.558380 0.0 1.808497
2020-07-07 15:00:00-07:00 168.912693 780.228478 809.627894 0.0 0.0 0.0 36.067719 0.0 1.068781
2020-07-07 16:00:00-07:00 120.244061 776.950602 645.449998 0.0 0.0 0.0 40.855499 0.0 2.179613
2020-07-07 17:00:00-07:00 85.436744 724.204396 446.504106 0.0 0.0 0.0 44.690613 0.0 2.377453
2020-07-07 18:00:00-07:00 70.760082 530.377043 230.422477 0.0 0.0 0.0 47.460571 0.0 2.551703
2020-07-07 19:00:00-07:00 31.921094 45.168640 36.294916 0.0 0.0 0.0 49.285980 0.0 3.459794
2020-07-07 20:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 50.784973 0.0 3.655803
2020-07-07 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 51.117493 0.0 3.754607
2020-07-07 22:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 49.905579 0.0 3.628853
2020-07-07 23:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 48.206177 0.0 3.996997
2020-07-08 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 45.676361 0.0 3.979780
2020-07-08 01:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 42.436981 0.0 3.814770
2020-07-08 02:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 38.626068 0.0 3.449723
2020-07-08 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 33.746185 0.0 2.532734
2020-07-08 04:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 31.455780 0.0 2.456241
2020-07-08 05:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 30.601807 0.0 3.205541
2020-07-08 06:00:00-07:00 34.862378 67.546325 41.944462 0.0 0.0 0.0 29.315033 0.0 3.808608
2020-07-08 07:00:00-07:00 71.848463 539.666746 238.634289 0.0 0.0 0.0 27.729797 0.0 2.184620
2020-07-08 08:00:00-07:00 86.868218 726.368812 454.437459 0.0 0.0 0.0 26.687714 0.0 1.322847
2020-07-08 09:00:00-07:00 122.512815 776.323959 652.254371 0.0 0.0 0.0 25.858002 0.0 1.376876
2020-07-08 10:00:00-07:00 171.595131 778.561044 814.716357 0.0 0.0 0.0 25.042908 0.0 1.788842
2020-07-08 11:00:00-07:00 219.759262 765.485272 929.548292 0.0 0.0 0.0 24.445129 0.0 2.093503
2020-07-08 12:00:00-07:00 249.427638 754.817268 988.451127 0.0 0.0 0.0 23.918152 0.0 2.265164
2020-07-08 13:00:00-07:00 248.778592 755.062801 987.234136 0.0 0.0 0.0 24.713837 0.0 2.466437
2020-07-08 14:00:00-07:00 218.072349 766.050184 925.975581 0.0 0.0 0.0 30.513672 0.0 2.081351
2020-07-08 15:00:00-07:00 169.516668 778.921066 809.020321 0.0 0.0 0.0 36.506775 0.0 1.837201
2020-07-08 16:00:00-07:00 120.732892 775.528590 644.815668 0.0 0.0 0.0 42.005127 0.0 1.637601
2020-07-08 17:00:00-07:00 85.833749 722.415257 445.795050 0.0 0.0 0.0 46.309509 0.0 1.727112
2020-07-08 18:00:00-07:00 71.052011 527.549866 229.634467 0.0 0.0 0.0 49.280518 0.0 2.432863
2020-07-08 19:00:00-07:00 31.675297 42.011742 35.717714 0.0 0.0 0.0 51.188080 0.0 3.393902
2020-07-08 20:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 52.083954 0.0 3.550420
2020-07-08 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 51.954742 0.0 3.469018
2020-07-08 22:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.0 49.927155 0.0 4.115798

HRRR

In [40]:
fm = HRRR()
In [41]:
data_raw = fm.get_data(latitude, longitude, start, end)
In [42]:
# The HRRR model pulls in u, v winds for 2 layers above ground (10 m, 80 m)
# They are labeled as _0, _1 in the raw data
data_raw[sorted(data_raw.columns)]
Out[42]:
High_cloud_cover_high_cloud Low_cloud_cover_low_cloud Medium_cloud_cover_middle_cloud Pressure_surface Temperature_height_above_ground Total_cloud_cover_entire_atmosphere Wind_speed_gust_surface u-component_of_wind_height_above_ground_0 u-component_of_wind_height_above_ground_1 v-component_of_wind_height_above_ground_0 v-component_of_wind_height_above_ground_1
2020-07-07 07:00:00-07:00 0.0 0.0 0.000 92405.796875 303.080902 0.000 3.313515 2.322375 1.645506 1.905790 1.961100
2020-07-07 08:00:00-07:00 0.0 0.0 0.000 92417.179688 302.527344 0.000 3.688914 1.022413 1.033438 1.896727 3.745087
2020-07-07 09:00:00-07:00 0.0 0.0 0.000 92431.882812 301.572510 0.000 3.759586 0.053196 -1.240793 1.954304 3.913967
2020-07-07 10:00:00-07:00 0.0 0.0 0.000 92445.476562 300.629303 0.000 4.403845 1.118842 0.075386 2.179615 4.983353
2020-07-07 11:00:00-07:00 0.0 0.0 0.000 92506.515625 299.980896 0.000 5.306301 -0.180458 -2.119454 2.453848 5.835173
2020-07-07 12:00:00-07:00 0.0 0.0 0.000 92555.828125 299.130402 0.000 3.395902 -0.486989 -2.939567 1.794128 2.667837
2020-07-07 13:00:00-07:00 0.0 0.0 0.000 92599.953125 298.860016 0.000 3.230673 -0.767715 -3.777448 1.082680 1.215752
2020-07-07 14:00:00-07:00 0.0 0.0 0.000 92607.460938 302.973572 0.000 3.339937 -1.793591 -2.573579 1.352917 1.792833
2020-07-07 15:00:00-07:00 0.0 0.0 0.000 92658.218750 303.510864 0.000 1.372718 -0.761702 -0.671016 0.923881 1.145391
2020-07-07 16:00:00-07:00 0.0 0.0 0.000 92654.992188 305.878174 0.000 2.019205 0.478144 0.959096 0.767871 0.725159
2020-07-07 17:00:00-07:00 0.0 0.0 0.000 92635.820312 307.424408 0.000 3.067682 1.704718 2.238699 0.475001 0.422306
2020-07-07 18:00:00-07:00 0.0 0.0 0.000 92597.992188 308.948029 0.000 2.809974 1.373396 2.083468 -0.901094 -1.305918
2020-07-07 19:00:00-07:00 0.0 0.0 0.000 92541.890625 311.634216 0.000 4.483505 2.898211 3.599587 -2.039575 -2.503677
2020-07-07 20:00:00-07:00 0.0 0.0 0.000 92478.320312 312.725250 0.000 4.723979 3.323278 4.156990 -1.422667 -2.038654
2020-07-07 21:00:00-07:00 0.0 0.0 0.000 92400.585938 312.970886 0.000 5.156739 2.883315 3.623188 -1.077758 -1.627962
2020-07-07 22:00:00-07:00 0.0 0.0 0.000 92331.359375 313.609467 0.000 4.895695 2.885241 3.497959 -2.090282 -2.508873
2020-07-07 23:00:00-07:00 0.0 0.0 0.000 92234.859375 313.462952 0.000 5.521498 2.532198 3.062895 -2.283554 -2.772110
2020-07-08 00:00:00-07:00 0.0 0.0 0.000 92180.640625 313.770599 0.000 5.899210 2.189854 2.745344 -2.871275 -3.672546
2020-07-08 01:00:00-07:00 0.0 0.0 0.000 92161.843750 313.234772 0.000 4.955510 2.249990 2.829556 -2.373373 -3.611837
2020-07-08 02:00:00-07:00 0.0 0.0 0.000 92153.296875 311.841217 0.000 4.236444 -0.037374 0.131447 -2.484901 -3.720806
2020-07-08 03:00:00-07:00 0.0 0.0 0.250 92183.859375 308.351013 0.250 2.343443 0.442513 0.229076 -1.634480 -2.947691
2020-07-08 04:00:00-07:00 0.0 0.0 0.000 92309.921875 306.405640 0.000 3.494285 1.894991 2.686911 -1.516897 -2.823214
2020-07-08 05:00:00-07:00 0.0 0.0 0.000 92292.101562 304.876709 0.000 3.862377 2.442179 3.891376 0.946564 -1.180391
2020-07-08 06:00:00-07:00 0.0 0.0 0.000 92383.164062 303.395233 0.000 2.375592 0.217960 4.010172 0.733280 0.107170
2020-07-08 07:00:00-07:00 0.0 0.0 0.625 92422.390625 302.499634 0.625 1.501025 -1.327750 1.899975 0.225239 -0.465855
2020-07-08 08:00:00-07:00 0.0 0.0 0.000 92482.789062 301.830353 0.000 2.643574 -2.421239 -2.015884 -0.071746 0.256504
2020-07-08 09:00:00-07:00 0.0 0.0 0.000 92491.710938 300.875671 0.000 2.341817 -1.900394 -1.719477 1.222420 1.164135
2020-07-08 10:00:00-07:00 0.0 0.0 0.000 92522.875000 300.463074 0.000 6.166456 -0.530794 3.041538 2.480942 6.246929
2020-07-08 11:00:00-07:00 0.0 0.0 0.000 92560.914062 299.975403 0.000 6.045594 -0.908249 2.977743 1.987560 5.881613
2020-07-08 12:00:00-07:00 0.0 0.0 0.000 92576.531250 299.594025 0.000 3.154959 -2.600218 -1.900911 -0.722036 0.785109
2020-07-08 13:00:00-07:00 0.0 0.0 0.000 92634.851562 300.410034 0.000 4.209162 -2.778137 -3.810699 -1.186628 -0.991985
2020-07-08 14:00:00-07:00 0.0 0.0 0.000 92676.335938 302.453644 0.000 5.320919 -1.209590 -1.165798 1.741894 2.388416
2020-07-08 15:00:00-07:00 0.0 0.0 0.000 92730.265625 304.502777 0.000 4.087724 -0.291532 -0.107613 2.292839 2.823599
2020-07-08 16:00:00-07:00 0.0 0.0 0.000 92704.734375 306.818756 0.000 2.269935 0.222836 0.191210 1.083733 1.314808
2020-07-08 17:00:00-07:00 0.0 0.0 0.000 92684.734375 308.978821 0.000 2.619478 0.936072 0.979126 -0.099970 -0.044821
2020-07-08 18:00:00-07:00 0.0 0.0 0.000 92623.804688 310.755005 0.000 3.210310 1.378606 1.681459 -1.093060 -1.316065
2020-07-08 19:00:00-07:00 0.0 0.5 1.875 92545.890625 312.208740 1.875 4.035597 0.965443 0.937042 -1.054458 -1.715950
In [43]:
data = fm.get_processed_data(latitude, longitude, start, end)
In [44]:
cloud_vars = ['total_clouds', 'high_clouds', 'mid_clouds', 'low_clouds']
In [45]:
for varname in cloud_vars:
    data[varname].plot(ls='-', linewidth=2)
plt.ylabel('Cloud cover' + ' %')
plt.xlabel('Forecast Time ('+str(data.index.tz)+')')
plt.title('RAP')
plt.legend(bbox_to_anchor=(1.18,1.0));
In [46]:
data['temp_air'].plot(color='r', linewidth=2)
plt.ylabel('Temperature' + ' (%s)' % fm.units['temp_air'])
plt.xlabel('Forecast Time ('+str(data.index.tz)+')');
In [47]:
data['wind_speed'].plot(color='r', linewidth=2)
plt.ylabel('Wind Speed' + ' (%s)' % fm.units['wind_speed'])
plt.xlabel('Forecast Time ('+str(data.index.tz)+')');
In [48]:
data[sorted(data.columns)]
Out[48]:
dhi dni ghi high_clouds low_clouds mid_clouds temp_air total_clouds wind_speed
2020-07-07 07:00:00-07:00 71.635540 543.826680 240.477996 0.0 0.0 0.000 29.930908 0.000 3.004241
2020-07-07 08:00:00-07:00 86.596496 728.586324 456.175991 0.0 0.0 0.000 29.377350 0.000 2.154739
2020-07-07 09:00:00-07:00 122.236626 777.829389 653.786825 0.0 0.0 0.000 28.422516 0.000 1.955028
2020-07-07 10:00:00-07:00 171.241827 779.819561 816.018322 0.0 0.0 0.000 27.479309 0.000 2.450006
2020-07-07 11:00:00-07:00 219.288315 766.669947 930.627284 0.0 0.0 0.000 26.830902 0.000 2.460474
2020-07-07 12:00:00-07:00 248.835940 756.003554 989.335867 0.0 0.0 0.000 25.980408 0.000 1.859047
2020-07-07 13:00:00-07:00 248.107815 756.279866 987.969156 0.0 0.0 0.000 25.710022 0.000 1.327246
2020-07-07 14:00:00-07:00 217.396559 767.306217 926.616347 0.0 0.0 0.000 29.823578 0.000 2.246631
2020-07-07 15:00:00-07:00 168.912693 780.228478 809.627894 0.0 0.0 0.000 30.360870 0.000 1.197391
2020-07-07 16:00:00-07:00 120.244061 776.950602 645.449998 0.0 0.0 0.000 32.728180 0.000 0.904570
2020-07-07 17:00:00-07:00 85.436744 724.204396 446.504106 0.0 0.0 0.000 34.274414 0.000 1.769658
2020-07-07 18:00:00-07:00 70.760082 530.377043 230.422477 0.0 0.0 0.000 35.798035 0.000 1.642616
2020-07-07 19:00:00-07:00 31.921094 45.168640 36.294916 0.0 0.0 0.000 38.484222 0.000 3.543937
2020-07-07 20:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.000 39.575256 0.000 3.614991
2020-07-07 21:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.000 39.820892 0.000 3.078160
2020-07-07 22:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.000 40.459473 0.000 3.562849
2020-07-07 23:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.000 40.312958 0.000 3.409787
2020-07-08 00:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.000 40.620605 0.000 3.611049
2020-07-08 01:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.000 40.084778 0.000 3.270375
2020-07-08 02:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.000 38.691223 0.000 2.485183
2020-07-08 03:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.250 35.201019 0.250 1.693322
2020-07-08 04:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.000 33.255646 0.000 2.427338
2020-07-08 05:00:00-07:00 0.000000 0.000000 0.000000 0.0 0.0 0.000 31.726715 0.000 2.619202
2020-07-08 06:00:00-07:00 34.862378 67.546325 41.944462 0.0 0.0 0.000 30.245239 0.000 0.764988
2020-07-08 07:00:00-07:00 72.819100 533.389198 237.664829 0.0 0.0 0.625 29.349640 0.625 1.346719
2020-07-08 08:00:00-07:00 86.868218 726.368812 454.437459 0.0 0.0 0.000 28.680359 0.000 2.422302
2020-07-08 09:00:00-07:00 122.512815 776.323959 652.254371 0.0 0.0 0.000 27.725677 0.000 2.259604
2020-07-08 10:00:00-07:00 171.595131 778.561044 814.716357 0.0 0.0 0.000 27.313080 0.000 2.537088
2020-07-08 11:00:00-07:00 219.759262 765.485272 929.548292 0.0 0.0 0.000 26.825409 0.000 2.185249
2020-07-08 12:00:00-07:00 249.427638 754.817268 988.451127 0.0 0.0 0.000 26.444031 0.000 2.698605
2020-07-08 13:00:00-07:00 248.778592 755.062801 987.234136 0.0 0.0 0.000 27.260040 0.000 3.020949
2020-07-08 14:00:00-07:00 218.072349 766.050184 925.975581 0.0 0.0 0.000 29.303650 0.000 2.120684
2020-07-08 15:00:00-07:00 169.516668 778.921066 809.020321 0.0 0.0 0.000 31.352783 0.000 2.311299
2020-07-08 16:00:00-07:00 120.732892 775.528590 644.815668 0.0 0.0 0.000 33.668762 0.000 1.106405
2020-07-08 17:00:00-07:00 85.833749 722.415257 445.795050 0.0 0.0 0.000 35.828827 0.000 0.941395
2020-07-08 18:00:00-07:00 71.052011 527.549866 229.634467 0.0 0.0 0.000 37.605011 0.000 1.759356

HRRR (ESRL)

In [49]:
# NBVAL_SKIP
fm = HRRR_ESRL()
c:\users\kanderso\software\anaconda3\envs\pvlib-dev\lib\site-packages\pvlib\forecast.py:803: UserWarning: HRRR_ESRL is an experimental model and is not always available.
  warnings.warn('HRRR_ESRL is an experimental model and is not '
In [ ]:
# retrieve data
# NBVAL_SKIP
data = fm.get_processed_data(latitude, longitude, start, end)
In [ ]:
# NBVAL_SKIP
cloud_vars = ['total_clouds','high_clouds','mid_clouds','low_clouds']
In [ ]:
# NBVAL_SKIP
for varname in cloud_vars:
    data[varname].plot(ls='-', linewidth=2)
plt.ylabel('Cloud cover' + ' %')
plt.xlabel('Forecast Time ('+str(data.index.tz)+')')
plt.title('HRRR_ESRL')
plt.legend(bbox_to_anchor=(1.18,1.0));
In [ ]:
# NBVAL_SKIP
data['ghi'].plot(linewidth=2, ls='-')
plt.ylabel('GHI W/m**2')
plt.xlabel('Forecast Time ('+str(data.index.tz)+')');

Quick power calculation

In [51]:
from pvlib.pvsystem import PVSystem, retrieve_sam
from pvlib.modelchain import ModelChain

sandia_modules = retrieve_sam('SandiaMod')
sapm_inverters = retrieve_sam('cecinverter')
module = sandia_modules['Canadian_Solar_CS5P_220M___2009_']
inverter = sapm_inverters['ABB__MICRO_0_25_I_OUTD_US_208__208V_']

system = PVSystem(module_parameters=module,
                  inverter_parameters=inverter,
                  surface_tilt=latitude,
                  surface_azimuth=180)

# fx is a common abbreviation for forecast
fx_model = GFS()
fx_data = fx_model.get_processed_data(latitude, longitude, start, end)

# use a ModelChain object to calculate modeling intermediates
mc = ModelChain(system, fx_model.location)

# extract relevant data for model chain
mc.run_model(weather=fx_data)
Out[51]:
ModelChain: 
  name: None
  clearsky_model: ineichen
  transposition_model: haydavies
  solar_position_method: nrel_numpy
  airmass_model: kastenyoung1989
  dc_model: sapm
  ac_model: snlinverter
  aoi_model: sapm_aoi_loss
  spectral_model: sapm_spectral_loss
  temperature_model: sapm_temp
  losses_model: no_extra_losses
In [52]:
mc.total_irrad.plot();
In [53]:
mc.cell_temperature.plot();
In [54]:
mc.ac.plot();
In [ ]: