{ "cells": [ { "cell_type": "markdown", "id": "stable-company", "metadata": {}, "source": [ "# MODIS Sea-ice" ] }, { "cell_type": "code", "execution_count": 30, "id": "wound-needle", "metadata": {}, "outputs": [], "source": [ "import xarray as xr\n", "xr.set_options(display_style='html')\n", "import cftime\n", "import matplotlib.pyplot as plt\n", "import matplotlib.path as mpath\n", "import cartopy.crs as ccrs\n", "from cmcrameri import cm\n", "import pandas as pd\n", "import numpy as np\n", "%matplotlib inline\n", "import s3fs" ] }, { "cell_type": "markdown", "id": "prompt-volleyball", "metadata": {}, "source": [ "# Satellite (MODIS)" ] }, { "cell_type": "code", "execution_count": 5, "id": "informed-rental", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reading sea ice concentration from year 2013\n" ] } ], "source": [ "fs = s3fs.S3FileSystem(anon=False,\n", "client_kwargs={'endpoint_url': 'https://forces2021.uiogeo-apps.sigma2.no/'})\n", "\n", "#Choose the year to load satellite data (2012-2019)\n", "i = 2013\n", "\n", "#Satellite data\n", "s3path = 's3://data/ASMR2/seaiceconc/'+str(i)+'/*.nc'\n", "print('Reading sea ice concentration from year '+str(i))\n", "remote_files = fs.glob(s3path)\n", "fileset = [fs.open(file) for file in remote_files]\n", "d2019 = xr.open_mfdataset(fileset, combine='nested',concat_dim=['time'])\n", "d2019['time'] = pd.to_datetime(list(map(lambda x: x[43:51],remote_files)))" ] }, { "cell_type": "code", "execution_count": 11, "id": "nasty-necklace", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
<xarray.DataArray 'polar_stereographic' (time: 239)>\n", "array([b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b''], dtype='|S1')\n", "Coordinates:\n", " * time (time) datetime64[ns] 2013-01-01 2013-01-02 ... 2013-12-31\n", "Attributes:\n", " grid_mapping_name: polar_stereographic\n", " straight_vertical_longitude_from_pole: [-45.]\n", " false_easting: [0.]\n", " false_northing: [0.]\n", " latitude_of_projection_origin: [90.]\n", " standard_parallel: [70.]\n", " long_name: CRS definition\n", " longitude_of_prime_meridian: [0.]\n", " semi_major_axis: [6378273.]\n", " inverse_flattening: [298.27941112]\n", " spatial_ref: PROJCS["NSIDC Sea Ice Polar Stere...\n", " GeoTransform: -3850000 6250 0 5850000 0 -6250
array([b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'', b'',\n", " b'', b'', b'', b'', b''], dtype='|S1')
array(['2013-01-01T00:00:00.000000000', '2013-01-02T00:00:00.000000000',\n", " '2013-01-03T00:00:00.000000000', ..., '2013-12-29T00:00:00.000000000',\n", " '2013-12-30T00:00:00.000000000', '2013-12-31T00:00:00.000000000'],\n", " dtype='datetime64[ns]')