{ "cells": [ { "cell_type": "markdown", "id": "title", "metadata": {}, "source": [ "# `HealPixDecomp`: local multiscale decomposition\n", "\n", "This notebook validates the exactly reconstructing Laplacian pyramid on an irregular NESTED HEALPix domain. The artificial mask mimics an ocean/land coastline. The test covers `Jmax=-1`, native-resolution metadata, exact inversion, explicit fine-grid summation, NumPy interoperability, and Torch autograd.\n", "\n", "`u` and `v` are decomposed as independent channels. The `HealPixMultiScaleDivCurl` operator can now apply scale-dependent, gauge-aware derivative convolutions to these bands." ] }, { "cell_type": "code", "execution_count": 1, "id": "imports", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "device: cuda\n" ] } ], "source": [ "import time\n", "\n", "import healpix_geo\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import torch\n", "\n", "from healpix_analyse import HealPixDecomp\n", "\n", "torch.manual_seed(7)\n", "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n", "print(\"device:\", device)" ] }, { "cell_type": "markdown", "id": "42ea7a28-8f82-4348-b87c-1386379ef4b2", "metadata": {}, "source": [ "# get DATA" ] }, { "cell_type": "code", "execution_count": 2, "id": "c2e22f01-38c1-4007-951a-8605f935c086", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset> Size: 90MB\n",
"Dimensions: (time: 24, depth: 8, latitude: 180, longitude: 324)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 192B 2025-03-20 ... 2025-03-20T23:00:00\n",
" * depth (depth) float32 32B 0.494 1.541 2.646 3.819 ... 6.441 7.93 9.573\n",
" * latitude (latitude) float32 720B 46.03 46.05 46.08 ... 50.94 50.97 51.0\n",
" * longitude (longitude) float32 1kB -7.999 -7.971 -7.944 ... 0.9456 0.9733\n",
"Data variables:\n",
" thetao (time, depth, latitude, longitude) float64 90MB dask.array<chunksize=(1, 1, 180, 324), meta=np.ndarray>\n",
"Attributes:\n",
" Conventions: CF-1.8\n",
" comment: \n",
" contact: https://marine.copernicus.eu/contact\n",
" institution: NOW Systems (Spain)\n",
" references: http://marine.copernicus.eu/\n",
" source: NEMO3.6\n",
" title: Ocean 3D hourly mean fields for the Iberia-Biscay-Ireland (...