{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Getting Started" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "This tutorial shows some examples of how to use `sen2nbar`. We start with the simplest: computing NBAR directly for `cubo`:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import cubo\n", "from sen2nbar.nbar import nbar_cubo" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Create a mini cube with an edge size of 32 pixels and a resolution of 10 m from the Sentinel-2 L2A Collection of Planetary Computer given a pair of coordinates and start and end dates using just the RGB bands:" ] }, { "cell_type": "code", "execution_count": 2, "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:datastrip_id (time) <U64 'S2B_OPER_MSI_L2A_DS...\n",
" ... ...\n",
" proj:transform object {0.0, 300000.0, 5400000.0...\n",
" proj:shape object {10980}\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