Skip to content

Commit bc66cfb

Browse files
committed
o Add healpix bilinear remapping
1 parent ddbf9a9 commit bc66cfb

1 file changed

Lines changed: 45 additions & 11 deletions

File tree

docs/user-guide/remapping.ipynb

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,40 @@
692692
")"
693693
]
694694
},
695+
{
696+
"cell_type": "markdown",
697+
"id": "9ae38e84",
698+
"metadata": {},
699+
"source": [
700+
"#### Also do a coarse HealPix grid and downsampling with it"
701+
]
702+
},
703+
{
704+
"cell_type": "code",
705+
"execution_count": null,
706+
"id": "ec76a7fc-a5ec-412e-841a-ab8abeceb2ab",
707+
"metadata": {},
708+
"outputs": [],
709+
"source": [
710+
"hp_grid = ux.Grid.from_healpix(zoom=2, pixels_only=False)"
711+
]
712+
},
713+
{
714+
"cell_type": "code",
715+
"execution_count": null,
716+
"id": "e0c96087",
717+
"metadata": {},
718+
"outputs": [],
719+
"source": [
720+
"downsampling_hp_grid = uxds_120[\"bottomDepth\"].remap.bilinear(\n",
721+
" hp_grid, remap_to=\"face centers\"\n",
722+
")"
723+
]
724+
},
695725
{
696726
"cell_type": "code",
697727
"execution_count": null,
698-
"id": "8449c7f4-3fd8-4042-89f7-bc72e38e5fdd",
728+
"id": "051bd247",
699729
"metadata": {},
700730
"outputs": [],
701731
"source": [
@@ -709,6 +739,11 @@
709739
" cmap=ux.cmaps.sequential_blue,\n",
710740
" )\n",
711741
" * features\n",
742+
" + downsampling_hp_grid.plot(\n",
743+
" title=\"Remapped Bottom Depth (120km to Healpix)\",\n",
744+
" cmap=ux.cmaps.sequential_blue,\n",
745+
" )\n",
746+
" * features\n",
712747
" + uxds_120[\"bottomDepth\"].plot(\n",
713748
" title=\"Zoomed (120km)\",\n",
714749
" xlim=(-10, 10),\n",
@@ -723,21 +758,20 @@
723758
" cmap=ux.cmaps.sequential_blue,\n",
724759
" )\n",
725760
" * features\n",
761+
" + downsampling_hp_grid.plot(\n",
762+
" title=\"Zoomed Remap (120km to Healpix)\",\n",
763+
" xlim=(-10, 10),\n",
764+
" ylim=(-5, 5),\n",
765+
" cmap=ux.cmaps.sequential_blue, \n",
766+
" )\n",
767+
" * features\n",
726768
").opts(fig_size=300).cols(1)"
727769
]
728-
},
729-
{
730-
"cell_type": "code",
731-
"execution_count": null,
732-
"id": "ec76a7fc-a5ec-412e-841a-ab8abeceb2ab",
733-
"metadata": {},
734-
"outputs": [],
735-
"source": []
736770
}
737771
],
738772
"metadata": {
739773
"kernelspec": {
740-
"display_name": "Python 3 (ipykernel)",
774+
"display_name": "esmf_env",
741775
"language": "python",
742776
"name": "python3"
743777
},
@@ -751,7 +785,7 @@
751785
"name": "python",
752786
"nbconvert_exporter": "python",
753787
"pygments_lexer": "ipython3",
754-
"version": "3.12.8"
788+
"version": "3.11.11"
755789
}
756790
},
757791
"nbformat": 4,

0 commit comments

Comments
 (0)