Solar Resource Data¶
Get average Direct Normal Irradiance (avg_dni), average Global Horizontal Irradiance (avg_ghi), and average Tilt (avg_lat_tilt) for a location.
An example to get solar resource data - average Direct Normal Irradiance, average Global Horizontal Irradiance, and average tilt - from NREL
First, let’s set our NREL API key.
[1]:
import os
from nrel_dev_api import set_nrel_api_key
from nrel_dev_api.solar import SolarResourceData
NREL_API_KEY = os.environ["DEMO_NREL_API_KEY"]
set_nrel_api_key(NREL_API_KEY)
Alternatively, you can provide your NREL Developer API key with every call. Setting it globally is just for convenience.
Let’s check available solar resource data for Seattle, WA.
[2]:
solar_resource_data = SolarResourceData(lat=47, lon=-122)
Outputs for solar resource data is available as the outputs attribute.
[3]:
solar_resource_data.outputs
[3]:
{'avg_dni': {'annual': 3.2,
'monthly': {'jan': 1.77,
'feb': 2.51,
'mar': 2.28,
'apr': 3.29,
'may': 3.33,
'jun': 3.65,
'jul': 5.75,
'aug': 5.14,
'sep': 4.62,
'oct': 2.53,
'nov': 1.74,
'dec': 1.7}},
'avg_ghi': {'annual': 3.26,
'monthly': {'jan': 1.09,
'feb': 1.89,
'mar': 2.61,
'apr': 4.05,
'may': 4.66,
'jun': 5.1,
'jul': 6.11,
'aug': 5.17,
'sep': 3.95,
'oct': 2.17,
'nov': 1.25,
'dec': 0.97}},
'avg_lat_tilt': {'annual': 3.78,
'monthly': {'jan': 2.13,
'feb': 3.07,
'mar': 3.24,
'apr': 4.3,
'may': 4.36,
'jun': 4.54,
'jul': 5.71,
'aug': 5.44,
'sep': 5.04,
'oct': 3.23,
'nov': 2.24,
'dec': 2.05}}}
We can also provide the address to access the solar resource data.
[4]:
address = "Seattle, WA"
solar_resource_data = SolarResourceData(address=address)
The complete response as a dictionary is available as the response attribute.
[5]:
solar_resource_data.response
[5]:
{'version': '1.0.0',
'warnings': [],
'errors': [],
'metadata': {'sources': ['Perez-SUNY/NREL, 2012']},
'inputs': {'address': 'Seattle, WA'},
'outputs': {'avg_dni': {'annual': 3.5,
'monthly': {'jan': 1.19,
'feb': 2.73,
'mar': 2.16,
'apr': 3.76,
'may': 4.21,
'jun': 5.14,
'jul': 6.66,
'aug': 5.97,
'sep': 5.12,
'oct': 2.51,
'nov': 1.34,
'dec': 1.21}},
'avg_ghi': {'annual': 3.46,
'monthly': {'jan': 0.98,
'feb': 1.94,
'mar': 2.75,
'apr': 4.51,
'may': 5.34,
'jun': 5.99,
'jul': 6.38,
'aug': 5.48,
'sep': 4.03,
'oct': 2.11,
'nov': 1.12,
'dec': 0.84}},
'avg_lat_tilt': {'annual': 3.98,
'monthly': {'jan': 1.73,
'feb': 3.25,
'mar': 3.43,
'apr': 4.95,
'may': 5.13,
'jun': 5.43,
'jul': 5.98,
'aug': 5.87,
'sep': 5.23,
'oct': 3.18,
'nov': 1.91,
'dec': 1.65}}}}
[ ]: