diff --git a/CombinedPlot.png b/CombinedPlot.png new file mode 100644 index 0000000..eb8299b Binary files /dev/null and b/CombinedPlot.png differ diff --git a/ScatterPlot.png b/ScatterPlot.png new file mode 100644 index 0000000..4be7981 Binary files /dev/null and b/ScatterPlot.png differ diff --git a/SeparatedPlot.png b/SeparatedPlot.png new file mode 100644 index 0000000..23ba2d6 Binary files /dev/null and b/SeparatedPlot.png differ diff --git a/merged_US_2020.nc b/merged_US_2020.nc new file mode 100644 index 0000000..1aae8b9 Binary files /dev/null and b/merged_US_2020.nc differ diff --git a/notebooks/merge_climate_datasets_exercise.ipynb b/notebooks/merge_climate_datasets_exercise.ipynb index 9be1adf..73fb696 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": 11, "id": "0a656265", "metadata": { "tags": [ @@ -50,7 +50,7 @@ "TEMP_URL = \"https://psl.noaa.gov/thredds/dodsC/Datasets/ncep.reanalysis/surface/air.sig995.2020.nc\"\n", "PRECIP_URL = \"https://psl.noaa.gov/thredds/dodsC/Datasets/cpc_global_precip/precip.2020.nc\"\n", "\n", - "LAT_RANGE = (20, 50) # degrees North\n", + "LAT_RANGE = (50, 20) # degrees North\n", "LON_RANGE_360 = (230, 300) # degrees East (equivalent to -130° to -60°)\n", "LON_RANGE_180 = (-130, -60) # convenience if a dataset uses -180° to 180°\n", "\n", @@ -69,7 +69,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "3270985f", "metadata": { "tags": [ @@ -80,7 +80,646 @@ "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" + "air = xr.open_dataset(TEMP_URL, chunks={\"time\" : 8})\n", + "precip = xr.open_dataset(PRECIP_URL, chunks={\"time\" : 8})\n", + "# raise NotImplementedError(\"Assign datasets to `air` and `precip`.\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "bbea8d85", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
<xarray.Dataset> Size: 379MB\n", + "Dimensions: (time: 366, lat: 360, lon: 720)\n", + "Coordinates:\n", + " * lat (lat) float32 1kB 89.75 89.25 88.75 88.25 ... -88.75 -89.25 -89.75\n", + " * lon (lon) float32 3kB 0.25 0.75 1.25 1.75 ... 358.2 358.8 359.2 359.8\n", + " * time (time) datetime64[ns] 3kB 2020-01-01 2020-01-02 ... 2020-12-31\n", + "Data variables:\n", + " precip (time, lat, lon) float32 379MB dask.array<chunksize=(8, 360, 720), 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: 182kB\n", + "Dimensions: (time: 120, lat: 13, lon: 29)\n", + "Coordinates:\n", + " * lat (lat) float32 52B 50.0 47.5 45.0 42.5 40.0 ... 27.5 25.0 22.5 20.0\n", + " * lon (lon) float32 116B 230.0 232.5 235.0 237.5 ... 295.0 297.5 300.0\n", + " * time (time) datetime64[ns] 960B 2020-06-01 ... 2020-06-30T18:00:00\n", + "Data variables:\n", + " air (time, lat, lon) float32 181kB dask.array<chunksize=(8, 13, 29), 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: 46kB\n", + "Dimensions: (time: 30, lat: 13, lon: 29)\n", + "Coordinates:\n", + " * lat (lat) float32 52B 50.0 47.5 45.0 42.5 40.0 ... 27.5 25.0 22.5 20.0\n", + " * lon (lon) float32 116B 230.0 232.5 235.0 237.5 ... 295.0 297.5 300.0\n", + " * time (time) datetime64[ns] 240B 2020-06-01 2020-06-02 ... 2020-06-30\n", + "Data variables:\n", + " air (time, lat, lon) float32 45kB dask.array<chunksize=(1, 13, 29), 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: 2MB\n", + "Dimensions: (time: 30, lat: 60, lon: 140)\n", + "Coordinates:\n", + " * time (time) datetime64[ns] 240B 2020-06-01 ... 2020-06-30\n", + " * lat (lat) float32 240B 49.75 49.25 48.75 ... 21.25 20.75 20.25\n", + " * lon (lon) float32 560B 230.2 230.8 231.2 ... 298.8 299.2 299.8\n", + "Data variables:\n", + " air_temperature (time, lat, lon) float32 1MB dask.array<chunksize=(1, 60, 140), meta=np.ndarray>\n", + " daily_precip (time, lat, lon) float32 1MB dask.array<chunksize=(8, 60, 140), meta=np.ndarray>