{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Add `stackstac` keyword arguments" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this tutorial we will learn how to pass `stackstac` arguments to `cubo`." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import cubo" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The following chunk doesn's pass any argument to `stackstac`, creating the cube using the default values:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/dmontero/anaconda3/envs/cubo/lib/python3.9/site-packages/stackstac/prepare.py:364: UserWarning: The argument 'infer_datetime_format' is deprecated and will be removed in a future version. A strict version of it is now the default, see https://pandas.pydata.org/pdeps/0004-consistent-to-datetime-parsing.html. You can safely remove this argument.\n", " times = pd.to_datetime(\n" ] }, { "data": { "text/html": [ "
<xarray.DataArray 'sentinel-2-l2a' (time: 2, band: 3, y: 64, x: 64)>\n", "dask.array<fetch_raster_window, shape=(2, 3, 64, 64), dtype=float64, chunksize=(1, 1, 64, 64), chunktype=numpy.ndarray>\n", "Coordinates: (12/47)\n", " * time (time) datetime64[ns] 2021-06-13...\n", " id (time) <U54 'S2B_MSIL2A_20210613...\n", " * band (band) <U3 'B02' 'B03' 'B04'\n", " * x (x) float64 6.011e+05 ... 6.023e+05\n", " * y (y) float64 5.66e+06 ... 5.659e+06\n", " sat:orbit_state <U10 'descending'\n", " ... ...\n", " title (band) <U20 'Band 2 - Blue - 10m...\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 int64 32632\n", " cubo:distance_from_center (y, x) float64 908.2 ... 873.7\n", "Attributes:\n", " collection: sentinel-2-l2a\n", " stac: https://planetarycomputer.microsoft.com/api/stac/v1\n", " epsg: 32632\n", " resolution: 20\n", " edge_size: 64\n", " central_lat: 51.079225\n", " central_lon: 10.452173\n", " central_y: 5659638.0946523\n", " central_x: 601722.4825156148\n", " time_coverage_start: 2021-06-01\n", " time_coverage_end: 2021-07-01
<xarray.DataArray 'sentinel-2-l2a' (time: 2, band: 3, y: 64, x: 64)>\n", "dask.array<fetch_raster_window, shape=(2, 3, 64, 64), dtype=float64, chunksize=(1, 1, 64, 64), chunktype=numpy.ndarray>\n", "Coordinates: (12/47)\n", " * time (time) datetime64[ns] 2021-06-13...\n", " id (time) <U54 'S2B_MSIL2A_20210613...\n", " * band (band) <U3 'B02' 'B03' 'B04'\n", " * x (x) float64 6.011e+05 ... 6.024e+05\n", " * y (y) float64 5.66e+06 ... 5.659e+06\n", " sat:orbit_state <U10 'descending'\n", " ... ...\n", " title (band) <U20 'Band 2 - Blue - 10m...\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 int64 32632\n", " cubo:distance_from_center (y, x) float64 894.1 ... 887.9\n", "Attributes:\n", " collection: sentinel-2-l2a\n", " stac: https://planetarycomputer.microsoft.com/api/stac/v1\n", " epsg: 32632\n", " resolution: 20\n", " edge_size: 64\n", " central_lat: 51.079225\n", " central_lon: 10.452173\n", " central_y: 5659638.0946523\n", " central_x: 601722.4825156148\n", " time_coverage_start: 2021-06-01\n", " time_coverage_end: 2021-07-01