{ "cells": [ { "cell_type": "markdown", "id": "0", "metadata": {}, "source": [ "# Getting Started\n", "The Chalmers Hydrometor Inversion Product from the Arctic Weather Satellite (CHIP-AWS) provides global atmospheric ice mass estimates derived from passive microwave measurements. Data are available as NetCDF files over http. These can be downloaded or acessed directly.\n", "The following examples show how to access started using them with `python` and `xarray`." ] }, { "cell_type": "code", "execution_count": 1, "id": "1", "metadata": { "execution": { "iopub.execute_input": "2026-01-08T23:23:24.432446Z", "iopub.status.busy": "2026-01-08T23:23:24.432219Z", "iopub.status.idle": "2026-01-08T23:23:25.103612Z", "shell.execute_reply": "2026-01-08T23:23:25.103087Z" } }, "outputs": [], "source": [ "from datetime import datetime\n", "import requests\n", "import xarray as xr\n", "\n", "def file_urls_for_timeranges(timeranges: list[slice]) -> list[str]:\n", " \"\"\"\n", " Helper function to get a list of level2 urls for the requested timeranges\n", " \"\"\"\n", " base_url = \"http://data.clouds-and-precip.group/chip-aws/chip-aws-v0.6/level2\"\n", " index = requests.get(f\"{base_url}/index.json\").json()\n", " urls = [\n", " f\"{base_url}/{item['filepath']}#mode=bytes\"\n", " for item in index['items']\n", " for timerange in timeranges\n", " if datetime.fromisoformat(item['datetime_end']) >= datetime.fromisoformat(timerange.start.replace(\"Z\", \"+00:00\"))\n", " and datetime.fromisoformat(item['datetime_start']) <= datetime.fromisoformat(timerange.stop.replace(\"Z\", \"+00:00\"))\n", " ]\n", " return sorted(set(urls))" ] }, { "cell_type": "code", "execution_count": 3, "id": "2", "metadata": { "execution": { "iopub.execute_input": "2026-01-08T23:23:25.110494Z", "iopub.status.busy": "2026-01-08T23:23:25.110157Z", "iopub.status.idle": "2026-01-08T23:23:25.808834Z", "shell.execute_reply": "2026-01-08T23:23:25.808388Z" } }, "outputs": [], "source": [ "# List some interesting scenes\n", "timeranges = [\n", " slice('2025-05-01T07:18:00', '2025-05-01T07:28:00'),\n", " slice('2025-05-01T11:19:00', '2025-05-01T11:28:00'),\n", " slice('2025-05-01T11:46:00', '2025-05-01T11:55:00'),\n", "]\n", "\n", "# Open the files as a single xarray dataset\n", "ds = xr.open_mfdataset(\n", " file_urls_for_timeranges(timeranges),\n", " combine=\"nested\",\n", " concat_dim=\"scan\",\n", " data_vars=\"minimal\",\n", " coords=\"minimal\",\n", " compat=\"override\",\n", ")\n", "\n", "# Each file is generated from a single source level 1 file for self-contained processing.\n", "# Consecutive source files have short overlaps. To remove duplicate data, \n", "# we remove overlapping scans by keeping only the last occurrence of each duplicate.\n", "# Sorting ensures scans are in chronological order, allowing selection by time slices.\n", "ds = ds.sel(scan=~ds.get_index('scan').duplicated(keep='last'))\n", "ds = ds.sortby('scan')" ] }, { "cell_type": "markdown", "id": "6af00b14", "metadata": {}, "source": [ "When working with a large number of files, the overhead from parsing file metadata over HTTP using `open_mfdataset` can become significant.\n", "For such uses, consider downloading locally first:\n", "```bash\n", "wget --recursive --no-parent --no-host-directories http://data.clouds-and-precip.group/chip-aws/chip-aws-v0.6/level2/2025/05/\n", "```" ] }, { "cell_type": "markdown", "id": "6a9f6679", "metadata": {}, "source": [ "# Dataset structure\n", "The main variables are given in the along-track `scan` dimension and the across-track `fov` (field-of-view) dimension.\n", "The structure of the data is shown below:" ] }, { "cell_type": "code", "execution_count": 4, "id": "ed68302d", "metadata": { "execution": { "iopub.execute_input": "2026-01-08T23:23:25.810836Z", "iopub.status.busy": "2026-01-08T23:23:25.810547Z", "iopub.status.idle": "2026-01-08T23:23:25.842319Z", "shell.execute_reply": "2026-01-08T23:23:25.841896Z" } }, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset> Size: 100MB\n",
"Dimensions: (scan: 6721, fov: 88, quantile: 5, surface_type: 6,\n",
" channel: 11)\n",
"Coordinates:\n",
" * scan (scan) datetime64[ns] 54kB 2025-05-01T06:05:36.77...\n",
" * quantile (quantile) float32 20B 0.02 0.16 0.5 0.84 0.98\n",
" * surface_type (surface_type) <U7 168B 'ocean' ... 'glacier'\n",
" * channel (channel) <U5 220B 'AWS21' 'AWS31' ... 'AWS44'\n",
" latitude (scan, fov) float32 2MB dask.array<chunksize=(3450, 88), meta=np.ndarray>\n",
" longitude (scan, fov) float32 2MB dask.array<chunksize=(3450, 88), meta=np.ndarray>\n",
"Dimensions without coordinates: fov\n",
"Data variables: (12/16)\n",
" fwp_mean (scan, fov) float32 2MB dask.array<chunksize=(3450, 88), meta=np.ndarray>\n",
" fwp_most_prob (scan, fov) float32 2MB dask.array<chunksize=(3450, 88), meta=np.ndarray>\n",
" fwp_quantiles (scan, fov, quantile) float32 12MB dask.array<chunksize=(3450, 88, 5), meta=np.ndarray>\n",
" fwp_dm_mean (scan, fov) float32 2MB dask.array<chunksize=(3450, 88), meta=np.ndarray>\n",
" fwp_dm_most_prob (scan, fov) float32 2MB dask.array<chunksize=(3450, 88), meta=np.ndarray>\n",
" fwp_dm_quantiles (scan, fov, quantile) float32 12MB dask.array<chunksize=(3450, 88, 5), meta=np.ndarray>\n",
" ... ...\n",
" surface_type_fractions (scan, fov, surface_type) float32 14MB dask.array<chunksize=(3450, 88, 6), meta=np.ndarray>\n",
" tb (scan, fov, channel) float32 26MB dask.array<chunksize=(3450, 88, 11), meta=np.ndarray>\n",
" l1b_index_scans (scan) uint32 27kB dask.array<chunksize=(3450,), meta=np.ndarray>\n",
" l1b_index_fovs (fov) uint32 352B dask.array<chunksize=(88,), meta=np.ndarray>\n",
" flag_bad_data (scan, fov) uint8 591kB dask.array<chunksize=(3450, 88), meta=np.ndarray>\n",
" fwp_ccic (scan, fov) float32 2MB dask.array<chunksize=(3450, 88), meta=np.ndarray>\n",
"Attributes:\n",
" title: CHIP-AWS: Chalmers Hydrometeor Inversion Product from t...\n",
" institution: Chalmers University of Technology\n",
" references: https://clouds-and-precip.group/datasets/chip-aws/\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",
" source: chip-aws-v0.6.2