From 3d50f4a01499540fa6acf45b08e0bee422fb7247 Mon Sep 17 00:00:00 2001 From: heyarne Date: Sat, 13 Mar 2021 15:37:09 +0100 Subject: [PATCH] =?UTF-8?q?plot=5Fdownloaded=5Fproducts=20=E2=86=92=20plot?= =?UTF-8?q?=5Fproduct=5Fextent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/01a-download-process.ipynb | 6 +++--- sources/01c-coverage-analysis.ipynb | 16 ++++++++-------- sources/01d-true-color-mosaic.ipynb | 6 +++--- ...nterest-definition-and-product-download.ipynb | 4 ++-- ...nterest-definition-and-product-download.ipynb | 10 +++++----- sources/sentinel_helpers.py | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sources/01a-download-process.ipynb b/sources/01a-download-process.ipynb index 799ea47..67a6604 100644 --- a/sources/01a-download-process.ipynb +++ b/sources/01a-download-process.ipynb @@ -508,7 +508,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "`plot_downloaded_products` allows plotting the tile geometry of downloaded or available products over with a designated area of interest.\n", + "`plot_product_extent` allows plotting the tile geometry of downloaded or available products over with a designated area of interest.\n", "\n", "This provides quick visual impression of the result:" ] @@ -532,8 +532,8 @@ } ], "source": [ - "from sentinel_helpers import plot_downloaded_products\n", - "ax = plot_downloaded_products(gdf, berlin, figsize=(9,9))" + "from sentinel_helpers import plot_product_extent\n", + "ax = plot_product_extent(gdf, berlin, figsize=(9,9))" ] }, { diff --git a/sources/01c-coverage-analysis.ipynb b/sources/01c-coverage-analysis.ipynb index d24a8c3..732a42d 100644 --- a/sources/01c-coverage-analysis.ipynb +++ b/sources/01c-coverage-analysis.ipynb @@ -131,8 +131,8 @@ } ], "source": [ - "from sentinel_helpers import plot_downloaded_products\n", - "plot_downloaded_products(products, brandenburg, figsize=(9,9))" + "from sentinel_helpers import plot_product_extent\n", + "plot_product_extent(products, brandenburg, figsize=(9,9))" ] }, { @@ -252,8 +252,8 @@ "# plot subset of tiles left and right\n", "ax1.set_title('Tiles starting with T32')\n", "ax2.set_title('Tiles starting with T33')\n", - "plot_downloaded_products(t32_tiles, brandenburg, ax=ax1)\n", - "plot_downloaded_products(t33_tiles, brandenburg, ax=ax2)\n", + "plot_product_extent(t32_tiles, brandenburg, ax=ax1)\n", + "plot_product_extent(t33_tiles, brandenburg, ax=ax2)\n", "plt.tight_layout()" ] }, @@ -310,7 +310,7 @@ " ax.set_xlim(xmin=bounds[0], xmax=bounds[2])\n", " ax.set_ylim(ymin=bounds[1], ymax=bounds[3])\n", " per_orbit = products[products['orbitnumber'] == orbit]\n", - " plot_downloaded_products(per_orbit, brandenburg, ax=ax, alpha=0.2)\n", + " plot_product_extent(per_orbit, brandenburg, ax=ax, alpha=0.2)\n", " \n", "# hide empty subplots\n", "for ax in axs[len(orbits):]:\n", @@ -524,7 +524,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The function `plot_downloaded_products` is reused to get a visual impression of the area of the union of tiles just created:" + "The function `plot_product_extent` is reused to get a visual impression of the area of the union of tiles just created:" ] }, { @@ -556,7 +556,7 @@ } ], "source": [ - "plot_downloaded_products(union, brandenburg, figsize=(9,9))" + "plot_product_extent(union, brandenburg, figsize=(9,9))" ] }, { @@ -719,7 +719,7 @@ " if union.contains(brandenburg_geometry):\n", " break\n", " \n", - "plot_downloaded_products(union, brandenburg)" + "plot_product_extent(union, brandenburg)" ] }, { diff --git a/sources/01d-true-color-mosaic.ipynb b/sources/01d-true-color-mosaic.ipynb index 5f65422..e446e4d 100644 --- a/sources/01d-true-color-mosaic.ipynb +++ b/sources/01d-true-color-mosaic.ipynb @@ -137,7 +137,7 @@ ], "source": [ "from sentinelsat import SentinelAPI\n", - "from sentinel_helpers import search_osm, plot_downloaded_products\n", + "from sentinel_helpers import search_osm, plot_product_extent\n", "import datetime\n", "import os\n", "\n", @@ -264,7 +264,7 @@ ], "source": [ "gdf = api.to_geodataframe(products)\n", - "plot_downloaded_products(gdf, footprint, figsize=(9,9))" + "plot_product_extent(gdf, footprint, figsize=(9,9))" ] }, { @@ -362,7 +362,7 @@ "source": [ "import matplotlib.pyplot as plt\n", "\n", - "plot_downloaded_products(selection, footprint, figsize=(9,9))\n", + "plot_product_extent(selection, footprint, figsize=(9,9))\n", "plt.title('Selected products')" ] }, diff --git a/sources/02a-area-of-interest-definition-and-product-download.ipynb b/sources/02a-area-of-interest-definition-and-product-download.ipynb index b0a03e7..cefaca4 100644 --- a/sources/02a-area-of-interest-definition-and-product-download.ipynb +++ b/sources/02a-area-of-interest-definition-and-product-download.ipynb @@ -251,10 +251,10 @@ } ], "source": [ - "from sentinel_helpers import plot_downloaded_products\n", + "from sentinel_helpers import plot_product_extent\n", "\n", "deduped = products_gdf.drop_duplicates(subset='beginposition', keep='first')\n", - "plot_downloaded_products(deduped, tempelhofer_feld, figsize=(9,9), alpha=0.05)" + "plot_product_extent(deduped, tempelhofer_feld, figsize=(9,9), alpha=0.05)" ] }, { diff --git a/sources/03a-area-of-interest-definition-and-product-download.ipynb b/sources/03a-area-of-interest-definition-and-product-download.ipynb index c705cae..8840420 100644 --- a/sources/03a-area-of-interest-definition-and-product-download.ipynb +++ b/sources/03a-area-of-interest-definition-and-product-download.ipynb @@ -22,7 +22,7 @@ "from datetime import date, timedelta\n", "import os\n", "from pathlib import Path\n", - "from sentinel_helpers import search_osm, plot_downloaded_products, geodataframe_on_map\n", + "from sentinel_helpers import search_osm, plot_product_extent, geodataframe_on_map\n", "from sentinelsat import SentinelAPI\n", "from tqdm.notebook import tqdm\n", "\n", @@ -200,7 +200,7 @@ } ], "source": [ - "plot_downloaded_products(gdf, footprint_2018, figsize=(9,9))" + "plot_product_extent(gdf, footprint_2018, figsize=(9,9))" ] }, { @@ -603,7 +603,7 @@ } ], "source": [ - "plot_downloaded_products(gdf, buffered)" + "plot_product_extent(gdf, buffered)" ] }, { @@ -929,7 +929,7 @@ } ], "source": [ - "plot_downloaded_products(gdf, luebtheen, figsize=(9,9))" + "plot_product_extent(gdf, luebtheen, figsize=(9,9))" ] }, { @@ -989,7 +989,7 @@ } ], "source": [ - "plot_downloaded_products(gdf[gdf['tile'] == 'T32UPE'], luebtheen, figsize=(9,9))" + "plot_product_extent(gdf[gdf['tile'] == 'T32UPE'], luebtheen, figsize=(9,9))" ] }, { diff --git a/sources/sentinel_helpers.py b/sources/sentinel_helpers.py index 86f7053..ffad47e 100644 --- a/sources/sentinel_helpers.py +++ b/sources/sentinel_helpers.py @@ -31,7 +31,7 @@ def search_osm(place): return gpd.read_file(search_url) -def plot_downloaded_products(products, area_of_interest, **kwargs): +def plot_product_extent(products, area_of_interest, **kwargs): ax = kwargs.get('ax') alpha = kwargs.pop('alpha', 0.1) if not ax: