diff --git a/01-introduction-to-netcdf-climate-data.ipynb b/01-introduction-to-netcdf-climate-data.ipynb index 8146b25..9988b0a 100644 --- a/01-introduction-to-netcdf-climate-data.ipynb +++ b/01-introduction-to-netcdf-climate-data.ipynb @@ -29,7 +29,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "tags": [ "hide" @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -105,489 +105,9 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
<xarray.Dataset>\n",
-       "Dimensions:          (crs: 1, lat: 585, lon: 1386, time: 672)\n",
-       "Coordinates:\n",
-       "  * lat              (lat) float64 25.06 25.1 25.15 25.19 ... 49.31 49.35 49.4\n",
-       "  * crs              (crs) int32 1\n",
-       "  * lon              (lon) float64 235.2 235.3 235.3 235.4 ... 292.9 292.9 292.9\n",
-       "  * time             (time) object 1950-01-15 00:00:00 ... 2005-12-15 00:00:00\n",
-       "Data variables:\n",
-       "    air_temperature  (time, lat, lon) float32 ...\n",
-       "Attributes:\n",
-       "    description:                     Multivariate Adaptive Constructed Analog...\n",
-       "    id:                              MACAv2-METDATA\n",
-       "    naming_authority:                edu.uidaho.reacch\n",
-       "    Metadata_Conventions:            Unidata Dataset Discovery v1.0\n",
-       "    Metadata_Link:                   \n",
-       "    cdm_data_type:                   FLOAT\n",
-       "    title:                           Monthly aggregation of downscaled daily ...\n",
-       "    summary:                         This archive contains monthly downscaled...\n",
-       "    keywords:                        monthly, precipitation, maximum temperat...\n",
-       "    keywords_vocabulary:             \n",
-       "    standard_name_vocabulary:        CF-1.0\n",
-       "    history:                         No revisions.\n",
-       "    comment:                         \n",
-       "    geospatial_bounds:               POLYGON((-124.7722 25.0631,-124.7722 49....\n",
-       "    geospatial_lat_min:              25.0631\n",
-       "    geospatial_lat_max:              49.3960\n",
-       "    geospatial_lon_min:              -124.7722\n",
-       "    geospatial_lon_max:              -67.0648\n",
-       "    geospatial_lat_units:            decimal degrees north\n",
-       "    geospatial_lon_units:            decimal degrees east\n",
-       "    geospatial_lat_resolution:       0.0417\n",
-       "    geospatial_lon_resolution:       0.0417\n",
-       "    geospatial_vertical_min:         0.0\n",
-       "    geospatial_vertical_max:         0.0\n",
-       "    geospatial_vertical_resolution:  0.0\n",
-       "    geospatial_vertical_positive:    up\n",
-       "    time_coverage_start:             2000-01-01T00:0\n",
-       "    time_coverage_end:               2004-12-31T00:00\n",
-       "    time_coverage_duration:          P5Y\n",
-       "    time_coverage_resolution:        P1M\n",
-       "    date_created:                    2014-05-15\n",
-       "    date_modified:                   2014-05-15\n",
-       "    date_issued:                     2014-05-15\n",
-       "    creator_name:                    John Abatzoglou\n",
-       "    creator_url:                     http://maca.northwestknowledge.net\n",
-       "    creator_email:                   jabatzoglou@uidaho.edu\n",
-       "    institution:                     University of Idaho\n",
-       "    processing_level:                GRID\n",
-       "    project:                         \n",
-       "    contributor_name:                Katherine C. Hegewisch\n",
-       "    contributor_role:                Postdoctoral Fellow\n",
-       "    publisher_name:                  REACCH\n",
-       "    publisher_email:                 reacch@uidaho.edu\n",
-       "    publisher_url:                   http://www.reacchpna.org/\n",
-       "    license:                         Creative Commons CC0 1.0 Universal Dedic...\n",
-       "    coordinate_system:               WGS84,EPSG:4326
" - ], - "text/plain": [ - "\n", - "Dimensions: (crs: 1, lat: 585, lon: 1386, time: 672)\n", - "Coordinates:\n", - " * lat (lat) float64 25.06 25.1 25.15 25.19 ... 49.31 49.35 49.4\n", - " * crs (crs) int32 1\n", - " * lon (lon) float64 235.2 235.3 235.3 235.4 ... 292.9 292.9 292.9\n", - " * time (time) object 1950-01-15 00:00:00 ... 2005-12-15 00:00:00\n", - "Data variables:\n", - " air_temperature (time, lat, lon) float32 ...\n", - "Attributes:\n", - " description: Multivariate Adaptive Constructed Analog...\n", - " id: MACAv2-METDATA\n", - " naming_authority: edu.uidaho.reacch\n", - " Metadata_Conventions: Unidata Dataset Discovery v1.0\n", - " Metadata_Link: \n", - " cdm_data_type: FLOAT\n", - " title: Monthly aggregation of downscaled daily ...\n", - " summary: This archive contains monthly downscaled...\n", - " keywords: monthly, precipitation, maximum temperat...\n", - " keywords_vocabulary: \n", - " standard_name_vocabulary: CF-1.0\n", - " history: No revisions.\n", - " comment: \n", - " geospatial_bounds: POLYGON((-124.7722 25.0631,-124.7722 49....\n", - " geospatial_lat_min: 25.0631\n", - " geospatial_lat_max: 49.3960\n", - " geospatial_lon_min: -124.7722\n", - " geospatial_lon_max: -67.0648\n", - " geospatial_lat_units: decimal degrees north\n", - " geospatial_lon_units: decimal degrees east\n", - " geospatial_lat_resolution: 0.0417\n", - " geospatial_lon_resolution: 0.0417\n", - " geospatial_vertical_min: 0.0\n", - " geospatial_vertical_max: 0.0\n", - " geospatial_vertical_resolution: 0.0\n", - " geospatial_vertical_positive: up\n", - " time_coverage_start: 2000-01-01T00:0\n", - " time_coverage_end: 2004-12-31T00:00\n", - " time_coverage_duration: P5Y\n", - " time_coverage_resolution: P1M\n", - " date_created: 2014-05-15\n", - " date_modified: 2014-05-15\n", - " date_issued: 2014-05-15\n", - " creator_name: John Abatzoglou\n", - " creator_url: http://maca.northwestknowledge.net\n", - " creator_email: jabatzoglou@uidaho.edu\n", - " institution: University of Idaho\n", - " processing_level: GRID\n", - " project: \n", - " contributor_name: Katherine C. Hegewisch\n", - " contributor_role: Postdoctoral Fellow\n", - " publisher_name: REACCH\n", - " publisher_email: reacch@uidaho.edu\n", - " publisher_url: http://www.reacchpna.org/\n", - " license: Creative Commons CC0 1.0 Universal Dedic...\n", - " coordinate_system: WGS84,EPSG:4326" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# The (online) url for the MACAv2 data\n", "data_path = \"http://thredds.northwestknowledge.net:8080/thredds/dodsC/agg_macav2metdata_tasmax_BNU-ESM_r1i1p1_historical_1950_2005_CONUS_monthly.nc\"\n", @@ -789,8 +309,6 @@ }, "outputs": [], "source": [ - "central_lat = 37.5\n", - "central_lon = -96\n", "extent = [-120, -70, 24, 50.5]\n", "central_lon = np.mean(extent[:2])\n", "central_lat = np.mean(extent[2:])\n", @@ -798,10 +316,9 @@ "f, ax = plt.subplots(figsize=(12, 6),\n", " subplot_kw={'projection': ccrs.AlbersEqualArea(central_lon, central_lat)})\n", "ax.coastlines()\n", - "ax.plot(longitude, latitude,\n", - " markersize=12,\n", - " marker='*',\n", - " color='purple')\n", + "# Plotting the star in the CRS of the map from the coords we have\n", + "ax.annotate('\\u2605', xy=(longitude-360, latitude),\n", + " xycoords=ccrs.PlateCarree()._as_mpl_transform(ax), color='purple', fontsize=20)\n", "ax.set_extent(extent)\n", "ax.set(title=\"Location of the lat / lon Being Used To to Slice Your netcdf Climate Data File\")\n", "\n", @@ -1474,7 +991,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.7.8" }, "toc": { "base_numbering": 1, diff --git a/04-activity-01-open-netcdf-plot-time-series.ipynb b/04-activity-01-open-netcdf-plot-time-series.ipynb index bb119bb..21eec18 100644 --- a/04-activity-01-open-netcdf-plot-time-series.ipynb +++ b/04-activity-01-open-netcdf-plot-time-series.ipynb @@ -264,10 +264,9 @@ " subplot_kw={'projection': ccrs.AlbersEqualArea(central_lon, central_lat)})\n", "ax.coastlines()\n", "ax.set_extent(extent)\n", - "ax.plot(longitude, latitude,\n", - " markersize=12,\n", - " marker='*',\n", - " color='purple')\n", + "# Plotting the star in the CRS of the map from the coords we have\n", + "ax.annotate('\\u2605', xy=(longitude-360, latitude),\n", + " xycoords=ccrs.PlateCarree()._as_mpl_transform(ax), color='purple', fontsize=20)\n", "ax.set(title=\"Location of the lat / lon Being Used To to Slice Your netcdf Climate Data File\")\n", "\n", "# Adds a bunch of elements to the map\n", @@ -383,7 +382,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.7.8" }, "toc": { "base_numbering": 1,