{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "(stereographic-subsetting-page)=\n", "# Subsetting ARCO Data with Original-grid" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The \"plate carrée\" projection (equirectangular projection centered on the Equator) is widely used. It uses simply x=longitude and y=latitude on a map. However, for regions near the poles - such as the Arctic and Antarctic - alternative coordinate systems, including the stereographic projection, are often employed. The specific projection applied to each dataset is detailed in the respective product documentation, available through the [Copernicus Marine Data Store](https://data.marine.copernicus.eu/products) (**e.g.** [this product description](https://data.marine.copernicus.eu/product/ARCTIC_ANALYSISFORECAST_PHY_002_001/description)).\n", "\n", "Maintaining data in the Original-grid format, rather than only providing longitude and latitude coordinates, offers significant benefits:\n", "- It preserves the dataset's original structure and integrity\n", "- It facilitates direct use of the Original-grid coordinates for relevant applications\n", "\n", "We present in this notebook how to subset those data using the Copernicus Marine Toolbox." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Original-grid Coordinate System" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Different Coordinate Systems Have Different Bounding Options" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Most datasets use a longitude/latitude projection system. For area subsetting, the standard parameters are `minimum_longitude`, `maximum_longitude`, `minimum_latitude` and `maximum_latitude`.\n", "\n", "When working with the Original-grid coordinate system, the subsetting parameters differ:\n", "- For the x-axis: `minimum_x` (or `--minimum-x`) and `maximum_x` (or `--maximum-x`).\n", "- For the y-axis: `minimum_y` (or `--minimum-y`) and `maximum_y` (or `--maximum-y`). \n", "\n", "These parameters enable subsetting operations based on the Original-grid projection coordinates." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Different Coordinate Systems Belong to Different Parts" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For a given dataset and version, the data in stereographic projection is in a different part.\n", "\n", "Consequently, when downloading data in their Original-grid, you must explicitly specify the dataset part:\n", "\n", "- Command-line interface: Use ``--dataset-part originalGrid``\n", "- Python interface: Specify ``dataset_part=\"originalGrid\"``\n", "\n", "If missing, the toolbox will automatically return the default geographical coordinate system, in (longitude, latitude) projection." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Python Interface and Plot Comparison" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To demonstrate the data retrieval process, we provide an example comparing plots of similar regions using the toolbox. We first illustrate how to download datasets in geographical coordinates, followed by the Original-grid projection method." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### With Longitude/Latitude\n", "This established toolbox option retrieves an Arctic region as follows:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO - 2025-03-20T09:02:26Z - Selected dataset version: \"202105\"\n", "INFO - 2025-03-20T09:02:26Z - Selected dataset part: \"default\"\n" ] }, { "data": { "text/html": [ "
<xarray.Dataset>\n", "Dimensions: (time: 5844, depth: 1, latitude: 101, longitude: 1440)\n", "Coordinates:\n", " * depth (depth) float32 3.0\n", " * latitude (latitude) float64 65.0 65.25 65.5 65.75 ... 89.5 89.75 90.0\n", " * longitude (longitude) float64 -180.0 -179.8 -179.5 ... 179.2 179.5 179.8\n", " * time (time) datetime64[ns] 2007-01-01 2007-01-02 ... 2022-12-31\n", "Data variables:\n", " chl (time, depth, latitude, longitude) float32 dask.array<chunksize=(3066, 1, 10, 1440), meta=np.ndarray>\n", " zooc (time, depth, latitude, longitude) float32 dask.array<chunksize=(3066, 1, 10, 1440), meta=np.ndarray>\n", " o2 (time, depth, latitude, longitude) float32 dask.array<chunksize=(3066, 1, 10, 1440), meta=np.ndarray>\n", "Attributes:\n", " source: NERSC-HYCOM model fields\n", " references: http://topaz.nersc.no\n", " institution: NERSC, Jahnebakken 3, 5006 Bergen, Norway\n", " title: Arctic Ocean Biogeochemistry Reanalysis, 25km surface daily...\n", " Conventions: CF-1.4\n", " history: Created by program hyc2proj, version V0.3
<xarray.Dataset> Size: 3GB\n", "Dimensions: (time: 5844, depth: 1, y: 161, x: 161)\n", "Coordinates:\n", " * depth (depth) float32 4B 3.0\n", " latitude (y, x) float32 104kB dask.array<chunksize=(84, 64), meta=np.ndarray>\n", " longitude (y, x) float32 104kB dask.array<chunksize=(84, 64), meta=np.ndarray>\n", " * time (time) datetime64[ns] 47kB 2007-01-01 2007-01-02 ... 2022-12-31\n", " * x (x) float32 644B -20.0 -19.75 -19.5 -19.25 ... 19.5 19.75 20.0\n", " * y (y) float32 644B -20.0 -19.75 -19.5 -19.25 ... 19.5 19.75 20.0\n", "Data variables:\n", " chl (time, depth, y, x) float64 1GB dask.array<chunksize=(5844, 1, 84, 64), meta=np.ndarray>\n", " zooc (time, depth, y, x) float64 1GB dask.array<chunksize=(5844, 1, 84, 64), meta=np.ndarray>\n", " o2 (time, depth, y, x) float32 606MB dask.array<chunksize=(5844, 1, 84, 64), meta=np.ndarray>\n", "Attributes:\n", " references: http://topaz.nersc.no\n", " source: NERSC-HYCOM model fields\n", " institution: NERSC, Jahnebakken 3, 5006 Bergen, Norway\n", " title: Arctic Ocean Biogeochemistry Reanalysis, 25km surface daily...\n", " Conventions: CF-1.4\n", " history: Created by program hyc2proj, version V0.3