{ "cells": [ { "cell_type": "markdown", "id": "f32579d0-cc66-4531-9378-c348afa93a6a", "metadata": {}, "source": [ "# Tutorial Datasets\n", "\n", "The module {mod}`melodies_monet.tutorial` enables automatic downloading and caching of small[^a] versions of the tutorial datasets.\n", "This functionality requires [pooch](https://www.fatiando.org/pooch/latest/), an optional dependency.\n", "\n", "[^a]: Only a few variables included, levels limited to surface or near-surface, NCO compression applied. Full versions are also available via ." ] }, { "cell_type": "code", "execution_count": null, "id": "0769d026-6169-4fa6-a5a9-29ecccf7cf85", "metadata": {}, "outputs": [], "source": [ "import xarray as xr\n", "\n", "import melodies_monet as mm" ] }, { "cell_type": "code", "execution_count": null, "id": "3eeb69f7-7f38-46a6-9e8d-398ada9f8d99", "metadata": {}, "outputs": [], "source": [ "mm.tutorial.example_ids" ] }, { "cell_type": "markdown", "id": "e3655cc6-6de4-43a8-b765-8e25628b1186", "metadata": {}, "source": [ "The example IDs above can be used inside a control file to specify to use that dataset, downloading if necessary but otherwise loading from the pooch cache.\n", "\n", "For example:\n", "```yaml\n", "model:\n", " cam-chem:\n", " files: 'example:camchem:fv'\n", "```\n", "(for model)\n", "\n", "```yaml\n", "obs:\n", " airnow:\n", " filename: 'example:airnow:2019-09'\n", "```\n", "(for obs)\n", "\n", "Note that you can also use {func}`melodies_monet.tutorial.fetch_example` to load data directly." ] }, { "cell_type": "code", "execution_count": null, "id": "af79bb70-9b29-4d5b-b62b-488991792868", "metadata": {}, "outputs": [], "source": [ "fp = mm.tutorial.fetch_example(\"camchem:fv\")\n", "xr.open_dataset(fp)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.18" } }, "nbformat": 4, "nbformat_minor": 5 }