Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.3
rev: v0.15.15
hooks:
# Run the linter.
- id: ruff
Expand Down
46 changes: 29 additions & 17 deletions notebooks/tp_insa/01_introduction_generale_fr.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@
"metadata": {},
"outputs": [],
"source": [
"print(\"Je vais dire plusieurs fois que la télédétection c'est super.\", \"Je vous propose de tenir un décompte, pour l'instant ça fait :\", 7)"
"print(\n",
" \"Je vais dire plusieurs fois que la télédétection c'est super.\",\n",
" \"Je vous propose de tenir un décompte, pour l'instant ça fait :\",\n",
" 7,\n",
")"
]
},
{
Expand Down Expand Up @@ -214,7 +218,7 @@
"outputs": [],
"source": [
"age = 40\n",
"f'J\\'ai {age} ans'"
"f\"J'ai {age} ans\""
]
},
{
Expand Down Expand Up @@ -484,7 +488,7 @@
"pixel_rgb = [37, 150, 190]\n",
"pixel_nir = [0]\n",
"\n",
"pixel_rgbnir = pixel_rgb + pixel_nir \n",
"pixel_rgbnir = pixel_rgb + pixel_nir\n",
"print(pixel_rgbnir)"
]
},
Expand All @@ -507,7 +511,9 @@
"outputs": [],
"source": [
"pixel_nir = pixel_rgbnir.pop()\n",
"print(f'On récupère le pixel NIR : {pixel_nir} et le pixel RGB qui a perdu son NIR : {pixel_rgbnir}')"
"print(\n",
" f\"On récupère le pixel NIR : {pixel_nir} et le pixel RGB qui a perdu son NIR : {pixel_rgbnir}\"\n",
")"
]
},
{
Expand All @@ -533,10 +539,7 @@
"metadata": {},
"outputs": [],
"source": [
"mon_point = {\n",
" \"type\" : \"Point\",\n",
" \"coordonnees\" : [-71, 41]\n",
" }"
"mon_point = {\"type\": \"Point\", \"coordonnees\": [-71, 41]}"
]
},
{
Expand Down Expand Up @@ -608,7 +611,7 @@
"metadata": {},
"outputs": [],
"source": [
"pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]\n"
"pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]"
]
},
{
Expand Down Expand Up @@ -650,7 +653,7 @@
"source": [
"pixel_rgbnir = [120, 100, 110, 20]\n",
"\n",
"for color in pixel_rgbnir :\n",
"for color in pixel_rgbnir:\n",
" print(color)"
]
},
Expand Down Expand Up @@ -691,7 +694,7 @@
"metadata": {},
"outputs": [],
"source": [
"pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]\n"
"pixels = [[100, 100, 100, 100], [120, 100, 110, 20], [100, 50, 110, 120]]"
]
},
{
Expand All @@ -715,6 +718,7 @@
"def bravo_la_teledec():\n",
" print(\"La télédétection c'est vraiment super !\")\n",
"\n",
"\n",
"bravo_le_sertit()"
]
},
Expand All @@ -727,6 +731,7 @@
"def bravo_le_(nom_entreprise):\n",
" print(\"Le\", nom_entreprise, \"c'est vraiment super !\")\n",
"\n",
"\n",
"bravo_le_(\"sertit\")"
]
},
Expand Down Expand Up @@ -805,6 +810,7 @@
"def bravo_le_(nom_entreprise=\"sertit\"):\n",
" print(\"Le\", nom_entreprise, \"c'est vraiment super !\")\n",
"\n",
"\n",
"bravo_le_()\n",
"bravo_le_(\"laboratoire icube\")"
]
Expand All @@ -826,6 +832,7 @@
" nom_entreprise_caché = \"laboratoire icube\"\n",
" print(\"Le\", nom_entreprise, \"c'est vraiment super !\")\n",
"\n",
"\n",
"bravo_le_()\n",
"print(nom_entreprise_caché)"
]
Expand All @@ -843,11 +850,13 @@
"metadata": {},
"outputs": [],
"source": [
"nom_entreprise=\"sertit\"\n",
"nom_entreprise = \"sertit\"\n",
"\n",
"\n",
"def bravo_le_():\n",
" nom_entreprise = \"laboratoire icube\"\n",
"\n",
"\n",
"print(\"Le\", nom_entreprise, \"c'est vraiment super !\")"
]
},
Expand All @@ -864,12 +873,14 @@
"metadata": {},
"outputs": [],
"source": [
"nom_entreprise=\"sertit\"\n",
"nom_entreprise = \"sertit\"\n",
"\n",
"\n",
"def bravo_le_(nom_entreprise):\n",
" nom_entreprise = \"laboratoire icube\"\n",
" return nom_entreprise\n",
"\n",
"\n",
"nom_entreprise = bravo_le_(nom_entreprise)\n",
"print(\"Le\", nom_entreprise, \"c'est vraiment super !\")"
]
Expand Down Expand Up @@ -972,7 +983,7 @@
"import numpy as np\n",
"\n",
"# Création d'une fonction de 2x3\n",
"m = np.arange(0, 6).reshape([2,3])\n",
"m = np.arange(0, 6).reshape([2, 3])\n",
"print(m)"
]
},
Expand Down Expand Up @@ -1111,7 +1122,8 @@
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"plt.imshow(image_rgbnir[:,:,:3])"
"\n",
"plt.imshow(image_rgbnir[:, :, :3])"
]
},
{
Expand Down Expand Up @@ -1144,8 +1156,8 @@
"source": [
"# Pour afficher le résultat\n",
"\n",
"#water_pixels = votre résultat\n",
"#plt.imshow(water_pixels)"
"# water_pixels = votre résultat\n",
"# plt.imshow(water_pixels)"
]
},
{
Expand Down
17 changes: 10 additions & 7 deletions notebooks/tp_insa/02_intro_manipulation_images_fr.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"source": [
"# Imports indispensables\n",
"\n",
"from matplotlib import pyplot\n",
"import rasterio\n",
"from rasterio.plot import show\n",
"from rasterio.plot import show_hist\n",
Expand Down Expand Up @@ -71,7 +70,9 @@
"metadata": {},
"outputs": [],
"source": [
"img = rasterio.open(\"https://maxar-opendata.s3.amazonaws.com/events/Belize-Wildfires-June24/ard/16/033131010232/2024-05-02/10300100F9791C00-ms.tif\")"
"img = rasterio.open(\n",
" \"https://maxar-opendata.s3.amazonaws.com/events/Belize-Wildfires-June24/ard/16/033131010232/2024-05-02/10300100F9791C00-ms.tif\"\n",
")"
]
},
{
Expand All @@ -89,7 +90,7 @@
"metadata": {},
"outputs": [],
"source": [
"#Tapez le nom de la variable ici\n"
"# Tapez le nom de la variable ici\n"
]
},
{
Expand Down Expand Up @@ -231,7 +232,7 @@
"metadata": {},
"outputs": [],
"source": [
"show(bande_1, cmap = \"gray\")"
"show(bande_1, cmap=\"gray\")"
]
},
{
Expand Down Expand Up @@ -275,7 +276,7 @@
"metadata": {},
"outputs": [],
"source": [
"show(bande_1, vmin=60, vmax=200, cmap = \"gray\")"
"show(bande_1, vmin=60, vmax=200, cmap=\"gray\")"
]
},
{
Expand All @@ -301,7 +302,9 @@
"metadata": {},
"outputs": [],
"source": [
"deep_b, b, g, y, r, r_edge, nir, water_v = (img.read(i) for i in (1,2,3,4,5,6,7,8))"
"deep_b, b, g, y, r, r_edge, nir, water_v = (\n",
" img.read(i) for i in (1, 2, 3, 4, 5, 6, 7, 8)\n",
")"
]
},
{
Expand Down Expand Up @@ -339,7 +342,7 @@
},
"outputs": [],
"source": [
"show(img.read([3,2,1]))"
"show(img.read([3, 2, 1]))"
]
},
{
Expand Down