{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "9be54ce5-e0ec-45af-9042-7fcedc3df06b", "metadata": {}, "outputs": [], "source": [ "import s3fs\n", "import xarray as xr" ] }, { "cell_type": "code", "execution_count": 2, "id": "a512d720-3ee9-4204-bdba-d5ec6461f152", "metadata": {}, "outputs": [], "source": [ "#fs = s3fs.S3FileSystem(anon=True)\n", "#aws_url = 'https://rgw.met.no/6c6a817bd3bb47588bcc9e1221cb52b5:escience2022/Ada/conc/1979/01/ice_conc_sh_ease2-250_cdr-v2p0_197901301200.nc'" ] }, { "cell_type": "code", "execution_count": 3, "id": "9385ad6b-394f-45c8-9156-5d8f1b98956a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "('temp.nc', )" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import urllib\n", "new_x = \"temp.nc\"\n", "x = 'https://rgw.met.no/6c6a817bd3bb47588bcc9e1221cb52b5:escience2022/Ada/conc/1979/01/ice_conc_sh_ease2-250_cdr-v2p0_197901301200.nc'\n", "urllib.request.urlretrieve(x, new_x)" ] }, { "cell_type": "code", "execution_count": 4, "id": "e2b490ed-a53a-41c8-8ec8-6d016247cc9a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
<xarray.Dataset>\n",
       "Dimensions:                   (time: 1, nv: 2, xc: 432, yc: 432)\n",
       "Coordinates:\n",
       "  * time                      (time) datetime64[ns] 1979-01-30T12:00:00\n",
       "  * xc                        (xc) float64 -5.388e+03 -5.362e+03 ... 5.388e+03\n",
       "  * yc                        (yc) float64 5.388e+03 5.362e+03 ... -5.388e+03\n",
       "    lat                       (yc, xc) float32 ...\n",
       "    lon                       (yc, xc) float32 ...\n",
       "Dimensions without coordinates: nv\n",
       "Data variables:\n",
       "    Lambert_Azimuthal_Grid    int32 -2147483647\n",
       "    time_bnds                 (time, nv) datetime64[ns] 1979-01-30 1979-01-31\n",
       "    ice_conc                  (time, yc, xc) float64 ...\n",
       "    raw_ice_conc_values       (time, yc, xc) float64 ...\n",
       "    total_standard_error      (time, yc, xc) float64 ...\n",
       "    smearing_standard_error   (time, yc, xc) float64 ...\n",
       "    algorithm_standard_error  (time, yc, xc) float64 ...\n",
       "    status_flag               (time, yc, xc) float32 ...\n",
       "Attributes: (12/40)\n",
       "    title:                     Sea Ice Concentration Climate Data Record from...\n",
       "    summary:                   This climate data record of sea ice concentrat...\n",
       "    topiccategory:             Oceans ClimatologyMeteorologyAtmosphere\n",
       "    keywords:                  Earth Science > Cryosphere > Sea Ice > Sea Ice...\n",
       "    keywords_vocabulary:       GCMD Science Keywords\n",
       "    geospatial_lat_min:        -90.0\n",
       "    ...                        ...\n",
       "    Conventions:               CF-1.6 ACDD-1.3\n",
       "    standard_name_vocabulary:  CF Standard Name Table (v36, 21 September 2016)\n",
       "    id:                        10.15770/EUM_SAF_OSI_0008\n",
       "    product_version:           2.0\n",
       "    history:                   2017-02-14T19:39:25Z creation\\n2022-06-07: Cor...\n",
       "    geospatial_bounds_crs:     EPSG:6932
" ], "text/plain": [ "\n", "Dimensions: (time: 1, nv: 2, xc: 432, yc: 432)\n", "Coordinates:\n", " * time (time) datetime64[ns] 1979-01-30T12:00:00\n", " * xc (xc) float64 -5.388e+03 -5.362e+03 ... 5.388e+03\n", " * yc (yc) float64 5.388e+03 5.362e+03 ... -5.388e+03\n", " lat (yc, xc) float32 ...\n", " lon (yc, xc) float32 ...\n", "Dimensions without coordinates: nv\n", "Data variables:\n", " Lambert_Azimuthal_Grid int32 ...\n", " time_bnds (time, nv) datetime64[ns] ...\n", " ice_conc (time, yc, xc) float64 ...\n", " raw_ice_conc_values (time, yc, xc) float64 ...\n", " total_standard_error (time, yc, xc) float64 ...\n", " smearing_standard_error (time, yc, xc) float64 ...\n", " algorithm_standard_error (time, yc, xc) float64 ...\n", " status_flag (time, yc, xc) float32 ...\n", "Attributes: (12/40)\n", " title: Sea Ice Concentration Climate Data Record from...\n", " summary: This climate data record of sea ice concentrat...\n", " topiccategory: Oceans ClimatologyMeteorologyAtmosphere\n", " keywords: Earth Science > Cryosphere > Sea Ice > Sea Ice...\n", " keywords_vocabulary: GCMD Science Keywords\n", " geospatial_lat_min: -90.0\n", " ... ...\n", " Conventions: CF-1.6 ACDD-1.3\n", " standard_name_vocabulary: CF Standard Name Table (v36, 21 September 2016)\n", " id: 10.15770/EUM_SAF_OSI_0008\n", " product_version: 2.0\n", " history: 2017-02-14T19:39:25Z creation\\n2022-06-07: Cor...\n", " geospatial_bounds_crs: EPSG:6932" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "esacci = xr.open_dataset('temp.nc')\n", "esacci" ] }, { "cell_type": "code", "execution_count": null, "id": "6b0ea9a5-7a3b-4b67-a198-a7a496b7adb0", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:notebook] *", "language": "python", "name": "conda-env-notebook-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.13" } }, "nbformat": 4, "nbformat_minor": 5 }