diff --git a/PRR/antarctica_zarr.ipynb b/PRR/antarctica_zarr.ipynb new file mode 100644 index 0000000..08a5ef0 --- /dev/null +++ b/PRR/antarctica_zarr.ipynb @@ -0,0 +1,2315 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "6fea89d6-4eb5-4cc7-a3e3-7c2e5037086b", + "metadata": {}, + "source": [ + "# Antartica InSync Data Cubes\n", + "\n", + "This notebook shows:\n", + "1. Antarctica InSync analysis-ready datacubes & forum thread\n", + "2. Interacive visualisation using [EODash](https://eodashboard.org/)\n", + "3. How to read the data using zarr\n", + "\n", + "\n", + "## 1. Antarctica InSync\n", + "\n", + "Antarctica InSync is a global effort to synchronise research across Antarctica and the Southern Ocean, connecting ice, ocean, climate, and life to protect this vital region. \n", + "\n", + "- [Website](https://www.antarctica-insync.org/)\n", + "\n", + "\n", + "As part of the initiative, and to facilitate easier analysis of and access to scientific Antarctica data, the the below datasets are combined into zarr stores, reprojected to a common 100x100m grid in the EPSG:3031 Polar projection.\n", + "\n", + "![datacube-composite-clean|581x500, 75%](https://discourse-earthcode.eox.at/uploads/default/optimized/1X/bf113a7210aac5404ee9c3af8113619154a171c8_2_870x750.jpeg)\n", + "\n", + "\n", + "## The Data\n", + "\n", + "The datasets we have processed are:\n", + "- Ice shelf Basal Melt\n", + " * Original Data Source: https://zenodo.org/records/8052519\n", + " * Reference: https://www.science.org/doi/10.1126/sciadv.adi0186\n", + "- Bed topography/bathymetry map of Antarctica\n", + " * Original Data Source: https://opensciencedata.esa.int/products/bedrock-topography-antarctica-bedmachine/collection\n", + " * Reference: https://nsidc.org/data/nsidc-0756/versions/3\n", + "- Calving Fronts\n", + " * Original Data Source: https://zenodo.org/records/5903643\n", + " * Reference: https://www.nature.com/articles/s41586-022-05037-w\n", + "\n", + "- Groundlines\n", + " * Original Data Source: https://cmr.earthdata.nasa.gov/virtual-directory/collections/C3291177478-NSIDC_CPRD\n", + " * Reference: https://nsidc.org/sites/default/files/nsidc-0498-v002-userguide_1.pdf\n", + " \n", + "- Ice Temperature Profiles\n", + " * Original Data Source: https://zenodo.org/records/8052519\n", + " * Reference: https://www.science.org/doi/10.1126/sciadv.adi0186 \n", + "- Ice velocity \n", + " * Original Data Source: https://opensciencedata.esa.int/products/ice-sheet-velocity-antarctic-2021/collection\n", + " * Reference: https://climate.esa.int/en/projects/ice-sheets-antarctic/\n", + "- Surface Elevation Change\n", + " * Original Data Source: https://opensciencedata.esa.int/products/ice-sheet-velocity-antarctic-2021/collection\n", + " * Reference: https://climate.esa.int/en/projects/ice-sheets-antarctic/\n", + "- Subglacial Lakes\n", + " * Original Data Source: https://zenodo.org/records/16330565\n", + " * Reference: https://www.nature.com/articles/s41467-025-63773-9\n", + "- Supraglacial Lakes\n", + " * Original Data Source: https://zenodo.org/record/5642755\n", + " * Reference: https://essd.copernicus.org/articles/14/209/2022/\n", + "\n", + "\n", + "### Visualization\n", + "\n", + "You can see an interactive visualisation of the data in eodash:\n", + "\n", + " - [EO-Dash link](https://esa-earthcode.github.io/polar-science-cluster-dashboard/)\n", + "\n", + "![datacube-overview](https://discourse-earthcode.eox.at/uploads/default/original/1X/e80a2df411057a5214f16a395e56c5c70b292049.gif)\n", + "\n", + "## Access \n", + "\n", + "More information is available in the forum thread: \n", + "\n", + "- [Forum thread](https://discourse-earthcode.eox.at/t/antartica-insync-data-cubes/107)\n", + "\n", + "These datasets are grouped based on their dimensions into several cubes:\n", + "- https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/antarctica-combined.zarr\n", + " * Bedrock topography\n", + " * Ice shelf Basal Melt\n", + " * Groundlines\n", + " * Subglacial Lakes\n", + " * Supraglacial Lakes\n", + "- https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/icetemp.zarr\n", + " * Ice Temperature Profiles\n", + "- https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/sec.zarr\n", + " * Surface Elevation Change\n", + " - https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/icemask_composite.zarr/ \n", + " * Calving Fronts\n", + " - https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/ice_velocity.zarr\n", + " * Ice Velocity 2020-2021\n", + " \n", + "\n", + "## 2. Reading the data using xarray and zarr\n", + "\n", + "Since the data is in zarr format you do NOT have to download any files to start your analysis. Learn more about zarr on the [Zarr webpage](https://zarr.readthedocs.io/en/) or to learn more about cloud-optimised formats visit [this documentation page.](https://esa-earthcode.github.io/documentation/Community%20and%20Best%20Practices/Data%20and%20Workflow%20Best%20Practices/Data/). \n", + "\n", + "You can read the data from an individual cube, by pointing any any zarr reader, e.g Python, to the zarr store url:\n", + "\n", + "```py\n", + "import xarray as xr\n", + "url = 'https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/antarctica-combined.zarr'\n", + "ds = xr.open_zarr(url)\n", + "ds\n", + "```\n", + "or combine the cubes with:\n", + "\n", + "```py\n", + "import xarray as xr\n", + "\n", + "cube_paths = [\n", + " \"https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/icetemp.zarr\",\n", + " \"https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/sec.zarr\",\n", + " \"https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/antarctica-combined.zarr\",\n", + " \"https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/icemask_composite.zarr/\",\n", + " \"https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/ice_velocity.zarr\"\n", + "]\n", + "\n", + "ds = xr.open_mfdataset(cube_paths, engine=\"zarr\",chunks={},compat='no_conflicts')\n", + "ds\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "afc943c9-bc23-48b0-8c78-ff7495533d44", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset> Size: 214GB\n",
+       "Dimensions:                       (y: 49158, x: 57358)\n",
+       "Coordinates:\n",
+       "    spatial_ref                   int64 8B ...\n",
+       "  * x                             (x) float32 229kB -2.868e+06 ... 2.868e+06\n",
+       "  * y                             (y) float32 197kB -2.458e+06 ... 2.458e+06\n",
+       "Data variables: (12/22)\n",
+       "    bedrock_topography_bed        (y, x) float32 11GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    bedrock_topography_dataid     (y, x) float32 11GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    bedrock_topography_errbed     (y, x) float32 11GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    bedrock_topography_firn       (y, x) float32 11GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    bedrock_topography_geoid      (y, x) float32 11GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    bedrock_topography_mask       (y, x) float32 11GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    ...                            ...\n",
+       "    groundlines_orbit3            (y, x) float32 11GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    groundlines_orbit4            (y, x) float32 11GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    groundlines_sensor            (y, x) uint8 3GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    ice_shelf_basal_melt_rate     (y, x) float32 11GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    subglacial_lakes_mask         (y, x) uint8 3GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>\n",
+       "    supra_glacial_lakes_mask      (y, x) uint8 3GB dask.array<chunksize=(4915, 5735), meta=np.ndarray>
" + ], + "text/plain": [ + " Size: 214GB\n", + "Dimensions: (y: 49158, x: 57358)\n", + "Coordinates:\n", + " spatial_ref int64 8B ...\n", + " * x (x) float32 229kB -2.868e+06 ... 2.868e+06\n", + " * y (y) float32 197kB -2.458e+06 ... 2.458e+06\n", + "Data variables: (12/22)\n", + " bedrock_topography_bed (y, x) float32 11GB dask.array\n", + " bedrock_topography_dataid (y, x) float32 11GB dask.array\n", + " bedrock_topography_errbed (y, x) float32 11GB dask.array\n", + " bedrock_topography_firn (y, x) float32 11GB dask.array\n", + " bedrock_topography_geoid (y, x) float32 11GB dask.array\n", + " bedrock_topography_mask (y, x) float32 11GB dask.array\n", + " ... ...\n", + " groundlines_orbit3 (y, x) float32 11GB dask.array\n", + " groundlines_orbit4 (y, x) float32 11GB dask.array\n", + " groundlines_sensor (y, x) uint8 3GB dask.array\n", + " ice_shelf_basal_melt_rate (y, x) float32 11GB dask.array\n", + " subglacial_lakes_mask (y, x) uint8 3GB dask.array\n", + " supra_glacial_lakes_mask (y, x) uint8 3GB dask.array" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import xarray as xr\n", + "url = 'https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/antarctica_cube/antarctica-combined.zarr'\n", + "ds = xr.open_zarr(url) # or xr.open_dataset\n", + "ds" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python [conda env:micromamba-pangeo] *", + "language": "python", + "name": "conda-env-micromamba-pangeo-py" + }, + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}