Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
veseln committed Apr 15, 2024
1 parent 135625c commit 3cd6897
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
24 changes: 13 additions & 11 deletions AgriDataValue/cdse_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
")"
]
},
{
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion AgriDataValue/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -259,4 +260,4 @@ def plot_image(
else:
ax.imshow(image * factor, **kwargs)
ax.set_xticks([])
ax.set_yticks([])
ax.set_yticks([])

0 comments on commit 3cd6897

Please sign in to comment.