{ "cells": [ { "cell_type": "markdown", "id": "b1600459-c400-47fa-a3a2-b3114f4a5a34", "metadata": {}, "source": [ "# Demo example: Using a Google Earth engine\n", "\n", "\n", "This example is the continuation of the previous example: [Using a Dataset](https://metobs-toolkit.readthedocs.io/en/move_to_rtd/examples/doc_example.html). This example serves as a demonstration on how to get meta-data from the Google Earth Engine (GEE). \n", "\n", "Before proceeding, make sure you have **set up a Google developers account and a GEE project**. See [Using Google Earth Engine](https://metobs-toolkit.readthedocs.io/en/move_to_rtd/topics/gee_authentication.html#using-google-earth-engine) for a detailed description of this." ] }, { "cell_type": "markdown", "id": "b8ed4367-693b-4692-bba4-aee9ceb8c311", "metadata": {}, "source": [ "## Create your Dataset\n", "\n", "Create a dataset with the demo data." ] }, { "cell_type": "code", "execution_count": 1, "id": "8ec045a4-be37-4c1b-bed4-df4dbf27dc51", "metadata": {}, "outputs": [], "source": [ "import metobs_toolkit\n", "\n", "your_dataset = metobs_toolkit.Dataset()\n", "your_dataset.update_settings(\n", " input_data_file=metobs_toolkit.demo_datafile, # path to the data file\n", " input_metadata_file=metobs_toolkit.demo_metadatafile,\n", " template_file=metobs_toolkit.demo_template,\n", ")\n", "\n", "your_dataset.import_data_from_file()" ] }, { "cell_type": "markdown", "id": "87479c13-6a41-4c53-ae7f-4c4eaaceef08", "metadata": {}, "source": [ "## Extracting LCZ from GEE\n", "\n", "Here is an example of how to extract the Local Climate Zone (LCZ) information of your stations. First, we take a look at what is present in the metadata of the dataset. " ] }, { "cell_type": "code", "execution_count": 2, "id": "0f94ec85-b403-41f2-bc4b-e256c93d9516", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | network | \n", "lat | \n", "lon | \n", "call_name | \n", "location | \n", "geometry | \n", "lcz | \n", "assumed_import_frequency | \n", "dataset_resolution | \n", "
|---|---|---|---|---|---|---|---|---|---|
| name | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
| vlinder01 | \n", "Vlinder | \n", "50.980438 | \n", "3.815763 | \n", "Proefhoeve | \n", "Melle | \n", "POINT (3.81576 50.98044) | \n", "NaN | \n", "0 days 00:05:00 | \n", "0 days 00:05:00 | \n", "
| vlinder02 | \n", "Vlinder | \n", "51.022379 | \n", "3.709695 | \n", "Sterre | \n", "Gent | \n", "POINT (3.70969 51.02238) | \n", "NaN | \n", "0 days 00:05:00 | \n", "0 days 00:05:00 | \n", "
| vlinder03 | \n", "Vlinder | \n", "51.324583 | \n", "4.952109 | \n", "Centrum | \n", "Turnhout | \n", "POINT (4.95211 51.32458) | \n", "NaN | \n", "0 days 00:05:00 | \n", "0 days 00:05:00 | \n", "
| vlinder04 | \n", "Vlinder | \n", "51.335522 | \n", "4.934732 | \n", "Stadsboerderij | \n", "Turnhout | \n", "POINT (4.93473 51.33552) | \n", "NaN | \n", "0 days 00:05:00 | \n", "0 days 00:05:00 | \n", "
| vlinder05 | \n", "Vlinder | \n", "51.052655 | \n", "3.675183 | \n", "Watersportbaan | \n", "Gent | \n", "POINT (3.67518 51.05266) | \n", "NaN | \n", "0 days 00:05:00 | \n", "0 days 00:05:00 | \n", "
To authorize access needed by Earth Engine, open the following\n", " URL in a web browser and follow the instructions:
\n", " \n", "The authorization workflow will generate a code, which you should paste in the box below.
\n", " " ], "text/plain": [ "