Skip to content

Commit

Permalink
some more cleaning of the notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed May 27, 2024
1 parent f08cc2b commit 3bfbc79
Showing 1 changed file with 38 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@
"cell_type": "code",
"execution_count": 1,
"id": "3dee06d0-49b9-4bf5-992d-8ad45b8b6f40",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [],
"source": [
"import warnings\n",
Expand Down Expand Up @@ -79,11 +75,7 @@
"cell_type": "code",
"execution_count": 2,
"id": "193d0bf9-6180-4ebb-a2c5-4175ef735605",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [],
"source": [
"# Time\n",
Expand All @@ -106,11 +98,7 @@
"cell_type": "code",
"execution_count": 3,
"id": "bc529245-b695-4847-94f2-0a78ca16bedf",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [],
"source": [
"collection_id = 'satellite-sea-ice-concentration'\n",
Expand Down Expand Up @@ -159,11 +147,7 @@
"cell_type": "code",
"execution_count": 4,
"id": "5c21a29b-acb7-425b-be0f-da2b00406412",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [],
"source": [
"def compute_siconc_time_series(ds, sic_threshold):\n",
Expand Down Expand Up @@ -222,11 +206,7 @@
"cell_type": "code",
"execution_count": 5,
"id": "fb250f9a-dfd9-45f1-9b03-6a9b6656f773",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [],
"source": [
"def rearrange_year_vs_dayofyear(ds):\n",
Expand Down Expand Up @@ -279,11 +259,7 @@
"cell_type": "code",
"execution_count": 6,
"id": "f6d31549-018a-4aac-87e4-a064b99aec4e",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [],
"source": [
"def full_year_only_resample(ds, reduction, sel_dict=None):\n",
Expand Down Expand Up @@ -362,9 +338,7 @@
{
"cell_type": "markdown",
"id": "46fd7495-ee6f-44d7-b82f-245b56cec065",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"### Download and transform"
]
Expand All @@ -374,10 +348,7 @@
"execution_count": 7,
"id": "05ce7d25-388e-4c33-bc24-066fc0556e54",
"metadata": {
"scrolled": true,
"tags": [
"hide-input"
]
"scrolled": true
},
"outputs": [
{
Expand All @@ -391,7 +362,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 37/37 [00:03<00:00, 11.92it/s]\n"
"100%|██████████| 37/37 [00:02<00:00, 14.66it/s]\n"
]
},
{
Expand All @@ -405,7 +376,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 37/37 [00:02<00:00, 15.93it/s]\n"
"100%|██████████| 37/37 [00:01<00:00, 19.61it/s]\n"
]
},
{
Expand All @@ -419,7 +390,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 8/8 [00:00<00:00, 18.86it/s]\n"
"100%|██████████| 8/8 [00:00<00:00, 21.25it/s]\n"
]
},
{
Expand All @@ -433,7 +404,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 8/8 [00:00<00:00, 19.13it/s]\n"
"100%|██████████| 8/8 [00:00<00:00, 14.22it/s]\n"
]
},
{
Expand All @@ -447,7 +418,7 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 16/16 [00:01<00:00, 15.61it/s]\n"
"100%|██████████| 16/16 [00:01<00:00, 10.42it/s]\n"
]
},
{
Expand All @@ -461,17 +432,12 @@
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 16/16 [00:00<00:00, 19.26it/s]\n"
"100%|██████████| 16/16 [00:00<00:00, 19.06it/s]\n"
]
}
],
"source": [
"kwargs = {\n",
" # Parameters to speed up IO\n",
" # \"combine\": \"nested\",\n",
" # \"data_vars\": \"minimal\",\n",
" \"coords\": \"minimal\",\n",
" \"compat\": \"override\",\n",
"download_kwargs = {\n",
" \"drop_variables\": (\n",
" \"raw_ice_conc_values\",\n",
" \"smearing_standard_error\",\n",
Expand All @@ -494,7 +460,7 @@
" transform_func=compute_siconc_time_series,\n",
" transform_func_kwargs={\"sic_threshold\": sic_threshold},\n",
" chunks={\"year\": 1},\n",
" **kwargs,\n",
" **download_kwargs,\n",
" )\n",
" datasets.append(ds.expand_dims(region=[region]).compute())\n",
" datasets_diagnostics[product] = xr.concat(datasets, \"region\")\n",
Expand All @@ -506,18 +472,14 @@
"id": "0e3daf08-e9b1-42a0-a196-98d614a25d2a",
"metadata": {},
"source": [
"## Sort the datasets out for plotting"
"### Prepare the datasets for plotting"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "6ce831d5-24b3-4d1f-b6c2-a832bf5f0d13",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [],
"source": [
"datasets_diagnostics_rearranged = {}\n",
Expand All @@ -527,12 +489,20 @@
" datasets_diagnostics_minmax[product] = get_yearly_min_max(datasets_diagnostics[product])"
]
},
{
"cell_type": "markdown",
"id": "7e3f53b2-a478-441d-9dd2-0c2b5d1d855e",
"metadata": {},
"source": [
"## Results"
]
},
{
"cell_type": "markdown",
"id": "05e9bf71-3f6d-4e5c-aefa-7ff5673527da",
"metadata": {},
"source": [
"# Arctic sea ice"
"### Arctic sea ice"
]
},
{
Expand All @@ -549,11 +519,7 @@
"cell_type": "code",
"execution_count": 9,
"id": "7528b657-a520-4aa0-8823-7e97b9db8d74",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -585,11 +551,7 @@
"cell_type": "code",
"execution_count": 10,
"id": "d9beb03b-30e8-4159-8c7d-d72b6107d252",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -620,11 +582,7 @@
"cell_type": "code",
"execution_count": 11,
"id": "682232a2-2de1-4fcb-b8bd-98456533ac7c",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -653,11 +611,7 @@
"cell_type": "code",
"execution_count": 12,
"id": "064267c2-f115-43a4-8308-82fb553c5c23",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -686,11 +640,7 @@
"cell_type": "code",
"execution_count": 13,
"id": "fc257e5b-2be1-49a3-9bea-1e1942ee5f93",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [
{
"data": {
Expand All @@ -712,7 +662,7 @@
"id": "6385f555-080e-48a4-bd03-870cdede7ba5",
"metadata": {},
"source": [
"# Antarctic sea ice"
"### Antarctic sea ice"
]
},
{
Expand All @@ -729,11 +679,7 @@
"cell_type": "code",
"execution_count": 14,
"id": "11beb472-8c1c-4341-b397-b96381a44008",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -764,11 +710,7 @@
"cell_type": "code",
"execution_count": 15,
"id": "b466872a-0bef-4754-b104-db8ae73fb6dd",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -799,11 +741,7 @@
"cell_type": "code",
"execution_count": 16,
"id": "44f7b5db-0b5a-4699-bac2-c890bedcf3e7",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -833,11 +771,7 @@
"cell_type": "code",
"execution_count": 17,
"id": "49d1b817-957d-4e18-9a19-3af336ef5c59",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -867,11 +801,7 @@
"cell_type": "code",
"execution_count": 18,
"id": "9c33abe9-3586-4351-bf5b-7af11bac2ae7",
"metadata": {
"tags": [
"hide-input"
]
},
"metadata": {},
"outputs": [
{
"data": {
Expand Down

0 comments on commit 3bfbc79

Please sign in to comment.