Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Pratichhya committed Feb 10, 2025
1 parent a809b5d commit 697120c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions openeo/load_ESA_WorldCover.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,7 @@
"source": [
"# load data from the CDSE backend\n",
"cube = connection.load_collection(\n",
" \"ESA_WORLDCOVER_10M_2021_V2\",\n",
" temporal_extent=dates,\n",
" spatial_extent=aoi\n",
" \"ESA_WORLDCOVER_10M_2021_V2\", temporal_extent=dates, spatial_extent=aoi\n",
")"
]
},
Expand Down Expand Up @@ -483,7 +481,7 @@
"job_options = {\n",
" \"executor-memory\": \"2G\",\n",
" \"executor-memoryOverhead\": \"3G\",\n",
" \"python-memory\": \"3G\"\n",
" \"python-memory\": \"3G\",\n",
"}\n",
"# running a batch job\n",
"\n",
Expand Down Expand Up @@ -633,15 +631,19 @@
"arr[arr == 0] = np.nan\n",
"\n",
"# Generate lat/lon grid\n",
"lon, lat = np.meshgrid(data.x.values.astype(np.float64), data.y.values.astype(np.float64))\n",
"lon, lat = np.meshgrid(\n",
" data.x.values.astype(np.float64), data.y.values.astype(np.float64)\n",
")\n",
"\n",
"# Normalize data using a thematic color scale\n",
"cmap = plt.get_cmap(\"hsv\") # Choose a thematic colormap\n",
"norm = mcolors.Normalize(vmin=np.nanmin(arr), vmax=np.nanmax(arr)) # Scale values\n",
"colored_data = cmap(norm(arr)) # Convert data to RGBA colors\n",
"\n",
"# Ensure correct shape (H, W, 4)\n",
"colored_data = (colored_data[:, :, :4] * 255).astype(np.uint8) # Convert to uint8 format\n",
"colored_data = (colored_data[:, :, :4] * 255).astype(\n",
" np.uint8\n",
") # Convert to uint8 format\n",
"\n",
"# Create Folium map\n",
"m = folium.Map(location=[lat.mean(), lon.mean()], zoom_start=12)\n",
Expand Down

0 comments on commit 697120c

Please sign in to comment.