|
40 | 40 | "\n", |
41 | 41 | "Intake was originally developed within Anaconda by the team behind Dask.\n", |
42 | 42 | "\n", |
43 | | - "### Example using intake v2\n" |
| 43 | + "### Resources\n", |
| 44 | + "\n", |
| 45 | + "Project Pythia has a [cookbook on Intake](https://projectpythia.org/intake-cookbook/notebooks/creating-catalogs/).\n", |
| 46 | + "\n", |
| 47 | + "### Example code\n", |
| 48 | + "\n", |
| 49 | + "Here we work based off [an Intake tutorial on easy.gems!](https://easy.gems.dkrz.de/Processing/intake.html) from the DKRZ (German Climate Supercomputing Center). Note that the tutorial is based on v1 of Intake (which also uses `intake-xarray`).\n" |
44 | 50 | ] |
45 | 51 | }, |
46 | 52 | { |
47 | 53 | "cell_type": "code", |
48 | 54 | "execution_count": null, |
49 | | - "id": "526792bd", |
| 55 | + "id": "1", |
50 | 56 | "metadata": {}, |
51 | 57 | "outputs": [], |
52 | | - "source": [] |
| 58 | + "source": [ |
| 59 | + "# Browse an existing catalogue\n", |
| 60 | + "\n", |
| 61 | + "import intake\n", |
| 62 | + "\n", |
| 63 | + "cat = intake.open_catalog(\"https://data.nextgems-h2020.eu/online.yaml\")\n", |
| 64 | + "# TIP: Its just a YAML file - open it in your browser and you'll see!\n", |
| 65 | + "\n", |
| 66 | + "# view the available subcatalogues or datasets\n", |
| 67 | + "list(cat)" |
| 68 | + ] |
| 69 | + }, |
| 70 | + { |
| 71 | + "cell_type": "code", |
| 72 | + "execution_count": null, |
| 73 | + "id": "2", |
| 74 | + "metadata": {}, |
| 75 | + "outputs": [], |
| 76 | + "source": [ |
| 77 | + "# Access catalogue elements using `[\"attr\"]` or `.attr` notation\n", |
| 78 | + "# NOTE: The `.attr` notation only works if the entry is a valid Python attribute name - which the entry might not be\n", |
| 79 | + "\n", |
| 80 | + "# Let's see what the `tutorial` item is...\n", |
| 81 | + "cat[\"tutorial\"]" |
| 82 | + ] |
| 83 | + }, |
| 84 | + { |
| 85 | + "cell_type": "code", |
| 86 | + "execution_count": null, |
| 87 | + "id": "3", |
| 88 | + "metadata": {}, |
| 89 | + "outputs": [], |
| 90 | + "source": [ |
| 91 | + "# it's a subcatalogue!\n", |
| 92 | + "\n", |
| 93 | + "print(list(cat[\"tutorial\"]))\n", |
| 94 | + "\n", |
| 95 | + "# Let's look at an entry within...\n", |
| 96 | + "cat['tutorial']['ICON.native.2d_PT6H_inst']" |
| 97 | + ] |
| 98 | + }, |
| 99 | + { |
| 100 | + "cell_type": "code", |
| 101 | + "execution_count": null, |
| 102 | + "id": "4", |
| 103 | + "metadata": {}, |
| 104 | + "outputs": [], |
| 105 | + "source": [ |
| 106 | + "# Let's open it as an xarray dataset\n", |
| 107 | + "\n", |
| 108 | + "ds = cat['tutorial']['ICON.native.2d_PT6H_inst'].to_dask()\n", |
| 109 | + "ds" |
| 110 | + ] |
| 111 | + }, |
| 112 | + { |
| 113 | + "cell_type": "markdown", |
| 114 | + "id": "5", |
| 115 | + "metadata": {}, |
| 116 | + "source": [ |
| 117 | + "That's it for the example! Feel free to poke around further to see what other datasets are available in this catalogue, or to see which other catalogues are available online." |
| 118 | + ] |
53 | 119 | }, |
54 | 120 | { |
55 | 121 | "cell_type": "markdown", |
56 | | - "id": "d6767fe7", |
| 122 | + "id": "6", |
57 | 123 | "metadata": {}, |
58 | 124 | "source": [ |
59 | 125 | "## STAC\n", |
|
62 | 128 | "> The STAC specification is a common language to describe geospatial information, so it can more easily be worked with, indexed, and discovered.\n", |
63 | 129 | "> -stacspec.org\n", |
64 | 130 | "\n", |
65 | | - "Let's set the scene a bit: During sattelite data processing, many image files (predominantly TIFF) get generated. Each of these files can have different spatial and temporal extents, and over time these individual files can number in the millions, containing terrabytes of data in total. When doing analyses on these files, the first thing one needs to know is whether the file is even relevant to the analysis at hand (i.e., at least \"what is the spatial and temporal extent of the file?\"), however downloading the file just to check this metadata within is very wasteful. This is the context from which the STAC project was born.\n", |
| 131 | + "Let's set the scene a bit: During satellite data processing, many image files (predominantly TIFF) get generated. Each of these files can have different spatial and temporal extents, and over time these individual files can number in the millions, containing terrabytes of data in total. When doing analyses on these files, the first thing one needs to know is whether the file is even relevant to the analysis at hand (i.e., at least \"what is the spatial and temporal extent of the file?\"), however downloading the file just to check this metadata within is very wasteful. This is the context from which the STAC project was born.\n", |
66 | 132 | "\n", |
67 | | - "The goal of the STAC project is to make geospatial data more accesible by providing a specification to describe assets and their metadata. Adding this metadata alongside the asset (or lifting it out above the asset itself) allows:\n", |
| 133 | + "The goal of the STAC project is to make geospatial data more accessible by providing a specification to describe assets and their metadata. Adding this metadata alongside the asset (or lifting it out above the asset itself) allows:\n", |
68 | 134 | "\n", |
69 | 135 | "- The combining of assets into larger collections representing a larger dataset (e.g., a dataset with multiple time slices)\n", |
70 | 136 | "- For more efficient workflows, as the whole asset doesn't need to be downloaded to check the metadata.\n", |
|
83 | 149 | "- https://stacspec.org/en\n", |
84 | 150 | "- https://stacindex.org/\n", |
85 | 151 | "\n", |
86 | | - "### Example using odc-stac\n" |
| 152 | + "### Example using odc-stac\n", |
| 153 | + "\n" |
87 | 154 | ] |
88 | 155 | }, |
89 | | - { |
90 | | - "cell_type": "code", |
91 | | - "execution_count": null, |
92 | | - "id": "f6a76a8e", |
93 | | - "metadata": {}, |
94 | | - "outputs": [], |
95 | | - "source": [] |
96 | | - }, |
97 | 156 | { |
98 | 157 | "cell_type": "markdown", |
99 | | - "id": "2", |
| 158 | + "id": "7", |
100 | 159 | "metadata": {}, |
101 | 160 | "source": [ |
102 | 161 | "## Commercial offering - Arraylake\n", |
|
120 | 179 | }, |
121 | 180 | { |
122 | 181 | "cell_type": "markdown", |
123 | | - "id": "06af9324", |
| 182 | + "id": "8", |
124 | 183 | "metadata": {}, |
125 | 184 | "source": [] |
126 | 185 | } |
|
0 commit comments