plot_downloaded_products → plot_product_extent

This commit is contained in:
heyarne 2021-03-13 15:37:09 +01:00
commit 3d50f4a014
6 changed files with 22 additions and 22 deletions

View file

@ -508,7 +508,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "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", "\n",
"This provides quick visual impression of the result:" "This provides quick visual impression of the result:"
] ]
@ -532,8 +532,8 @@
} }
], ],
"source": [ "source": [
"from sentinel_helpers import plot_downloaded_products\n", "from sentinel_helpers import plot_product_extent\n",
"ax = plot_downloaded_products(gdf, berlin, figsize=(9,9))" "ax = plot_product_extent(gdf, berlin, figsize=(9,9))"
] ]
}, },
{ {

View file

@ -131,8 +131,8 @@
} }
], ],
"source": [ "source": [
"from sentinel_helpers import plot_downloaded_products\n", "from sentinel_helpers import plot_product_extent\n",
"plot_downloaded_products(products, brandenburg, figsize=(9,9))" "plot_product_extent(products, brandenburg, figsize=(9,9))"
] ]
}, },
{ {
@ -252,8 +252,8 @@
"# plot subset of tiles left and right\n", "# plot subset of tiles left and right\n",
"ax1.set_title('Tiles starting with T32')\n", "ax1.set_title('Tiles starting with T32')\n",
"ax2.set_title('Tiles starting with T33')\n", "ax2.set_title('Tiles starting with T33')\n",
"plot_downloaded_products(t32_tiles, brandenburg, ax=ax1)\n", "plot_product_extent(t32_tiles, brandenburg, ax=ax1)\n",
"plot_downloaded_products(t33_tiles, brandenburg, ax=ax2)\n", "plot_product_extent(t33_tiles, brandenburg, ax=ax2)\n",
"plt.tight_layout()" "plt.tight_layout()"
] ]
}, },
@ -310,7 +310,7 @@
" ax.set_xlim(xmin=bounds[0], xmax=bounds[2])\n", " ax.set_xlim(xmin=bounds[0], xmax=bounds[2])\n",
" ax.set_ylim(ymin=bounds[1], ymax=bounds[3])\n", " ax.set_ylim(ymin=bounds[1], ymax=bounds[3])\n",
" per_orbit = products[products['orbitnumber'] == orbit]\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", " \n",
"# hide empty subplots\n", "# hide empty subplots\n",
"for ax in axs[len(orbits):]:\n", "for ax in axs[len(orbits):]:\n",
@ -524,7 +524,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "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": [ "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", " if union.contains(brandenburg_geometry):\n",
" break\n", " break\n",
" \n", " \n",
"plot_downloaded_products(union, brandenburg)" "plot_product_extent(union, brandenburg)"
] ]
}, },
{ {

View file

@ -137,7 +137,7 @@
], ],
"source": [ "source": [
"from sentinelsat import SentinelAPI\n", "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 datetime\n",
"import os\n", "import os\n",
"\n", "\n",
@ -264,7 +264,7 @@
], ],
"source": [ "source": [
"gdf = api.to_geodataframe(products)\n", "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": [ "source": [
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"\n", "\n",
"plot_downloaded_products(selection, footprint, figsize=(9,9))\n", "plot_product_extent(selection, footprint, figsize=(9,9))\n",
"plt.title('Selected products')" "plt.title('Selected products')"
] ]
}, },

View file

@ -251,10 +251,10 @@
} }
], ],
"source": [ "source": [
"from sentinel_helpers import plot_downloaded_products\n", "from sentinel_helpers import plot_product_extent\n",
"\n", "\n",
"deduped = products_gdf.drop_duplicates(subset='beginposition', keep='first')\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)"
] ]
}, },
{ {

View file

@ -22,7 +22,7 @@
"from datetime import date, timedelta\n", "from datetime import date, timedelta\n",
"import os\n", "import os\n",
"from pathlib import Path\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 sentinelsat import SentinelAPI\n",
"from tqdm.notebook import tqdm\n", "from tqdm.notebook import tqdm\n",
"\n", "\n",
@ -200,7 +200,7 @@
} }
], ],
"source": [ "source": [
"plot_downloaded_products(gdf, footprint_2018, figsize=(9,9))" "plot_product_extent(gdf, footprint_2018, figsize=(9,9))"
] ]
}, },
{ {
@ -603,7 +603,7 @@
} }
], ],
"source": [ "source": [
"plot_downloaded_products(gdf, buffered)" "plot_product_extent(gdf, buffered)"
] ]
}, },
{ {
@ -929,7 +929,7 @@
} }
], ],
"source": [ "source": [
"plot_downloaded_products(gdf, luebtheen, figsize=(9,9))" "plot_product_extent(gdf, luebtheen, figsize=(9,9))"
] ]
}, },
{ {
@ -989,7 +989,7 @@
} }
], ],
"source": [ "source": [
"plot_downloaded_products(gdf[gdf['tile'] == 'T32UPE'], luebtheen, figsize=(9,9))" "plot_product_extent(gdf[gdf['tile'] == 'T32UPE'], luebtheen, figsize=(9,9))"
] ]
}, },
{ {

View file

@ -31,7 +31,7 @@ def search_osm(place):
return gpd.read_file(search_url) 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') ax = kwargs.get('ax')
alpha = kwargs.pop('alpha', 0.1) alpha = kwargs.pop('alpha', 0.1)
if not ax: if not ax: