Skip to content

Commit

Permalink
resolved autofixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brunosan committed Jan 14, 2024
2 parents fffe56d + a59a3eb commit 2a7a6e2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions docs/run_region.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"metadata": {},
"outputs": [],
"source": [
"#get the MGRS grid\n",
"# get the MGRS grid\n",
"mgrs_file = Path(\"data/mgrs/mgrs_full.fgb\")\n",
"if not mgrs_file.exists():\n",
" print(\"Downloading MGRS grid...\")\n",
Expand Down Expand Up @@ -135,8 +135,8 @@
"\n",
"# print number of mgrs_aoi, and the area of the aoi and mgrs_aoi\n",
"print(f\"Number of MGRS tiles covering AOI: {len(mgrs_aoi)}\")\n",
"aoi_area = aoi.to_crs(epsg=3857).area[0]/1e6\n",
"mgrs_area = mgrs_aoi.to_crs(epsg=3857).area.sum()/1e6\n",
"aoi_area = aoi.to_crs(epsg=3857).area[0] / 1e6\n",
"mgrs_area = mgrs_aoi.to_crs(epsg=3857).area.sum() / 1e6\n",
"print(f\"Area of AOI: {aoi_area:.2f} sq km\")\n",
"print(f\"Area of MGRS tiles covering AOI: {mgrs_area:.2f} sq km\")\n",
"print(f\"Percentage of AOI covered by MGRS tiles: {100*mgrs_area/aoi_area:.2f}%\")\n",
Expand All @@ -145,17 +145,16 @@
"fig, ax = plt.subplots(figsize=(10, 10))\n",
"mgrs_aoi.to_crs(epsg=3857).plot(ax=ax, color=\"blue\", alpha=0.5, label=\"MGRS\")\n",
"for idx, row in mgrs_aoi.to_crs(epsg=3857).iterrows():\n",
" x = float(row.geometry.centroid.x)\n",
" y = float(row.geometry.centroid.y)\n",
" ax.annotate(text=row[\"name\"],\n",
" xy=(x,y),color=\"white\")\n",
" x = float(row.geometry.centroid.x)\n",
" y = float(row.geometry.centroid.y)\n",
" ax.annotate(text=row[\"name\"], xy=(x, y), color=\"white\")\n",
"aoi.to_crs(epsg=3857).plot(ax=ax, color=\"red\", alpha=0.5, label=\"AOI\")\n",
"x = float(aoi.to_crs(epsg=3857).geometry.centroid.x)\n",
"y = float(aoi.to_crs(epsg=3857).geometry.centroid.y)\n",
"ax.annotate(text=\"AOI\",xy=(x,y),color=\"white\")\n",
"ax.annotate(text=\"AOI\", xy=(x, y), color=\"white\")\n",
"ctx.add_basemap(ax, source=ctx.providers.OpenStreetMap.Mapnik)\n",
"ax.set_axis_off()\n",
"plt.show()\n"
"plt.show()"
]
},
{
Expand Down Expand Up @@ -227,7 +226,7 @@
" --localpath data/chips \\\n",
" --index {index} \\\n",
" --dateranges \"2018-01-01/2018-04-01,2023-06-01/2023-12-15\"\n",
" #--subset 1500,1500,2524,2524 \\"
" # --subset 1500,1500,2524,2524 \\"
]
},
{
Expand All @@ -248,7 +247,7 @@
"outputs": [],
"source": [
"model_file = Path(\"data/checkpoints/Clay_v0.1_epoch-24_val-loss-0.46.ckpt\")\n",
"model_url=\"https://huggingface.co/made-with-clay/Clay/resolve/main/Clay_v0.1_epoch-24_val-loss-0.46.ckpt\"\n",
"model_url = \"https://huggingface.co/made-with-clay/Clay/resolve/main/Clay_v0.1_epoch-24_val-loss-0.46.ckpt\"\n",
"if not model_file.exists():\n",
" print(\"Downloading model...\")\n",
" !wget $model_url \\\n",
Expand Down

0 comments on commit 2a7a6e2

Please sign in to comment.