{ "cells": [ { "attachments": {}, "cell_type": "markdown", "id": "e64e134b", "metadata": {}, "source": [ "# Cube Visualization" ] }, { "attachments": {}, "cell_type": "markdown", "id": "8d213403", "metadata": {}, "source": [ "This tutorial shows how to visualize a cube:" ] }, { "cell_type": "code", "execution_count": 1, "id": "dcbbb720-a4bf-4803-9016-f6d5f9757076", "metadata": {}, "outputs": [], "source": [ "import cubo\n", "import xarray as xr" ] }, { "attachments": {}, "cell_type": "markdown", "id": "30a8650e", "metadata": {}, "source": [ "Create a cube with an edge size of 64 pixels from Sentinel-2 and apply a cloud coverage filter of 40 percent. Get just the RGB bands:" ] }, { "cell_type": "code", "execution_count": 2, "id": "749b9b6f-1fee-4de3-a811-556eb0398b1d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.DataArray 'sentinel-2-l2a' (time: 46, band: 3, y: 64, x: 64)>\n", "dask.array<fetch_raster_window, shape=(46, 3, 64, 64), dtype=float64, chunksize=(1, 1, 64, 64), chunktype=numpy.ndarray>\n", "Coordinates: (12/46)\n", " * time (time) datetime64[ns] 2020-01-01...\n", " id (time) <U54 'S2B_MSIL2A_20200101...\n", " * band (band) <U3 'B02' 'B03' 'B04'\n", " * x (x) float64 3.784e+05 ... 3.791e+05\n", " * y (y) float64 5.301e+06 ... 5.3e+06\n", " s2:cloud_shadow_percentage (time) float64 6.94 6.743 ... 6.516\n", " ... ...\n", " gsd float64 10.0\n", " proj:bbox object {300000.0, 409800.0, 5400...\n", " common_name (band) <U5 'blue' 'green' 'red'\n", " center_wavelength (band) float64 0.49 0.56 0.665\n", " full_width_half_max (band) float64 0.098 0.045 0.038\n", " epsg <U10 'EPSG:32633'\n", "Attributes:\n", " collection: sentinel-2-l2a\n", " stac: https://planetarycomputer.microsoft.com/api/stac/v1\n", " epsg: EPSG:32633\n", " resolution: 10\n", " edge_size: 64\n", " central_lat: 47.848151988493385\n", " central_lon: 13.379491178028564\n", " central_y: 5300694.38448788\n", " central_x: 378764.6058600877\n", " time_coverage_start: 2020-01-01\n", " time_coverage_end: 2021-01-01