{ "cells": [ { "cell_type": "markdown", "id": "f1d7b1dc", "metadata": {}, "source": [ "# Get data availability\n", "\n", "This notebook shows how to use the ``get_availability`` method to get data from the AsyncAPI.\n", "It allows to get information about the availability of the data without loading it, i.e. which timestamps are available for a given location and metric.\n", "\n", "API-24SEA endpoint: [https://api.24sea.eu/routes/v1/datasignals/availability](https://api.24sea.eu/docs/v1/#/operations/datasignals_metrics_availability)\n" ] }, { "cell_type": "code", "execution_count": null, "id": "b1c19ef7", "metadata": {}, "outputs": [], "source": [ "# **Package Imports**\n", "# - From the Python Standard Library\n", "import logging\n", "import os\n", "import sys\n", "\n", "# - API-24SEA\n", "from api_24sea.version import __version__, parse_version\n", "from api_24sea.datasignals.core import AsyncAPI\n" ] }, { "cell_type": "code", "execution_count": 18, "id": "f898e247", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Package Version(major=2, minor=1, patch=6, release=None, num=None)\n" ] } ], "source": [ "# **Package Version**\n", "print(f\"Package {parse_version(__version__)}\")\n", "\n", "# **Notebook Configuration**\n", "logger = logging.getLogger()\n", "logger.setLevel(logging.WARNING)\n" ] }, { "cell_type": "markdown", "id": "fa84f388", "metadata": {}, "source": [ "
\n", "

Login Credentials

\n", " \n", " \n", " \n", " \n", "

Do not store API credentials in plain text in your notebook. Rather use the python-dotenv package to load environment variables from a .env file.

\n", "
" ] }, { "cell_type": "code", "execution_count": 19, "id": "e7252b28", "metadata": {}, "outputs": [], "source": [ "# **Set Sample API Credentials**\n", "os.environ[\"API_24SEA_USERNAME\"] = \"Sample.User\"\n", "os.environ[\"API_24SEA_PASSWORD\"] = \"CheckOutSomeData!\"\n" ] }, { "cell_type": "markdown", "id": "823568ec", "metadata": {}, "source": [ "### Availability endpoint\n", "\n", "The availability endpoint allows you to query the availability of data for specific sites, locations, metrics, over a specified time range and granularity. The API returns the percentage of available data points for each metric, location, and time bucket. This can be useful to check if the data you want to query is available before making a data query, or to monitor the availability of your data over time.\n", "\n", "Endpoint parameters are:\n", "- sites: `Optional[Union[List, str]]`\n", " The sites to filter the data.\n", "- locations: `Optional[Union[List, str]]`\n", " The locations to filter the data.\n", "- metrics: `Union[List, str]`\n", " The metrics to retrieve.\n", "- start_timestamp: `Union[str, datetime.datetime]`\n", " The start timestamp for the data retrieval.\n", "- end_timestamp: `Union[str, datetime.datetime]`\n", " The end timestamp for the data retrieval.\n", "- granularity: `Union[str, int]`\n", " The granularity of the data, can be a string, or an integer\n", " number of seconds. String values are restricted to\n", " \"day\", \"week\", \"calendarmonth\", \"30days\", or \"365days\". If\n", " \"calendarmonth\" is used, the availability will refer to the\n", " specific calendar month (e.g. January 2023), and not to a\n", " rolling period of 30 days.\n", "- sampling_interval_seconds: `Optional[int]`\n", " The sampling interval in seconds. If None, the default value is\n", " used, which is 600 seconds (10 minutes).\n", "- as_dict: `bool`\n", " Whether to return the data as a dictionary of dictionaries of dataframes (one per location), or as a single dataframe with site and location as columns.\n", "- headers: `Optional[Union[Dict[str, str]]]`\n", " Headers to include in the request.\n", "- timeout: `int`\n", " The timeout for the request.\n", "- threads: `Optional[int]`\n", " The number of threads to use for the request.\n", "- location: `Optional[Union[List, str]]`\n", " The location name or List of location names. This is a legacy\n", " parameter, and it is deprecated. Please use the locations\n", " parameter instead.\n", "\n" ] }, { "cell_type": "code", "execution_count": 20, "id": "38f065ba", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "78c6b5b5ad2e4fd6ab914a8013deb2b6", "version_major": 2, "version_minor": 0 }, "text/plain": [ "API-24SEA get_data: 0%| | 0/1 [00:00\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
locationdem5_wf_a01_tp_sg_lat010_mtldem5_wf_a01_tp_sg_lat010_mtndem_wf_a01_tp_sg_lat010_mtldem_wf_a01_tp_sg_lat010_mtnmax_wf_a01_nac_acc_famax_wf_a01_nac_acc_ssmax_wf_a01_nac_acc_zmax_wf_a01_pitchmax_wf_a01_power...std_wf_a02_tp_sg_lat010_deg220_0_nr1std_wf_a02_tp_sg_lat010_deg280_0_nr1std_wf_a02_tp_sg_lat010_deg280_t_nr2std_wf_a02_tp_sg_lat010_deg340_0_nr1std_wf_a02_tp_sg_lat010_mtlstd_wf_a02_tp_sg_lat010_mtnstd_wf_a02_tp_sg_lat010_nstd_wf_a02_winddirectionstd_wf_a02_windspeedstd_wf_a02_yaw
timestamp
2020-03-01 00:00:00+00:00wfa010.9973120.9973120.9973120.9973120.00.00.00.00.0...0.9982080.9982080.9982080.9982080.9630380.9630380.9630380.00.9648300.0
2020-04-01 00:00:00+00:00wfa010.9372690.9372690.9372690.9372690.00.00.00.00.0...0.9939810.9939810.9942130.9942130.9932870.9932870.9932870.00.9965280.0
2020-05-01 00:00:00+00:00wfa010.9742380.9742380.9742380.9742380.00.00.00.00.0...1.0000001.0000001.0000001.0000000.9319000.9319000.9319000.00.9319000.0
\n", "

3 rows × 301 columns

\n", "" ], "text/plain": [ " location dem5_wf_a01_tp_sg_lat010_mtl \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 wfa01 0.997312 \n", "2020-04-01 00:00:00+00:00 wfa01 0.937269 \n", "2020-05-01 00:00:00+00:00 wfa01 0.974238 \n", "\n", " dem5_wf_a01_tp_sg_lat010_mtn \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.997312 \n", "2020-04-01 00:00:00+00:00 0.937269 \n", "2020-05-01 00:00:00+00:00 0.974238 \n", "\n", " dem_wf_a01_tp_sg_lat010_mtl \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.997312 \n", "2020-04-01 00:00:00+00:00 0.937269 \n", "2020-05-01 00:00:00+00:00 0.974238 \n", "\n", " dem_wf_a01_tp_sg_lat010_mtn max_wf_a01_nac_acc_fa \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.997312 0.0 \n", "2020-04-01 00:00:00+00:00 0.937269 0.0 \n", "2020-05-01 00:00:00+00:00 0.974238 0.0 \n", "\n", " max_wf_a01_nac_acc_ss max_wf_a01_nac_acc_z \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 0.0 \n", "2020-04-01 00:00:00+00:00 0.0 0.0 \n", "2020-05-01 00:00:00+00:00 0.0 0.0 \n", "\n", " max_wf_a01_pitch max_wf_a01_power ... \\\n", "timestamp ... \n", "2020-03-01 00:00:00+00:00 0.0 0.0 ... \n", "2020-04-01 00:00:00+00:00 0.0 0.0 ... \n", "2020-05-01 00:00:00+00:00 0.0 0.0 ... \n", "\n", " std_wf_a02_tp_sg_lat010_deg220_0_nr1 \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.998208 \n", "2020-04-01 00:00:00+00:00 0.993981 \n", "2020-05-01 00:00:00+00:00 1.000000 \n", "\n", " std_wf_a02_tp_sg_lat010_deg280_0_nr1 \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.998208 \n", "2020-04-01 00:00:00+00:00 0.993981 \n", "2020-05-01 00:00:00+00:00 1.000000 \n", "\n", " std_wf_a02_tp_sg_lat010_deg280_t_nr2 \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.998208 \n", "2020-04-01 00:00:00+00:00 0.994213 \n", "2020-05-01 00:00:00+00:00 1.000000 \n", "\n", " std_wf_a02_tp_sg_lat010_deg340_0_nr1 \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.998208 \n", "2020-04-01 00:00:00+00:00 0.994213 \n", "2020-05-01 00:00:00+00:00 1.000000 \n", "\n", " std_wf_a02_tp_sg_lat010_mtl \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.963038 \n", "2020-04-01 00:00:00+00:00 0.993287 \n", "2020-05-01 00:00:00+00:00 0.931900 \n", "\n", " std_wf_a02_tp_sg_lat010_mtn \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.963038 \n", "2020-04-01 00:00:00+00:00 0.993287 \n", "2020-05-01 00:00:00+00:00 0.931900 \n", "\n", " std_wf_a02_tp_sg_lat010_n \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.963038 \n", "2020-04-01 00:00:00+00:00 0.993287 \n", "2020-05-01 00:00:00+00:00 0.931900 \n", "\n", " std_wf_a02_winddirection std_wf_a02_windspeed \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 0.964830 \n", "2020-04-01 00:00:00+00:00 0.0 0.996528 \n", "2020-05-01 00:00:00+00:00 0.0 0.931900 \n", "\n", " std_wf_a02_yaw \n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 \n", "2020-04-01 00:00:00+00:00 0.0 \n", "2020-05-01 00:00:00+00:00 0.0 \n", "\n", "[3 rows x 301 columns]" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# **API Initialization**\n", "# API initialization can happen either explicitly via the API class, or\n", "# implicitly when using the pandas `datasignals` accessor.\n", "# In this example we will use the Pandas accessor.\n", "api = AsyncAPI()\n", "# The Metrics Overview is a table containing all the locations and metrics\n", "# available in the API, together with their metadata. It is useful to query it\n", "# before getting data, to check which locations and metrics are available for\n", "# the site you want to query.\n", "m_o = api.metrics_overview\n", "\n", "# site is the wind farm name you want to query. The parameter can also be\n", "# a list of site names, e.g. [\"windfarm\", \"windfarm2\"]. Matching is\n", "# case-insensitive and passing the \"site-id\" is also accepted, e.g. \"windfarm\"\n", "# will match \"WindFarm\", but also \"WF\", \"wf\", etc.\n", "site = \"windfarm\"\n", "# Matching locations from Metrics Overview for the specified site\n", "# Also partial names of locations are accepted, e.g. \"a01\" will match\n", "# all locations containing \"a01\" in their name, such as \"A01\", \"a01\". Matching\n", "# is case-insensitive.\n", "locations = m_o[m_o[\"site\"].str.lower() == site][\"location\"].unique().tolist()\n", "# Metrics: partial matches and regexes are accepted.\n", "# Spaces are interpreted as .* in the name.\n", "# If you want to query all metrics, pass \"all\" or [\"all\"].\n", "metrics = [\"all\"]\n", "# Start and end timestamp in ISO 8601 format. The API accepts also other\n", "# formats, such as the one provided by\n", "# https://www.elastic.co/docs/reference/elasticsearch/rest-apis/common-options#date-math\n", "start_timestamp = \"2020-03-01T00:00:00Z\"\n", "end_timestamp = \"2020-06-01T00:00:00Z\"\n", "\n", "data = await api.get_availability(site, locations, metrics, start_timestamp,\n", " end_timestamp, granularity=\"calendarmonth\")\n", "data\n" ] }, { "cell_type": "code", "execution_count": 21, "id": "ccf98c06", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "e8f337656be84f7e8d6fb85a0e5cdd86", "version_major": 2, "version_minor": 0 }, "text/plain": [ "API-24SEA get_data: 0%| | 0/1 [00:00\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
metricDEM5_WF_A01_TP_SG_LAT010_MtlDEM5_WF_A01_TP_SG_LAT010_MtnDEM_WF_A01_TP_SG_LAT010_MtlDEM_WF_A01_TP_SG_LAT010_Mtnmax_WF_A01_NAC_ACC_FAmax_WF_A01_NAC_ACC_SSmax_WF_A01_NAC_ACC_Zmax_WF_A01_TP_ACC_LAT015_DEG240_X_nr1max_WF_A01_TP_ACC_LAT015_DEG240_Y_nr2max_WF_A01_TP_ACC_LAT015_FA...std_WF_A01_TP_SG_LAT010_DEG340_0_nr1std_WF_A01_TP_SG_LAT010_Mtlstd_WF_A01_TP_SG_LAT010_Mtnstd_WF_A01_TP_SG_LAT010_Nstd_WF_A01_pitchstd_WF_A01_powerstd_WF_A01_rpmstd_WF_A01_winddirectionstd_WF_A01_windspeedstd_WF_A01_yaw
timestamp
2020-03-01 00:00:00+00:000.9973120.9973120.9973120.9973120.00.00.00.9995520.9995520.996864...1.00.9973120.9973120.9973120.00.00.00.00.9973120.0
2020-04-01 00:00:00+00:000.9372690.9372690.9372690.9372690.00.00.00.9372690.9372690.937269...0.9372690.9372690.9372690.9372690.00.00.00.00.9432870.0
2020-05-01 00:00:00+00:000.9742380.9742380.9742380.9742380.00.00.00.973790.973790.97379...0.9742380.9742380.9742380.9742380.00.00.00.00.9742380.0
\n", "

3 rows × 150 columns

\n", "" ], "text/plain": [ "metric DEM5_WF_A01_TP_SG_LAT010_Mtl \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.997312 \n", "2020-04-01 00:00:00+00:00 0.937269 \n", "2020-05-01 00:00:00+00:00 0.974238 \n", "\n", "metric DEM5_WF_A01_TP_SG_LAT010_Mtn \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.997312 \n", "2020-04-01 00:00:00+00:00 0.937269 \n", "2020-05-01 00:00:00+00:00 0.974238 \n", "\n", "metric DEM_WF_A01_TP_SG_LAT010_Mtl \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.997312 \n", "2020-04-01 00:00:00+00:00 0.937269 \n", "2020-05-01 00:00:00+00:00 0.974238 \n", "\n", "metric DEM_WF_A01_TP_SG_LAT010_Mtn max_WF_A01_NAC_ACC_FA \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.997312 0.0 \n", "2020-04-01 00:00:00+00:00 0.937269 0.0 \n", "2020-05-01 00:00:00+00:00 0.974238 0.0 \n", "\n", "metric max_WF_A01_NAC_ACC_SS max_WF_A01_NAC_ACC_Z \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 0.0 \n", "2020-04-01 00:00:00+00:00 0.0 0.0 \n", "2020-05-01 00:00:00+00:00 0.0 0.0 \n", "\n", "metric max_WF_A01_TP_ACC_LAT015_DEG240_X_nr1 \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.999552 \n", "2020-04-01 00:00:00+00:00 0.937269 \n", "2020-05-01 00:00:00+00:00 0.97379 \n", "\n", "metric max_WF_A01_TP_ACC_LAT015_DEG240_Y_nr2 \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.999552 \n", "2020-04-01 00:00:00+00:00 0.937269 \n", "2020-05-01 00:00:00+00:00 0.97379 \n", "\n", "metric max_WF_A01_TP_ACC_LAT015_FA ... \\\n", "timestamp ... \n", "2020-03-01 00:00:00+00:00 0.996864 ... \n", "2020-04-01 00:00:00+00:00 0.937269 ... \n", "2020-05-01 00:00:00+00:00 0.97379 ... \n", "\n", "metric std_WF_A01_TP_SG_LAT010_DEG340_0_nr1 \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 1.0 \n", "2020-04-01 00:00:00+00:00 0.937269 \n", "2020-05-01 00:00:00+00:00 0.974238 \n", "\n", "metric std_WF_A01_TP_SG_LAT010_Mtl \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.997312 \n", "2020-04-01 00:00:00+00:00 0.937269 \n", "2020-05-01 00:00:00+00:00 0.974238 \n", "\n", "metric std_WF_A01_TP_SG_LAT010_Mtn \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.997312 \n", "2020-04-01 00:00:00+00:00 0.937269 \n", "2020-05-01 00:00:00+00:00 0.974238 \n", "\n", "metric std_WF_A01_TP_SG_LAT010_N std_WF_A01_pitch \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.997312 0.0 \n", "2020-04-01 00:00:00+00:00 0.937269 0.0 \n", "2020-05-01 00:00:00+00:00 0.974238 0.0 \n", "\n", "metric std_WF_A01_power std_WF_A01_rpm \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 0.0 \n", "2020-04-01 00:00:00+00:00 0.0 0.0 \n", "2020-05-01 00:00:00+00:00 0.0 0.0 \n", "\n", "metric std_WF_A01_winddirection std_WF_A01_windspeed \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 0.997312 \n", "2020-04-01 00:00:00+00:00 0.0 0.943287 \n", "2020-05-01 00:00:00+00:00 0.0 0.974238 \n", "\n", "metric std_WF_A01_yaw \n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 \n", "2020-04-01 00:00:00+00:00 0.0 \n", "2020-05-01 00:00:00+00:00 0.0 \n", "\n", "[3 rows x 150 columns]" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
metricDEM5_WF_A02_TP_SG_LAT010_MtlDEM5_WF_A02_TP_SG_LAT010_MtnDEM_WF_A02_TP_SG_LAT010_MtlDEM_WF_A02_TP_SG_LAT010_Mtnmax_WF_A02_NAC_ACC_FAmax_WF_A02_NAC_ACC_SSmax_WF_A02_NAC_ACC_Zmax_WF_A02_TP_ACC_LAT015_DEG240_X_nr1max_WF_A02_TP_ACC_LAT015_DEG240_Y_nr2max_WF_A02_TP_ACC_LAT015_FA...std_WF_A02_TP_SG_LAT010_DEG340_0_nr1std_WF_A02_TP_SG_LAT010_Mtlstd_WF_A02_TP_SG_LAT010_Mtnstd_WF_A02_TP_SG_LAT010_Nstd_WF_A02_pitchstd_WF_A02_powerstd_WF_A02_rpmstd_WF_A02_winddirectionstd_WF_A02_windspeedstd_WF_A02_yaw
timestamp
2020-03-01 00:00:00+00:000.9630380.9630380.9630380.9630380.00.00.00.9982080.9982080.963038...0.9982080.9630380.9630380.9630380.00.00.00.00.964830.0
2020-04-01 00:00:00+00:000.9932870.9932870.9932870.9932870.00.00.00.9946760.9946760.994676...0.9942130.9932870.9932870.9932870.00.00.00.00.9965280.0
2020-05-01 00:00:00+00:000.93190.93190.93190.93190.00.00.00.930780.930780.93078...1.00.93190.93190.93190.00.00.00.00.93190.0
\n", "

3 rows × 150 columns

\n", "
" ], "text/plain": [ "metric DEM5_WF_A02_TP_SG_LAT010_Mtl \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.963038 \n", "2020-04-01 00:00:00+00:00 0.993287 \n", "2020-05-01 00:00:00+00:00 0.9319 \n", "\n", "metric DEM5_WF_A02_TP_SG_LAT010_Mtn \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.963038 \n", "2020-04-01 00:00:00+00:00 0.993287 \n", "2020-05-01 00:00:00+00:00 0.9319 \n", "\n", "metric DEM_WF_A02_TP_SG_LAT010_Mtl \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.963038 \n", "2020-04-01 00:00:00+00:00 0.993287 \n", "2020-05-01 00:00:00+00:00 0.9319 \n", "\n", "metric DEM_WF_A02_TP_SG_LAT010_Mtn max_WF_A02_NAC_ACC_FA \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.963038 0.0 \n", "2020-04-01 00:00:00+00:00 0.993287 0.0 \n", "2020-05-01 00:00:00+00:00 0.9319 0.0 \n", "\n", "metric max_WF_A02_NAC_ACC_SS max_WF_A02_NAC_ACC_Z \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 0.0 \n", "2020-04-01 00:00:00+00:00 0.0 0.0 \n", "2020-05-01 00:00:00+00:00 0.0 0.0 \n", "\n", "metric max_WF_A02_TP_ACC_LAT015_DEG240_X_nr1 \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.998208 \n", "2020-04-01 00:00:00+00:00 0.994676 \n", "2020-05-01 00:00:00+00:00 0.93078 \n", "\n", "metric max_WF_A02_TP_ACC_LAT015_DEG240_Y_nr2 \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.998208 \n", "2020-04-01 00:00:00+00:00 0.994676 \n", "2020-05-01 00:00:00+00:00 0.93078 \n", "\n", "metric max_WF_A02_TP_ACC_LAT015_FA ... \\\n", "timestamp ... \n", "2020-03-01 00:00:00+00:00 0.963038 ... \n", "2020-04-01 00:00:00+00:00 0.994676 ... \n", "2020-05-01 00:00:00+00:00 0.93078 ... \n", "\n", "metric std_WF_A02_TP_SG_LAT010_DEG340_0_nr1 \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.998208 \n", "2020-04-01 00:00:00+00:00 0.994213 \n", "2020-05-01 00:00:00+00:00 1.0 \n", "\n", "metric std_WF_A02_TP_SG_LAT010_Mtl \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.963038 \n", "2020-04-01 00:00:00+00:00 0.993287 \n", "2020-05-01 00:00:00+00:00 0.9319 \n", "\n", "metric std_WF_A02_TP_SG_LAT010_Mtn \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.963038 \n", "2020-04-01 00:00:00+00:00 0.993287 \n", "2020-05-01 00:00:00+00:00 0.9319 \n", "\n", "metric std_WF_A02_TP_SG_LAT010_N std_WF_A02_pitch \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.963038 0.0 \n", "2020-04-01 00:00:00+00:00 0.993287 0.0 \n", "2020-05-01 00:00:00+00:00 0.9319 0.0 \n", "\n", "metric std_WF_A02_power std_WF_A02_rpm \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 0.0 \n", "2020-04-01 00:00:00+00:00 0.0 0.0 \n", "2020-05-01 00:00:00+00:00 0.0 0.0 \n", "\n", "metric std_WF_A02_winddirection std_WF_A02_windspeed \\\n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 0.96483 \n", "2020-04-01 00:00:00+00:00 0.0 0.996528 \n", "2020-05-01 00:00:00+00:00 0.0 0.9319 \n", "\n", "metric std_WF_A02_yaw \n", "timestamp \n", "2020-03-01 00:00:00+00:00 0.0 \n", "2020-04-01 00:00:00+00:00 0.0 \n", "2020-05-01 00:00:00+00:00 0.0 \n", "\n", "[3 rows x 150 columns]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Extract data for a specific location only\n", "av_as_dict = await api.get_availability(site, locations, metrics, start_timestamp,\n", " end_timestamp, granularity=\"calendarmonth\",\n", " as_dict=True)\n", "av_as_dict\n", "display(av_as_dict[site][locations[0]])\n", "display(av_as_dict[site][locations[1]])\n" ] } ], "metadata": { "jupytext": { "custom_cell_magics": "kql", "encoding": "# -*- coding: utf-8 -*-" }, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.13.1" } }, "nbformat": 4, "nbformat_minor": 5 }