diff --git a/drafts/stackstac-ncdf.ipynb b/drafts/stackstac-ncdf.ipynb new file mode 100644 index 0000000..232023c --- /dev/null +++ b/drafts/stackstac-ncdf.ipynb @@ -0,0 +1,839 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 6, + "id": "9e2c81a0-5602-40be-ba03-42675ce42c1f", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import stackstac\n", + "from pystac_client import Client\n", + "from stackstac.rio_env import LayeredEnv\n", + "\n", + "# ensure we have an earthdata .netrc set, and also need cookie file:\n", + "import os\n", + "from pathlib import Path\n", + "cookies = os.path.expanduser(\"~/.urs_cookies\")\n", + "Path(cookies).touch()" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "cb21b345-bc6e-4819-9149-9a233f548081", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/jovyan/.virtualenvs/spatial/lib/python3.10/site-packages/stackstac/prepare.py:408: 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 'stackstac-3893b89144636d9866bc23c4325591b8' (time: 1,\n", + " band: 1,\n", + " y: 18000,\n", + " x: 36000)>\n", + "dask.array<fetch_raster_window, shape=(1, 1, 18000, 36000), dtype=float64, chunksize=(1, 1, 1024, 1024), chunktype=numpy.ndarray>\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 2019-12-31T21:00:00\n", + " id (time) <U57 '20200101090000-JPL-L4_GHRSST-SSTfnd-MUR-GLOB...\n", + " * band (band) <U4 'data'\n", + " * x (x) float64 -180.0 -180.0 -180.0 ... 180.0 180.0 180.0\n", + " * y (y) float64 90.0 89.99 89.98 89.97 ... -89.97 -89.98 -89.99\n", + " start_datetime <U24 '2019-12-31T21:00:00.000Z'\n", + " end_datetime <U24 '2020-01-01T21:00:00.000Z'\n", + " title <U69 'Download 20200101090000-JPL-L4_GHRSST-SSTfnd-MUR-GL...\n", + " epsg int64 4326\n", + "Attributes:\n", + " spec: RasterSpec(epsg=4326, bounds=(-180.0, -90.0, 180.0, 90.0), r...\n", + " crs: epsg:4326\n", + " transform: | 0.01, 0.00,-180.00|\\n| 0.00,-0.01, 90.00|\\n| 0.00, 0.00, 1...\n", + " resolution: 0.01