{ "cells": [ { "cell_type": "markdown", "id": "ee0441c8", "metadata": {}, "source": [ "# Getting Started\n", "The Chalmers Atmospheric Water Dataset from the Arctic Weather Satellite (AWS), provides global atmospheric ice mass estimates derived from passive microwave measurements.\n", "The data are available as NetCDF files, the following examples will show how to get started using them with python and `xarray`." ] }, { "cell_type": "code", "execution_count": null, "id": "90be1304", "metadata": {}, "outputs": [], "source": [ "from datetime import datetime\n", "import requests\n", "import xarray as xr\n", "\n", "# Helper function to get file urls for given timeranges\n", "def file_urls_for_timeranges(timeranges: list[slice]) -> list[str]:\n", " \"\"\"\n", " Get a list of level2 urls for the requested timerange\n", " \"\"\"\n", " base_url = \"https://storage.googleapis.com/petermfiles/cawd-aws-v0.0.1-example/level2\"\n", " index = requests.get(f\"{base_url}/index.json\").json()\n", " urls = []\n", " for timerange in timeranges:\n", " tr_slice = slice(\n", " datetime.fromisoformat(timerange.start.replace(\"Z\", \"+00:00\")),\n", " datetime.fromisoformat(timerange.stop.replace(\"Z\", \"+00:00\"))\n", " )\n", " urls.extend([\n", " f\"{base_url}/{item['filepath']}#mode=bytes\"\n", " for item in index['items']\n", " if (datetime.fromisoformat(item['datetime_end']) >= tr_slice.start)\n", " and (datetime.fromisoformat(item['datetime_start']) <= tr_slice.stop)\n", " ])\n", " return sorted(set(urls))" ] }, { "cell_type": "code", "execution_count": 2, "id": "515150c0", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset> Size: 117MB\n", "Dimensions: (time: 6727, fov: 88, quantile: 5, surface_type: 6,\n", " channel: 11)\n", "Coordinates:\n", " * time (time) datetime64[ns] 54kB 2025-05-01T06:05:41.53...\n", " * surface_type (surface_type) <U7 168B 'ocean' ... 'glacier'\n", " latitude (time, fov) float64 5MB dask.array<chunksize=(3364, 88), meta=np.ndarray>\n", " longitude (time, fov) float64 5MB dask.array<chunksize=(3364, 88), meta=np.ndarray>\n", " * quantile (quantile) float32 20B 0.01 0.1325 0.5 0.8675 0.99\n", " * channel (channel) <U5 220B 'AWS21' 'AWS31' ... 'AWS44'\n", "Dimensions without coordinates: fov\n", "Data variables: (12/21)\n", " fwp_mean (time, fov) float32 2MB dask.array<chunksize=(3364, 88), meta=np.ndarray>\n", " fwp_most_prob (time, fov) float32 2MB dask.array<chunksize=(3364, 88), meta=np.ndarray>\n", " fwp_quantiles (time, fov, quantile) float32 12MB dask.array<chunksize=(3364, 88, 5), meta=np.ndarray>\n", " fwp_dm_mean (time, fov) float32 2MB dask.array<chunksize=(3364, 88), meta=np.ndarray>\n", " fwp_dm_most_prob (time, fov) float32 2MB dask.array<chunksize=(3364, 88), meta=np.ndarray>\n", " fwp_dm_quantiles (time, fov, quantile) float32 12MB dask.array<chunksize=(3364, 88, 5), meta=np.ndarray>\n", " ... ...\n", " sim_db_all_ta_distance (time, fov) float32 2MB dask.array<chunksize=(3364, 88), meta=np.ndarray>\n", " l1b_index_scans (time) uint32 27kB dask.array<chunksize=(3364,), meta=np.ndarray>\n", " l1b_index_fovs (time, fov) uint32 2MB dask.array<chunksize=(3364, 88), meta=np.ndarray>\n", " flag_bad_data (time, fov) uint8 592kB dask.array<chunksize=(3364, 88), meta=np.ndarray>\n", " flag_overlap (time) bool 7kB dask.array<chunksize=(3364,), meta=np.ndarray>\n", " fwp_ccic (time, fov) float32 2MB dask.array<chunksize=(3364, 88), meta=np.ndarray>\n", "Attributes:\n", " title: Chalmers Atmospheric Water Dataset from the Arctic Weat...\n", " institution: Chalmers University of Technology\n", " history: Retrieval processing\n", " source_file: W_NO-KSAT-Tromso,SAT,AWS1-MWR-1B-RAD_C_OHB__20250501074...\n", " source_file_md5: d569c33690327feb2f3b925f3172a208\n", " cache_version: 2b17ed68cfda73625dc987e758a4cd6e9f844d42