From 9b0ffd4564c9685922645df095fefca2da4fd8b4 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Wed, 26 Jun 2024 10:28:07 +0200 Subject: [PATCH 1/2] demonstrate opening with `xarray` --- search-catalog.ipynb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/search-catalog.ipynb b/search-catalog.ipynb index ef87ef5..80a5ceb 100644 --- a/search-catalog.ipynb +++ b/search-catalog.ipynb @@ -137,6 +137,32 @@ "id": "8", "metadata": {}, "outputs": [], + "source": [ + "import xarray as xr\n", + "import fsspec" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9", + "metadata": {}, + "outputs": [], + "source": [ + "fs = fsspec.filesystem(\"http\")\n", + "dss = [\n", + " xr.open_dataset(fs.open(item.assets[\"https\"].href), engine=\"h5netcdf\").load()\n", + " for item in filtered\n", + "]\n", + "dss" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "10", + "metadata": {}, + "outputs": [], "source": [] } ], From c9f59643d3e12ad289ae300b0ddb110a499348c6 Mon Sep 17 00:00:00 2001 From: Tina Odaka <46813815+tinaok@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:02:20 +0000 Subject: [PATCH 2/2] add pip install --- search-catalog.ipynb | 46 +++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/search-catalog.ipynb b/search-catalog.ipynb index 80a5ceb..243f418 100644 --- a/search-catalog.ipynb +++ b/search-catalog.ipynb @@ -1,5 +1,27 @@ { "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "5d069a14-fc25-4026-a342-ba986ca3e420", + "metadata": { + "scrolled": true + }, + "outputs": [], + "source": [ + "!pip install -e ." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4caeea78-6741-4360-b18e-f3239c85975b", + "metadata": {}, + "outputs": [], + "source": [ + "!pip install rich" + ] + }, { "cell_type": "code", "execution_count": null, @@ -109,7 +131,9 @@ "cell_type": "code", "execution_count": null, "id": "6", - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [], "source": [ "console.print(filtered[0].to_dict())" @@ -146,7 +170,9 @@ "cell_type": "code", "execution_count": null, "id": "9", - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [], "source": [ "fs = fsspec.filesystem(\"http\")\n", @@ -156,17 +182,14 @@ "]\n", "dss" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "10", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, "language_info": { "codemirror_mode": { "name": "ipython", @@ -176,7 +199,8 @@ "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython3" + "pygments_lexer": "ipython3", + "version": "3.11.7" } }, "nbformat": 4,