diff --git a/AgriDataValue/cdse_example.ipynb b/AgriDataValue/cdse_example.ipynb index 1ed1c6e..d7f9e7a 100644 --- a/AgriDataValue/cdse_example.ipynb +++ b/AgriDataValue/cdse_example.ipynb @@ -81,6 +81,9 @@ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", + "# The following is not a package. It is a file utils.py which should be in the same folder as this notebook.\n", + "from utils import plot_image\n", + "\n", "from sentinelhub import (\n", " CRS,\n", " BBox,\n", @@ -91,10 +94,7 @@ " SentinelHubDownloadClient,\n", " SentinelHubRequest,\n", " bbox_to_dimensions,\n", - ")\n", - "\n", - "# The following is not a package. It is a file utils.py which should be in the same folder as this notebook.\n", - "from utils import plot_image" + ")" ] }, { @@ -954,13 +954,15 @@ "request_raw_dict = {\n", " \"input\": {\n", " \"bounds\": {\"properties\": {\"crs\": betsiboka_bbox.crs.opengis_string}, \"bbox\": list(betsiboka_bbox)},\n", - " \"data\": [{\n", - " \"type\": \"S2L1C\",\n", - " \"dataFilter\": {\n", - " \"timeRange\": {\"from\": \"2020-06-01T00:00:00Z\", \"to\": \"2020-06-30T00:00:00Z\"},\n", - " \"mosaickingOrder\": \"leastCC\",\n", - " },\n", - " }],\n", + " \"data\": [\n", + " {\n", + " \"type\": \"S2L1C\",\n", + " \"dataFilter\": {\n", + " \"timeRange\": {\"from\": \"2020-06-01T00:00:00Z\", \"to\": \"2020-06-30T00:00:00Z\"},\n", + " \"mosaickingOrder\": \"leastCC\",\n", + " },\n", + " }\n", + " ],\n", " },\n", " \"output\": {\n", " \"width\": betsiboka_size[0],\n", diff --git a/AgriDataValue/utils.py b/AgriDataValue/utils.py index 7040e60..1bd195f 100644 --- a/AgriDataValue/utils.py +++ b/AgriDataValue/utils.py @@ -249,6 +249,7 @@ def plot_comparison( plt.tight_layout(pad=0.4, w_pad=0.5, h_pad=2.0) + def plot_image( image: np.ndarray, factor: float = 1.0, clip_range: tuple[float, float] | None = None, **kwargs: Any ) -> None: @@ -259,4 +260,4 @@ def plot_image( else: ax.imshow(image * factor, **kwargs) ax.set_xticks([]) - ax.set_yticks([]) \ No newline at end of file + ax.set_yticks([])