{ "cells": [ { "cell_type": "markdown", "source": [ "# Solar Dataset Query\n", "\n", "> Get information on the closest climate data for a given location" ], "metadata": {} }, { "cell_type": "markdown", "source": [ "Let's set our NREL API key, first." ], "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 SolarDatasetQuery\n", "\n", "# get and globally set API key\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": [ "Information on climate data for the location closest to the specified one. Here, we will search for Colorado." ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "solar_dataset_query = SolarDatasetQuery(lat=40, lon=-105)" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "Outputs for the solar dataset are available under the `outputs` attribute." ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "solar_dataset_query.outputs" ], "outputs": [], "metadata": {} }, { "cell_type": "markdown", "source": [ "We can also get information about all the stations within a specified radius around a location." ], "metadata": {} }, { "cell_type": "code", "execution_count": null, "source": [ "solar_dataset_query = SolarDatasetQuery(lat=40,\n", " lon=-105,\n", " radius=100,\n", " return_all_stations=True\n", " )\n", "\n", "solar_dataset_query.outputs" ], "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 }