diff --git a/notebooks/US_precip_air_062020.nc b/notebooks/US_precip_air_062020.nc new file mode 100644 index 0000000..f4d24b9 Binary files /dev/null and b/notebooks/US_precip_air_062020.nc differ diff --git a/notebooks/merge_climate_datasets_exercise.ipynb b/notebooks/merge_climate_datasets_exercise.ipynb index 9be1adf..34e0145 100644 --- a/notebooks/merge_climate_datasets_exercise.ipynb +++ b/notebooks/merge_climate_datasets_exercise.ipynb @@ -28,7 +28,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "0a656265", "metadata": { "tags": [ @@ -69,7 +69,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "3270985f", "metadata": { "tags": [ @@ -80,7 +80,10 @@ "source": [ "# TODO: load the air temperature and precipitation datasets.\n", "# Example: air = xr.open_dataset(..., chunks={\"time\": 8})\n", - "raise NotImplementedError(\"Assign datasets to `air` and `precip`.\")\n" + "#raise NotImplementedError(\"Assign datasets to `air` and `precip`.\")\n", + "\n", + "air = xr.open_dataset(TEMP_URL, chunks={'time':10})\n", + "precip = xr.open_dataset(PRECIP_URL, chunks={'time':10})\n" ] }, { @@ -96,17 +99,1328 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "id": "264d9641", - "metadata": { - "tags": [ - "exercise" - ] - }, - "outputs": [], + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
<xarray.Dataset> Size: 128kB\n", + "Dimensions: (time: 120, lat: 11, lon: 24)\n", + "Coordinates:\n", + " * lat (lat) float32 44B 50.0 47.5 45.0 42.5 40.0 ... 32.5 30.0 27.5 25.0\n", + " * lon (lon) float32 96B 235.0 237.5 240.0 242.5 ... 287.5 290.0 292.5\n", + " * time (time) datetime64[ns] 960B 2020-06-01 ... 2020-06-30T18:00:00\n", + "Data variables:\n", + " air (time, lat, lon) float32 127kB dask.array<chunksize=(2, 11, 24), meta=np.ndarray>\n", + "Attributes:\n", + " Conventions: COARDS\n", + " title: 4x daily NMC reanalysis (2014)\n", + " history: created 2017/12 by Hoop (netCDF2.3)\n", + " description: Data is from NMC initialized reanalysis\\...\n", + " platform: Model\n", + " dataset_title: NCEP-NCAR Reanalysis 1\n", + " _NCProperties: version=2,netcdf=4.6.3,hdf5=1.10.5\n", + " References: http://www.psl.noaa.gov/data/gridded/dat...\n", + " DODS_EXTRA.Unlimited_Dimension: time
<xarray.Dataset> Size: 697kB\n", + "Dimensions: (time: 30, lat: 50, lon: 116)\n", + "Coordinates:\n", + " * lat (lat) float32 200B 49.75 49.25 48.75 48.25 ... 26.25 25.75 25.25\n", + " * lon (lon) float32 464B 235.2 235.8 236.2 236.8 ... 291.8 292.2 292.8\n", + " * time (time) datetime64[ns] 240B 2020-06-01 2020-06-02 ... 2020-06-30\n", + "Data variables:\n", + " precip (time, lat, lon) float32 696kB dask.array<chunksize=(8, 50, 116), meta=np.ndarray>\n", + "Attributes:\n", + " _NCProperties: version=1|netcdflibversion=4.4.1.1|hdf5l...\n", + " Conventions: CF-1.0\n", + " version: V1.0\n", + " title: CPC GLOBAL PRCP V1.0 RT\n", + " dataset_title: CPC GLOBAL PRCP V1.0\n", + " Source: ftp://ftp.cpc.ncep.noaa.gov/precip/CPC_U...\n", + " References: https://www.psl.noaa.gov/data/gridded/da...\n", + " history: Updated 2021-01-02 23:31:03\n", + " DODS_EXTRA.Unlimited_Dimension: time
<xarray.Dataset> Size: 32kB\n", + "Dimensions: (time: 30, lat: 11, lon: 24)\n", + "Coordinates:\n", + " * lat (lat) float32 44B 50.0 47.5 45.0 42.5 40.0 ... 32.5 30.0 27.5 25.0\n", + " * lon (lon) float32 96B 235.0 237.5 240.0 242.5 ... 287.5 290.0 292.5\n", + " * time (time) datetime64[ns] 240B 2020-06-01 2020-06-02 ... 2020-06-30\n", + "Data variables:\n", + " air (time, lat, lon) float32 32kB dask.array<chunksize=(1, 11, 24), meta=np.ndarray>\n", + "Attributes:\n", + " Conventions: COARDS\n", + " title: 4x daily NMC reanalysis (2014)\n", + " history: created 2017/12 by Hoop (netCDF2.3)\n", + " description: Data is from NMC initialized reanalysis\\...\n", + " platform: Model\n", + " dataset_title: NCEP-NCAR Reanalysis 1\n", + " _NCProperties: version=2,netcdf=4.6.3,hdf5=1.10.5\n", + " References: http://www.psl.noaa.gov/data/gridded/dat...\n", + " DODS_EXTRA.Unlimited_Dimension: time
<xarray.Dataset> Size: 3MB\n", + "Dimensions: (time: 120, lat: 50, lon: 116)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 960B 2020-06-01 ... 2020-06-30T18:00:00\n", + " * lat (lat) float32 200B 49.75 49.25 48.75 48.25 ... 26.25 25.75 25.25\n", + " * lon (lon) float32 464B 235.2 235.8 236.2 236.8 ... 291.8 292.2 292.8\n", + "Data variables:\n", + " air (time, lat, lon) float32 3MB dask.array<chunksize=(2, 50, 116), meta=np.ndarray>\n", + "Attributes:\n", + " Conventions: COARDS\n", + " title: 4x daily NMC reanalysis (2014)\n", + " history: created 2017/12 by Hoop (netCDF2.3)\n", + " description: Data is from NMC initialized reanalysis\\...\n", + " platform: Model\n", + " dataset_title: NCEP-NCAR Reanalysis 1\n", + " _NCProperties: version=2,netcdf=4.6.3,hdf5=1.10.5\n", + " References: http://www.psl.noaa.gov/data/gridded/dat...\n", + " DODS_EXTRA.Unlimited_Dimension: time
<xarray.Dataset> Size: 6MB\n", + "Dimensions: (time: 120, lat: 50, lon: 116)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 960B 2020-06-01 ... 2020-06-30T18:00:00\n", + " * lat (lat) float32 200B 49.75 49.25 48.75 48.25 ... 26.25 25.75 25.25\n", + " * lon (lon) float32 464B 235.2 235.8 236.2 236.8 ... 291.8 292.2 292.8\n", + "Data variables:\n", + " air (time, lat, lon) float32 3MB dask.array<chunksize=(2, 50, 116), meta=np.ndarray>\n", + " precip (time, lat, lon) float32 3MB dask.array<chunksize=(7, 50, 116), meta=np.ndarray>\n", + "Attributes:\n", + " Conventions: COARDS\n", + " title: 4x daily NMC reanalysis (2014)\n", + " history: created 2017/12 by Hoop (netCDF2.3)\n", + " description: Data is from NMC initialized reanalysis\\...\n", + " platform: Model\n", + " dataset_title: NCEP-NCAR Reanalysis 1\n", + " _NCProperties: version=2,netcdf=4.6.3,hdf5=1.10.5\n", + " References: http://www.psl.noaa.gov/data/gridded/dat...\n", + " DODS_EXTRA.Unlimited_Dimension: time