{ "cells": [ { "cell_type": "code", "execution_count": null, "id": "0", "metadata": { "nbsphinx": "hidden" }, "outputs": [], "source": [ "# Remove flox spam\n", "\n", "import logging\n", "\n", "# Get the logger for the 'flox' package\n", "logger = logging.getLogger(\"flox\")\n", "# Set the logging level to WARNING\n", "logger.setLevel(logging.WARNING)" ] }, { "cell_type": "markdown", "id": "1", "metadata": {}, "source": [ "# Getting Started\n", "\n", "This Notebook will go through all major steps of creating a climate scenario using `xscen`. These steps are:\n", "\n", "- `search_data_catalogs` to find a subset of datasets that match a given project's requirements.\n", "- `extract_dataset` to extract them.\n", "- `regrid_dataset` to regrid all data to a common grid.\n", "- `train` and `adjust` to bias correct the raw simulations.\n", "- `compute_indicators` to compute a list of indicators.\n", "- `climatological_op` and `spatial_mean` for spatio-temporal aggregation.\n", "- `compute_deltas` to compute deltas.\n", "- `ensemble_stats` for ensemble statistics.\n", "- `clean_up` for minor adjustments that have to be made in preparation for the final product.\n", "\n", "\n", "## Initialisation\n", "\n", "Typically, the first step should be to create a new *ProjectCatalog* to store the files that will be created during the process. More details on basic usage are provided in the Catalogs Notebook." ] }, { "cell_type": "code", "execution_count": null, "id": "2", "metadata": { "tags": [] }, "outputs": [], "source": [ "from pathlib import Path\n", "\n", "# A temporary bug fix waiting for xclim 0.49\n", "import xclim as xc\n", "\n", "import xscen as xs\n", "\n", "# Folder where to put the data\n", "output_folder = Path().absolute() / \"_data\"\n", "output_folder.mkdir(exist_ok=True)\n", "\n", "project = {\n", " \"title\": \"example-gettingstarted\",\n", " \"description\": \"This is an example catalog for xscen's documentation.\",\n", "}\n", "\n", "pcat = xs.ProjectCatalog(\n", " str(output_folder / \"example-gettingstarted.json\"),\n", " create=True,\n", " project=project,\n", " overwrite=True,\n", ")" ] }, { "cell_type": "markdown", "id": "3", "metadata": {}, "source": [ "### Searching a subset of datasets within *DataCatalogs*\n", "\n", "