Solar¶
Access data and analysis services that provide access to solar resource data and NREL models.
NSRDB - National Solar Radiation Database¶
Data query and downloads from the National Solar Radiation Database.
-
nrel_dev_api.solar.get_nsrdb_download_links(year, interval=None, api_key=None, wkt=None, address=None, lat=None, lon=None, dataset_type=None, show_empty=False)¶ Get NSRDB dowload links from data query for the specified location.
- Parameters
year (int) – The year to use for searching through NSRDB.
interval (Optional[int]) – Time interval of interest in minutes. Options are 15, 30, 60 (minutes).
api_key (Optional[str]) – NREL developer API key.
wkt (Optional[str]) – well-known text (WKT) representation of the geometry for which to extract data. May be a point, multipoint, or polygon geometry. Required if neither lat/lon not address are specified.
address (Optional[str]) – Address to use. Required if neither lat/lon nor wkt are specified.
lat (Optional[Union[int, float]]) – Latitude of the location. Required if neither address nor wkt are specified.
lon (Optional[Union[int, float]]) – Longitude of the location. Required if neither address not wkt are specified.
dataset_type (Optional[str]) – Type of the dataset to include in the response. Options are ‘satellite’ or ‘station’.
show_empty (bool) – Return metadata for all datasets including those with no data at the given location.
- Return type
List[str]
-
nrel_dev_api.solar.download_nsrdb_data(link, email, api_key=None)¶ Download NSRDB data from the provided link and returns a pandas DataFrame.
- Parameters
link (str) – NSRDB download link. If not known, it can be acquired using get_nsrdb_download_links().
email (str) – Valid email.
api_key (Optional[str]) – NREL developer API key.
- Return type
pandas.core.frame.DataFrame
-
class
nrel_dev_api.solar.NSRDB_DataQuery(api_key=None, wkt=None, address=None, lat=None, lon=None, dataset_type=None, show_empty=False)¶ Query National Solar Radiation Database (NSRDB).
Returns information on the closest NSRDB datasets for a location.
Including a set of links that can be used to download the data.
- Parameters
api_key (Optional[str]) – NREL developer API key.
wkt (Optional[str]) – well-known text (WKT) representation of the geometry for which to extract data. May be a point, multipoint, or polygon geometry. Required if neither lat/lon not address are specified.
address (Optional[str]) – Address to use. Required if neither lat/lon nor wkt are specified.
lat (Optional[Union[int, float]]) – Latitude of the location. Required if neither address nor wkt are specified.
lon (Optional[Union[int, float]]) – Longitude of the location. Required if neither address not wkt are specified.
dataset_type (Optional[str]) – Type of the dataset to include in the response. Options are ‘satellite’ or ‘station’.
show_empty (bool) – Return metadata for all datasets including those with no data at the given location.
PV Watts V6¶
NREL’s PVWatts® API estimates the energy production of grid-connected photovoltaic (PV) energy systems based on a few simple inputs.
-
class
nrel_dev_api.solar.PVWattsV6(system_capacity, module_type, losses, array_type, tilt, azimuth, api_key=None, lat=None, lon=None, address=None, file_id=None, dataset='nsrdb', radius=100, timeframe='monthly', dc_ac_ratio=1.2, gcr=0.4, inv_eff=96)¶ Use PVWatts API from NREL to estimate energy production.
Estimate the energy production of grid-connected photovoltaic (PV) energy systems using NREL’s PVWatts API based on a few simple inputs.
- Parameters
system_capacity (Union[int, float]) – Nameplate capacity (kW).
module_type (int) – Module type. 0 - Standard 1 - Premium 2 - Thin Film
losses (Union[int, float]) – System losses (percent).
array_type (int) – Array type. 0 - Fixed Open Rack 1 - Fixed Roof Mounted 2 - 1 Axis 3 - 1 Axis Backtracking 4 - 2 Axis
tilt (Union[int, float]) – Tilt angle (degrees).
azimuth (Union[int, float]) – Azimuth angle (degrees).
address (Optional[str]) – The address to use. Required if lat/lon or file_id not specified.
lat (Optional[Union[int, float]]) – The latitude for the location to use. Required if address or file_id not specified.
lon (Optional[Union[int, float]]) – The longitude for the location to use. Required if adress or file_id not specified.
file_id (Optional[str]) – Reference to a specific climate data file to use. Must be a valid id returned by the SolarDatasetQuery API. Required if lat/lon or address not specified.
dataset (str) – The climate dataset to use. Should not be passed if using file_id to specify the climate data file. Options - nsrdb, tmy2, tmy3, intl.
radius (int) – The search radius to use when searching for the closest climate data station (miles). Use radius=0 to use the closest station regardless of the distance.
timeframe (str) – Granularity of the output response. Options - monthly, hourly.
dc_ac_ratio (float) – DC to AC ratio. Must be positive.
gcr (float) – Ground coverage ratio.
inv_eff (Union[int, float]) – Inverter efficiency at rated power.
api_key (Optional[str]) –
Solar Resource Data¶
Get various types of solar data for a location. The service from NREL currently returns data for average Direct Normal Irradiance, average Global Horizontal Irradiance, and average Tilt at Latitude.
-
class
nrel_dev_api.solar.SolarResourceData(api_key=None, lat=None, lon=None, address=None)¶ Returns various types of solar data for a location.
The service from NREL currently returns data for average Direct Normal Irradiance, average Global Horizontal Irradiance, and average Tilt at Latitude.
- Parameters
api_key (Optional[str]) – NREL developer API key.
lat (Optional[Union[int, float]]) – Latitude of the location. Required if address is not specified.
lon (Optional[Union[int, float]]) – Longitude of the location. Required if address is not specified.
address (Optional[str]) – Address to use. Required if lat and lon are not specified.
Solar DatasetQuery¶
Get information on the closest climate data for a location.
-
class
nrel_dev_api.solar.SolarDatasetQuery(api_key=None, lat=None, lon=None, address=None, radius=100, return_all_stations=False)¶ Returns information on the closest climate data for a location.
- Parameters
api_key (Optional[str]) – NREL developer API key.
lat (Optional[Union[int, float]]) – Latitude of the location. Required if address is not specified.
lon (Optional[Union[int, float]]) – Longitude of the location. Required if address is not specified.
address (Optional[str]) – Address to use. Required if lat and lon are not specified.
radius (int) – The search radius (in miles) to use when searching for climate data stations. Use radius=0 for closest station regardless of the distance.
return_all_stations (bool) – Return all stations within the radius.