{ "cells": [ { "cell_type": "markdown", "source": [ "# Solar Resource Data\n", "\n", "> Get average Direct Normal Irradiance (avg_dni), average Global Horizontal Irradiance (avg_ghi), and average Tilt (avg_lat_tilt) for a location." ], "metadata": {} }, { "cell_type": "markdown", "source": [ "An example to get solar resource data - average Direct Normal Irradiance, average Global Horizontal Irradiance, and average tilt - from NREL" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "First, let's set our NREL API key." ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "import os\n", "from nrel_dev_api import set_nrel_api_key\n", "from nrel_dev_api.solar import SolarResourceData\n", "\n", "NREL_API_KEY = os.environ[\"DEMO_NREL_API_KEY\"]\n", "\n", "set_nrel_api_key(NREL_API_KEY)" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "> Alternatively, you can provide your NREL Developer API key with every call. Setting it globally is just for convenience." ], "metadata": {} }, { "cell_type": "markdown", "source": [ "Let's check available solar resource data for Seattle, WA." ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "solar_resource_data = SolarResourceData(lat=47, lon=-122)" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "Outputs for solar resource data is available as the `outputs` attribute." ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "solar_resource_data.outputs" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "We can also provide the address to access the solar resource data." ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "address = \"Seattle, WA\"\n", "\n", "solar_resource_data = SolarResourceData(address=address)" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "The complete response as a dictionary is available as the `response` attribute." ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "solar_resource_data.response" ], "outputs": [], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [], "outputs": [], "metadata": {} } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:nrel-dev-api]", "language": "python", "name": "conda-env-nrel-dev-api-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.8" } }, "nbformat": 4, "nbformat_minor": 4 }