diff --git a/README.md b/README.md index d46b948..c53b08e 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ approach to assessing the likelihood of extreme events. #### Dependencies ``` -$ conda install xarray dask dask-jobqueue zarr pyyaml cmdline_provenance gitpython geopandas regionmask +$ conda install xarray dask dask-jobqueue zarr pyyaml cmdline_provenance gitpython geopandas regionmask xclim ``` #### Reference diff --git a/notebooks/preprocess.ipynb b/notebooks/preprocess.ipynb index b6542b0..b136032 100644 --- a/notebooks/preprocess.ipynb +++ b/notebooks/preprocess.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "730db7d9", "metadata": {}, "outputs": [], @@ -11,6 +11,7 @@ "sys.path.append('../unseen')\n", "\n", "from dask.distributed import Client, LocalCluster\n", + "import xclim\n", "\n", "import myfuncs\n", "import indices" @@ -18,7 +19,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "id": "9b47934e", "metadata": {}, "outputs": [], @@ -29,7 +30,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "id": "9b3140c1", "metadata": {}, "outputs": [ @@ -41,7 +42,7 @@ "
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,\n", + " history: Thu Jun 24 11:20:51 2021: /g/data/e14/dbi599/miniconda3/envs/...
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,\n", " 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,\n", " 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,\n", " 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,\n", " 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,\n", - " 91, 92, 93, 94, 95, 96])
array([ 0, 1, 2, ..., 3647, 3648, 3649])
array(['1991-11-01T00:00:00.000000000', '1992-11-01T00:00:00.000000000'],\n", - " dtype='datetime64[ns]')
array([['1991-11-01T00:00:00.000000000', '1992-11-01T00:00:00.000000000'],\n", + " 91, 92, 93, 94, 95, 96])
array([ 0, 1, 2, ..., 3647, 3648, 3649])
array(['1991-11-01T00:00:00.000000000', '1992-11-01T00:00:00.000000000'],\n", + " dtype='datetime64[ns]')
array([['1991-11-01T00:00:00.000000000', '1992-11-01T00:00:00.000000000'],\n", " ['1991-11-02T00:00:00.000000000', '1992-11-02T00:00:00.000000000'],\n", " ['1991-11-03T00:00:00.000000000', '1992-11-03T00:00:00.000000000'],\n", " ...,\n", " ['2001-10-26T00:00:00.000000000', '2002-10-27T00:00:00.000000000'],\n", " ['2001-10-27T00:00:00.000000000', '2002-10-28T00:00:00.000000000'],\n", " ['2001-10-28T00:00:00.000000000', '2002-10-29T00:00:00.000000000']],\n", - " dtype='datetime64[ns]')
\n",
"
| \n",
@@ -616,7 +617,7 @@
"\n",
"\n",
"
<xarray.DataArray 'pr' (init_date: 2, lead_time: 3650, ensemble: 96)>\n", - "dask.array<concatenate, shape=(2, 3650, 96), dtype=float64, chunksize=(1, 28, 96), chunktype=numpy.ndarray>\n", + "dask.array<concatenate, shape=(2, 3650, 96), dtype=float32, chunksize=(1, 28, 96), chunktype=numpy.ndarray>\n", "Coordinates:\n", " * ensemble (ensemble) int64 1 2 3 4 5 6 7 8 9 ... 88 89 90 91 92 93 94 95 96\n", " * lead_time (lead_time) int64 0 1 2 3 4 5 6 ... 3644 3645 3646 3647 3648 3649\n", @@ -1020,7 +1021,7 @@ " interp_method: conserve_order1\n", " long_name: Total precipitation rate\n", " time_avg_info: average_T1,average_T2,average_DT\n", - " units: kg/m2/s
\n",
"
| \n",
@@ -1116,24 +1117,24 @@
"\n",
"\n",
"
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,\n", + "
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,\n", " 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,\n", " 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,\n", " 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,\n", " 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,\n", - " 91, 92, 93, 94, 95, 96])
array([ 0, 1, 2, ..., 3647, 3648, 3649])
array(['1991-11-01T00:00:00.000000000', '1992-11-01T00:00:00.000000000'],\n", - " dtype='datetime64[ns]')
array([['1991-11-01T00:00:00.000000000', '1992-11-01T00:00:00.000000000'],\n", + " 91, 92, 93, 94, 95, 96])
array([ 0, 1, 2, ..., 3647, 3648, 3649])
array(['1991-11-01T00:00:00.000000000', '1992-11-01T00:00:00.000000000'],\n", + " dtype='datetime64[ns]')
array([['1991-11-01T00:00:00.000000000', '1992-11-01T00:00:00.000000000'],\n", " ['1991-11-02T00:00:00.000000000', '1992-11-02T00:00:00.000000000'],\n", " ['1991-11-03T00:00:00.000000000', '1992-11-03T00:00:00.000000000'],\n", " ...,\n", " ['2001-10-26T00:00:00.000000000', '2002-10-27T00:00:00.000000000'],\n", " ['2001-10-27T00:00:00.000000000', '2002-10-28T00:00:00.000000000'],\n", " ['2001-10-28T00:00:00.000000000', '2002-10-29T00:00:00.000000000']],\n", - " dtype='datetime64[ns]')
<xarray.DataArray 'pr' (init_date: 2, lead_time: 3650, ensemble: 96)>\n", - "dask.array<rechunk-merge, shape=(2, 3650, 96), dtype=float64, chunksize=(1, 50, 96), chunktype=numpy.ndarray>\n", + "dask.array<mul, shape=(2, 3650, 96), dtype=float32, chunksize=(1, 50, 96), chunktype=numpy.ndarray>\n", "Coordinates:\n", " * ensemble (ensemble) int64 1 2 3 4 5 6 7 8 9 ... 88 89 90 91 92 93 94 95 96\n", " * lead_time (lead_time) int64 0 1 2 3 4 5 6 ... 3644 3645 3646 3647 3648 3649\n", @@ -1538,7 +1539,7 @@ " interp_method: conserve_order1\n", " long_name: Total precipitation rate\n", " time_avg_info: average_T1,average_T2,average_DT\n", - " units: kg/m2/s
\n",
"
| \n",
@@ -1634,13 +1635,13 @@
"\n",
"\n",
"
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,\n", + "
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,\n", " 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,\n", " 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,\n", " 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,\n", " 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,\n", - " 91, 92, 93, 94, 95, 96])
array([ 0, 1, 2, ..., 3647, 3648, 3649])
array(['1991-11-01T00:00:00.000000000', '1992-11-01T00:00:00.000000000'],\n", - " dtype='datetime64[ns]')
\n",
"
|
array([cftime.DatetimeProlepticGregorian(1900, 1, 1, 9, 0, 0, 0, has_year_zero=False),\n", + " history: Thu Jun 24 12:05:30 2021: /g/data/e14/dbi599/miniconda3/envs/un...
array([cftime.DatetimeProlepticGregorian(1900, 1, 1, 9, 0, 0, 0, has_year_zero=False),\n", " cftime.DatetimeProlepticGregorian(1900, 1, 2, 9, 0, 0, 0, has_year_zero=False),\n", " cftime.DatetimeProlepticGregorian(1900, 1, 3, 9, 0, 0, 0, has_year_zero=False),\n", " ...,\n", " cftime.DatetimeProlepticGregorian(2020, 11, 30, 9, 0, 0, 0, has_year_zero=False),\n", " cftime.DatetimeProlepticGregorian(2020, 12, 1, 9, 0, 0, 0, has_year_zero=False),\n", " cftime.DatetimeProlepticGregorian(2020, 12, 2, 9, 0, 0, 0, has_year_zero=False)],\n", - " dtype=object)
\n",
"
|
\n",
"
|
array([cftime.DatetimeProlepticGregorian(1900, 1, 1, 9, 0, 0, 0, has_year_zero=False),\n", " cftime.DatetimeProlepticGregorian(1900, 1, 2, 9, 0, 0, 0, has_year_zero=False),\n", " cftime.DatetimeProlepticGregorian(1900, 1, 3, 9, 0, 0, 0, has_year_zero=False),\n", " ...,\n", " cftime.DatetimeProlepticGregorian(2020, 11, 30, 9, 0, 0, 0, has_year_zero=False),\n", " cftime.DatetimeProlepticGregorian(2020, 12, 1, 9, 0, 0, 0, has_year_zero=False),\n", " cftime.DatetimeProlepticGregorian(2020, 12, 2, 9, 0, 0, 0, has_year_zero=False)],\n", - " dtype=object)