<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@vertical+block@c5cc45de46d440d691bf2c6c97817e1b" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@cf00e9ad2870424186edd6e4e2a3d8a8">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@cf00e9ad2870424186edd6e4e2a3d8a8" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p>Dans cet exercice, nous allons créer un nouveau notebook pour déterminer l’étendue des plans d’eau en utilisant le produit Water Observation from Space (WOfS). Le produit WOfS utilise un algorithme automatisé de cartographie de l’eau pour identifier l’eau dans les images Landsat 5,7 et 8.</p>
<p style="text-align: left;">Le notebook comprendra les étapes suivantes :</p>
<ul>
<li>Charger le produit de couche d’entités WOfS et les données Landsat 8</li>
<li>Identifier les pixels d’eau de WOfS</li>
<li>Tracez une image en couleurs vraies à l’aide des données Landsat</li>
<li>Tracez la superficie du plan d’eau pour la même zone à l’aide des données WOfS</li>
<li>Personnalisez les affichages</li>
</ul>
<p></p>
<p>À l’issue de cet exercice, vous serez en mesure de déterminer l’étendue des plans d’eau à l’aide du produit WOfS.</p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@vertical+block@0c6e179486034326a3044d5779e04cd2" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@ffaf2b5d3f6a40c69580bcc507e7a603">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@ffaf2b5d3f6a40c69580bcc507e7a603" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p style="text-align: left;">Dans votre dossier <strong>Training</strong>, créez un nouveau notebook Python 3. Nommez-le<span style="color: #000000;"> </span><code class="docutils literal notranslate" style="background-color: #ffffff; box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">Water_extent_exercise.ipynb</span></code><span style="color: #000000;">.</span></p>
<p>Pour plus d’instructions sur la création d’un nouveau notebook, consultez les instructions de la session 2.</p>
<h3>Charger des packages et des fonctions</h3>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;">Dans la première cellule, tapez le code suivant, puis exécutez la cellule pour importer les dépendances Python nécessaires.</p>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px; color: #000000; font-family: Arial, sans-serif;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px; text-align: left;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;"><span style="box-sizing: border-box;"></span>import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import datacube
from deafrica_tools.datahandling import load_ard, wofs_fuser
from deafrica_tools.plotting import display_map, rgb
</pre>
</div>
</div>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;">Dans cet exercice, nous importons une nouvelle fonction, <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">wofs_fuser</span></code>. <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">wofs_fuser</span></code> assure que les données WOfS entre les scènes sont combinées correctement.</p>
<h3 style="box-sizing: border-box; color: #000000;">Connectez-vous au datacube</h3>
<p>Entrez le code suivant et exécutez la cellule pour créer notre objet <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">dc</span></code>, qui donne accès au datacube.</p>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px; text-align: left;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;"><span style="box-sizing: border-box;"></span>dc = datacube.Datacube(app="water_extent_exercise")
</pre>
</div>
</div>
<h3>Sélectionnez la zone d’intérêt</h3>
<p>Dans la cellule suivante, saisissez le code suivant, puis exécutez-le pour sélectionner une zone et une date. Dans cet exercice, nous utilisons un point central et un tampon pour définir notre zone d’intérêt, de manière similaire à ce que nous avons fait dans l’exercice Session 5.</p>
<p>La seule différence ici est que nous fournissons un tampon de latitude et un tampon de longitude. Dans cet exemple, ils ont la même valeur. Cependant, le choix de différentes valeurs de tampon vous permet de sélectionner des zones d’intérêt rectangulaires plutôt que des carrés.</p>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px; color: #000000; font-family: Arial, sans-serif;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px; text-align: left;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;"># Define the area of interest
lat = -6.0873
lon = 35.1817
lat_buffer = 0.2
lon_buffer = 0.2
# Combine central lat, lon with buffer to get area of interest
lat_range = (lat - lat_buffer, lat + lat_buffer)
lon_range = (lon - lon_buffer, lon + lon_buffer)
# Define the year
time = '2018'</pre>
</div>
</div>
<div class="admonition note" style="box-sizing: border-box; -webkit-font-smoothing: antialiased; padding: 12px; line-height: 24px; margin-bottom: 24px; background: #e7f2fa; color: #000000;">
<p class="admonition-title" style="box-sizing: border-box; line-height: 1; margin: -12px -12px 12px; font-size: inherit; font-family: inherit; font-variant-numeric: normal; font-variant-east-asian: normal; font-weight: bold; font-stretch: normal; text-rendering: auto; -webkit-font-smoothing: antialiased; color: #ffffff; background: #6ab0de; padding: 6px 12px; text-align: left;">Note</p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px; font-size: 16px; text-align: left;"><span color="#000000" style="color: #000000;">Rappelons que les lignes de code commençant par</span><span style="color: #000000;"> </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">#</span></code><span style="color: #000000;"> </span><span color="#000000" style="color: #000000;">sont des commentaires. Ils aident à expliquer le code et peuvent être supprimés ou ajoutés sans avoir d’impact sur les scripts Python.</span></p>
</div>
<p style="text-align: left;"><span style="color: #000000;">Dans la cellule suivante, entrez le code suivant, puis exécutez-le pour afficher la zone sur une carte. Puisque nous avons défini notre zone en utilisant les variables </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">lon_range</span></code><span style="color: #000000;"> et </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">lat_range</span></code><span style="color: #000000;">, nous pouvons les utiliser au lieu de retaper </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">(lat</span> <span class="pre" style="box-sizing: border-box;">-</span> <span class="pre" style="box-sizing: border-box;">lat_buffer,</span> <span class="pre" style="box-sizing: border-box;">lat</span> <span class="pre" style="box-sizing: border-box;">+</span> <span class="pre" style="box-sizing: border-box;">lat_buffer)</span></code><span style="color: #000000;"> et</span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">(lon</span> <span class="pre" style="box-sizing: border-box;">-</span> <span class="pre" style="box-sizing: border-box;">lon_buffer,</span> <span class="pre" style="box-sizing: border-box;">lon</span> <span class="pre" style="box-sizing: border-box;">+</span> <span class="pre" style="box-sizing: border-box;">lon_buffer)</span></code><span style="color: #000000;">.</span></p>
<section id="Select-area-of-interest" style="box-sizing: border-box;">
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px; text-align: left;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;">display_map(x=lon_range, y=lat_range)</pre>
</div>
</div>
<h3 style="box-sizing: border-box;">Créer un objet de requête</h3>
<p id="Create-query-object" style="box-sizing: border-box; text-align: left;">Remarquez que <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">lat_range</span></code>, <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">lon_range</span></code> et <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">time</span></code> ont tous été définis dans la cellule précédente, donc nous pouvons les utiliser comme variables ici. Nous allons les utiliser pour créer une <strong>requête</strong>.</p>
<p style="box-sizing: border-box; text-align: left;">La variable <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">query</span></code> ci-dessous est un dictionnaire Python. Elle peut être utilisée pour stocker des paramètres. La création d’une variable objet telle <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">query</span></code> permet de réutiliser des paramètres dans différentes fonctions qui acceptent les mêmes paramètres d’entrée.</p>
<p style="box-sizing: border-box; text-align: left;">Cela nous est utile car nous pouvons l’utiliser pour charger les données Landsat 8, puis l’utiliser à nouveau pour charger les données WOfS. Dans la cellule suivante, entrez le code suivant, puis exécutez-le.</p>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px; color: #000000; font-family: Arial, sans-serif; text-align: left;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px; text-align: left;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;"><span style="box-sizing: border-box;"></span>query = {
'x': lon_range,
'y': lat_range,
'resolution': (-30, 30),
'output_crs':'EPSG:6933',
'group_by': 'solar_day',
'time': (time),
}</pre>
</div>
</div>
</section>
<div class="admonition note" style="box-sizing: border-box; -webkit-font-smoothing: antialiased; padding: 12px; line-height: 24px; margin-bottom: 24px; background: #e7f2fa; color: #000000; text-align: left;">
<p class="admonition-title" style="box-sizing: border-box; line-height: 1; margin: -12px -12px 12px; font-size: inherit; font-family: inherit; font-variant-numeric: normal; font-variant-east-asian: normal; font-weight: bold; font-stretch: normal; text-rendering: auto; -webkit-font-smoothing: antialiased; color: #ffffff; background: #6ab0de; padding: 6px 12px; text-align: left;">Note</p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px; font-size: 16px; text-align: left;"><span style="color: #000000;">Remarquez que la structure du dictionnaire </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">query</span></code><span style="color: #000000;"> est légèrement différente de </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">dc.load</span></code><span style="color: #000000;"> ou </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">load_ard</span></code><span style="color: #000000;">. Chaque nom de paramètre est entre guillemets </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">''</span></code><span style="color: #000000;"> et est suivi de deux points </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">:</span></code><span style="color: #000000;">.</span></p>
</div>
<p style="text-align: left;"></p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@vertical+block@6e4c55ffbd98474caef38a5dda377935" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@96dc61f7758741c992c9c7de740be6dc">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@96dc61f7758741c992c9c7de740be6dc" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;">Dans la cellule suivante, nous chargeons les jeux de données Landsat et WOfS, en les nommant respectivement <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">ds_landsat</span></code> et <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">ds_wofs</span></code>.</p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;">Dans les fonctions ci-dessous, nous pouvons passer directement l’objet <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">query</span></code> en utilisant <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">**query</span></code> — cela donnera tous les paramètres définis dans <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">query</span></code> à la fonction.</p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;">Le principal avantage est que nous pouvons utiliser la même requête <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">query</span></code> pour Landsat 8 et WOfS, ce qui nous évite de la retaper et de faire des erreurs.</p>
<h3>Charger Landsat 8<a class="headerlink" href="https://training.digitalearthafrica.org/en/latest/session_6/02_water_extent.html#Load-Landsat-8" title="Permalink to this headline" style="box-sizing: border-box; color: #2980b9; text-decoration-line: none; cursor: pointer; display: inline-block; font-variant-numeric: normal; font-variant-east-asian: normal; font-weight: normal; font-stretch: normal; line-height: 1; font-family: inherit; font-size: 14px; text-rendering: auto; -webkit-font-smoothing: antialiased; visibility: hidden;"></a></h3>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;">Pour Landsat 8, nous pouvons utiliser la fonction <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">load_ard</span></code>.</p>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px; color: #000000;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px; text-align: left;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;"><span style="box-sizing: border-box;"></span>ds_landsat = load_ard(dc=dc,
products=['ls8_sr'],
measurements=['red', 'green', 'blue'],
**query)
ds_landsat
</pre>
</div>
</div>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; text-align: left;"><img alt="." class="no-scaled-link" src="/assets/courseware/v1/1cc4a0bfe351349d0b120085a18b4e50/asset-v1:digitalearthafrica+DEA101-fr+2021+type@asset+block/session6_landsat.png" /></p>
<h3>Charger WOfS<a class="headerlink" href="https://training.digitalearthafrica.org/en/latest/session_6/02_water_extent.html#Load-WOfS" title="Permalink to this headline" style="box-sizing: border-box; color: #2980b9; text-decoration-line: none; cursor: pointer; display: inline-block; font-variant-numeric: normal; font-variant-east-asian: normal; font-weight: normal; font-stretch: normal; line-height: 1; font-family: inherit; font-size: 14px; text-rendering: auto; -webkit-font-smoothing: antialiased; visibility: hidden;"></a></h3>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;">Pour WOfS, nous devons utiliser la fonction <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">dc.load</span></code>.</p>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px; color: #000000; text-align: left;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;"><span style="box-sizing: border-box;"></span>ds_wofs = dc.load(product="wofs_ls",
fuse_func=wofs_fuser,
**query
)
ds_wofs
</pre>
</div>
</div>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; text-align: left;"><img alt="." class="no-scaled-link" src="/assets/courseware/v1/91a675876c4e9b4fe81a7b592effcf15/asset-v1:digitalearthafrica+DEA101-fr+2021+type@asset+block/session6_wofs.png" /></p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@vertical+block@04e4e55519044efa9b272c0db72c6efa" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@06d283229e424040ad8c9dd8774e2dab">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@06d283229e424040ad8c9dd8774e2dab" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<h3>Comprendre les couches d’entités WOfS</h3>
<p style="text-align: left;">Les couches d’entités WOfS sont stockées sous forme de nombre binaire, où chaque chiffre du nombre est défini indépendamment ou non en fonction de la présence (1) ou de l’absence (0) d’une entité particulière. Vous trouverez ci-dessous une representation de la valeur décimale représentant les fonctionnalités.</p>
<table class="docutils align-default" style="text-align: left; border-spacing: 0px; margin-bottom: 24px; empty-cells: show; border: 1px solid #e1e4e5; color: #000000;" width="600" height="313"><colgroup style="text-align: left; box-sizing: border-box;"><col style="box-sizing: border-box; width: 247.516px;" /><col style="box-sizing: border-box; width: 139.234px;" /></colgroup>
<thead style="box-sizing: border-box; vertical-align: bottom; white-space: nowrap;">
<tr class="row-odd" style="box-sizing: border-box;"><th class="head" style="box-sizing: border-box; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; border-color: #e1e4e5; border-bottom-width: 2px; border-left-width: 0px;">
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px;">Attribut</p>
</th><th class="head" style="box-sizing: border-box; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; border-color: #e1e4e5; border-bottom-width: 2px;">
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px;">Valeur décimale</p>
</th></tr>
</thead>
<tbody style="box-sizing: border-box;">
<tr class="row-even" style="box-sizing: border-box;">
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: #f3f6f6; border-bottom-color: #e1e4e5; border-left-width: 0px; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">Pas de données</p>
</td>
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: #f3f6f6; border-bottom-color: #e1e4e5; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">1</p>
</td>
</tr>
<tr class="row-odd" style="box-sizing: border-box;">
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: transparent; border-bottom-color: #e1e4e5; border-left-width: 0px; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">Non contigu</p>
</td>
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: transparent; border-bottom-color: #e1e4e5; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">2</p>
</td>
</tr>
<tr class="row-even" style="box-sizing: border-box;">
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: #f3f6f6; border-bottom-color: #e1e4e5; border-left-width: 0px; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">Mer</p>
</td>
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: #f3f6f6; border-bottom-color: #e1e4e5; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">4</p>
</td>
</tr>
<tr class="row-odd" style="box-sizing: border-box;">
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: transparent; border-bottom-color: #e1e4e5; border-left-width: 0px; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">Terrain ou faible angle solaire</p>
</td>
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: transparent; border-bottom-color: #e1e4e5; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">8</p>
</td>
</tr>
<tr class="row-even" style="box-sizing: border-box;">
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: #f3f6f6; border-bottom-color: #e1e4e5; border-left-width: 0px; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">Pente élevée</p>
</td>
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: #f3f6f6; border-bottom-color: #e1e4e5; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">16</p>
</td>
</tr>
<tr class="row-odd" style="box-sizing: border-box;">
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: transparent; border-bottom-color: #e1e4e5; border-left-width: 0px; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">Ombre de nuage</p>
</td>
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: transparent; border-bottom-color: #e1e4e5; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">32</p>
</td>
</tr>
<tr class="row-even" style="box-sizing: border-box;">
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: #f3f6f6; border-bottom-color: #e1e4e5; border-left-width: 0px; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">Nuage</p>
</td>
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: #f3f6f6; border-bottom-color: #e1e4e5; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">64</p>
</td>
</tr>
<tr class="row-odd" style="box-sizing: border-box;">
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: transparent; border-bottom-width: 0px; border-bottom-color: #e1e4e5; border-left-width: 0px; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">L'eau</p>
</td>
<td style="box-sizing: border-box; vertical-align: middle; font-size: 14.4px; margin-top: 0px; margin-bottom: 0px; overflow: visible; padding: 8px 16px; background-color: transparent; border-bottom-width: 0px; border-bottom-color: #e1e4e5; border-left-color: #e1e4e5;">
<p style="box-sizing: border-box; line-height: 18px; margin: 0px; font-size: 16px;">128</p>
</td>
</tr>
</tbody>
</table>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;"><span color="#000000" style="color: #000000;">Par exemple, une valeur de 128 indique que de l’eau a été observée pour le pixel, tandis qu’une valeur de 32 indiquerait une ombre de nuage.</span></p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;"><span color="#000000" style="color: #000000;">Dans la cellule suivante, nous allons extraire uniquement les caractéristiques de l’eau à partir des données WOfS. Cela se fait en trouvant les valeurs où la mesure</span> <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">water</span></code> est égale à 128. En Python, nous pouvons trouver quels pixels ont une valeur de 128 en utilisant l’expression <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">==</span></code>.</p>
<h3>Extraire les pixels d’eau</h3>
<section id="Extract-the-water-pixels" style="box-sizing: border-box; color: #000000;">
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;">ds_valid_water = ds_wofs.water == 128
</pre>
</div>
</div>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; text-align: left;">Le tableau <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">ds_valid_water</span></code> ne contient pas les valeurs décimales des couches de caractéristiques WOfS. Au lieu de cela, il a la valeur <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">False</span></code> si le pixel n’est pas de l’eau, et <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">True</span></code> s’il est de l’eau. Vous pouvez le vérifier en visualisant le DataArray <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">ds_valid_water</span></code>.</p>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;"><span style="box-sizing: border-box;"></span>ds_valid_water
</pre>
</div>
</div>
</section>
<h3 style="box-sizing: border-box; color: #000000;">Calculez la surface en pixel</h3>
<section id="Calculate-the-area-per-pixel" style="box-sizing: border-box; font-family: Arial, sans-serif;">
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; text-align: left;">Le nombre de pixels peut être utilisé pour la superficie de la masse d’eau si la superficie du pixel est connue. Nous pouvons extraire la taille d’un pixel à partir du paramètre <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">resolution</span></code> de notre requête <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">query</span></code>, puis diviser la surface d’un seul pixel (en mètres carrés) par le nombre de mètres carrés dans un kilomètre carré.</p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; text-align: left;">En Python, <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">number**2</span></code> renvoie la valeur au carré de <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">number</span></code>.</p>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;">pixel_length = query["resolution"][1] # in metres
m_per_km = 1000 # conversion from metres to kilometres
area_per_pixel = pixel_length**2 / m_per_km**2
</pre>
</div>
</div>
</section>
<h3 id="Calculate-area-of-water-pixels" style="box-sizing: border-box;">Calculer la surface des pixels d’eau</h3>
<section id="Calculate-area-of-water-pixels" style="box-sizing: border-box;">
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; text-align: left;">Maintenant que nous savons quelle surface est couverte par un pixel, nous pouvons compter le nombre de pixels d’eau et le multiplier par cette valeur pour obtenir la surface totale couverte par l’eau.</p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; text-align: left;">Comme nous l’avons vu ci-dessus, le tableau <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">ds_valid_water</span></code> contient des valeurs <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">True</span></code> pour les pixels d’eau, et <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">False</span></code> sinon. Lorsque nous utilisons la fonction <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">.sum</span></code> elle compte les valeurs <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">True</span></code> comme 1, et<code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">False</span></code> comme 0. Par conséquent, la somme sera égale au nombre total de pixels d’eau pour ce pas de temps.</p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; text-align: left;">Ci-dessous, nous définissons les dimensions <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">x</span></code> et <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">y</span></code> pour être sûrs de faire la somme de tous les pixels sur les dimensions spatiales. Cela signifie que nous obtenons une somme de pixels pour chaque pas de temps. Cela nous permettra de suivre l’évolution de la surface de l’eau dans le temps.</p>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px; text-align: left;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;">ds_valid_water_pixel_sum = ds_valid_water.sum(dim=['x', 'y'])
ds_valid_water_area = ds_valid_water_pixel_sum * area_per_pixel</pre>
</div>
</div>
</section>
<p></p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@vertical+block@e221dd59bbca44d58618c1a6dd4d1d0c" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@50018f61a3b441f9bab9e4c3e5e8f642">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@50018f61a3b441f9bab9e4c3e5e8f642" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p>Maintenant que nous avons la superficie de l’eau dans chaque observation, nous pouvons tracer une série chronologique pour nous aider à identifier les dates où il y avait plus ou moins d’eau dans la zone d’intérêt.</p>
<p>Ci-dessous, il y a un code pour configurer, afficher et personnaliser le tracé. Les paramètres sont les suivants : </p>
<ul class="simple" style="box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding-left: 0px; list-style-position: initial; list-style-type: none; color: #000000; font-family: Arial, sans-serif;"></ul>
<ul>
<li style="text-align: left;"><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">plt.figure(figsize=(18,</span> <span class="pre" style="box-sizing: border-box;">4))</span></code><span style="font-family: Arial, sans-serif;">: crée un objet "figure'' pour contenir le graphique, et le rend long de 18 pouces et haut de 4 pouces.</span></li>
<li style="text-align: left;"><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">ds_valid_water_area.plot(marker='o',</span> <span class="pre" style="box-sizing: border-box;">color='#9467bd')</span></code><span style="font-family: Arial, sans-serif;">: trace les données de la zone d’eau avec des marqueurs circulaires en violet (code couleur HEX</span><span style="font-family: Arial, sans-serif;"> </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">#9467bd</span></code><span style="font-family: Arial, sans-serif;">)</span></li>
<li style="text-align: left;"><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">plt.title(</span><span class="pre" style="box-sizing: border-box;"><span color="#e74c3c" face="SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, Courier, monospace" style="color: #e74c3c; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace;"><span style="font-size: 12px; white-space: nowrap;">'Analyse des séries temporelles de la surface observée en eau')</span></span></span></code><span style="font-family: Arial, sans-serif;">: Donnez un titre au graphique</span></li>
<li style="text-align: left;"><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">plt.xlabel('Dates')</span></code><span style="font-family: Arial, sans-serif;">: Étiquette l’axe des x</span></li>
<li style="text-align: left;"><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">plt.ylabel('Waterbody</span> <span class="pre" style="box-sizing: border-box;">area</span> <span class="pre" style="box-sizing: border-box;">(km$^2$)')</span></code><span style="font-family: Arial, sans-serif;">: Étiquette l’axe des ordonnées. Les symboles</span><span style="font-family: Arial, sans-serif;"> </span><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">$</span></code><span style="font-family: Arial, sans-serif;"> </span><span style="font-family: Arial, sans-serif;">permettent l’utilisation de LaTeX, un langage de composition mathématique</span></li>
<li style="text-align: left;"><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">plt.tight_layout()</span></code><span style="font-family: Arial, sans-serif;">: Formate l’image de façon à ce que tous les axes soient clairement visibles.</span></li>
</ul>
<ul class="simple" style="box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; padding-left: 0px; list-style-position: initial; list-style-type: none; color: #000000; font-family: Arial, sans-serif;">
<li><span style="font-family: Arial, sans-serif;"></span></li>
</ul>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px; color: #000000; font-family: Arial, sans-serif;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px; text-align: left;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;"><span style="box-sizing: border-box;"></span>plt.figure(figsize=(18, 4))
ds_valid_water_area.plot(marker='o', color='#9467bd')
plt.title('Analyse des séries temporelles de la surface observée en eau')
plt.xlabel('Dates')
plt.ylabel('Waterbody area (km$^2$)')
plt.tight_layout()
</pre>
</div>
</div>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; font-family: Arial, sans-serif; color: #000000;"><img alt="." class="no-scaled-link" src="https://learn.digitalearthafrica.org/asset-v1:digitalearthafrica+DEA101-fr+2021+type@asset+block@session6_timesteps_fr.PNG" style="box-sizing: border-box; border: 0px; vertical-align: middle; width: 696.469px; float: left;" /></p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@vertical+block@5e1b9d7eb0bb4bf8bb77555daa00195e" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@4e06230f7571497280a930165c487cca">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@4e06230f7571497280a930165c487cca" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p style="text-align: left;">À partir du graphique ci-dessus, vous pouvez choisir n’importe quel pas de temps (entre 0 et 45) pour afficher le résultat sur WOfS et Landsat 8.</p>
<p style="text-align: left;">Par exemple, regardons le cinquième pas de temps, <code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">timestep</span> <span class="pre" style="box-sizing: border-box;">=</span> <span class="pre" style="box-sizing: border-box;">4</span></code>.</p>
<div class="highlight-none notranslate" style="box-sizing: border-box; border: 1px solid #e1e4e5; overflow-x: auto; margin: 1px 0px 24px; color: #000000; font-family: Arial, sans-serif;">
<div class="highlight" style="box-sizing: border-box; background: #f8f8f8; border: none; overflow-x: auto; margin: 0px; padding: 0px; text-align: left;">
<pre style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: pre; line-height: 1.4; margin-top: 0px; margin-bottom: 0px; padding: 12px; overflow: auto;"><span style="box-sizing: border-box;"></span>timestep = 4
# Plot water extent
fig, ax = plt.subplots(1, 2, figsize=(12, 6))
#plot the true colour image
ds_nearest_landsat = ds_landsat.sel(time=ds_wofs.time.isel(time=timestep), method='nearest')
rgb(ds_nearest_landsat, ax=ax[0])
# plot the water extent from WOfS
ds_wofs.isel(time=timestep).water.plot.imshow(ax=ax[1], cmap="Blues", add_colorbar=False)
# Titles
ax[0].set_title("Water Extent - Landsat"), ax[0].xaxis.set_visible(False), ax[0].yaxis.set_visible(False)
ax[1].set_title("Water Extent - WOFS"), ax[1].xaxis.set_visible(False), ax[1].yaxis.set_visible(False)
plt.show()
</pre>
</div>
</div>
<p style="text-align: left; box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; font-family: Arial, sans-serif; color: #000000;"><img alt="." class="no-scaled-link" src="https://learn.digitalearthafrica.org/asset-v1:digitalearthafrica+DEA101+2021+type@asset+block@5.PNG" style="box-sizing: border-box; border: 0px; vertical-align: middle; width: 696.469px;" /></p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;"><font color="#000000">Ce code utilise des paramètres supplémentaires pour personnaliser l’affichage, notamment en permettant d’avoir deux tracés ensemble.</font></p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px 0px 24px; font-size: 16px; color: #000000; text-align: left;"><font color="#000000">Essayez différentes valeurs de </font><code class="docutils literal notranslate" style="box-sizing: border-box; font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', Courier, monospace; font-size: 12px; white-space: nowrap; max-width: 100%; background-image: initial; background-color: #ffffff; border: 1px solid #e1e4e5; padding: 2px 5px; color: #e74c3c; overflow-x: auto;"><span class="pre" style="box-sizing: border-box;">timestep</span></code><span style="color: rgb(0, 0, 0);"> </span><font color="#000000">- pouvez-vous trouver une image où le lac est asséché ?</font></p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@vertical+block@51dd72bb677443c9ac24d418f05ce4cf" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@6995e7c2b9c947da9a8a594b53112a08">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@6995e7c2b9c947da9a8a594b53112a08" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p style="text-align: left;">Si vous êtes curieux de savoir comment fonctionne une étude de cas existante, vous pouvez l’ouvrir et l’exécuter dans la sandbox :</p>
<ol style="text-align: left;">
<li>À partir du dossier principal de l’Environnement de jeu, ouvrez le dossier <strong>Real_world_examples</strong></li>
<li>Double-cliquez sur le notebook <strong>Water_extent_WOfS.ipynb</strong> pour l’ouvrir</li>
</ol>
<p style="text-align: left;">Le notebook a déjà été exécuté, vous pouvez donc le lire étape par étape. Cependant, vous pouvez trouver utile d’effacer les sorties et d’exécuter chaque cellule étape par étape pour voir comment elle fonctionne. Vous pouvez le faire en cliquant sur <b>Noyau -> Redémarrer le noyau et effacer</b>. Lorsqu’on vous demande si vous voulez redémarrer le noyau, cliquez sur<b> Restart</b>.</p>
<div class="admonition note" style="box-sizing: border-box; -webkit-font-smoothing: antialiased; padding: 12px; line-height: 24px; margin-bottom: 24px; background: #e7f2fa; color: #000000;">
<p class="admonition-title" style="box-sizing: border-box; line-height: 1; margin: -12px -12px 12px; font-size: inherit; font-family: inherit; font-variant-numeric: normal; font-variant-east-asian: normal; font-weight: bold; font-stretch: normal; text-rendering: auto; -webkit-font-smoothing: antialiased; color: #ffffff; background: #6ab0de; padding: 6px 12px; text-align: left;">Note</p>
<p style="box-sizing: border-box; line-height: 24px; margin: 0px; font-size: 16px; text-align: left;"><span color="#000000" style="color: #000000;">Si vous voulez le modifier de manière significative, nous vous recommandons d’en faire une copie, comme vous l’avez fait dans Session 1.</span></p>
</div>
<p style="text-align: left;">Il existe de nombreuses similitudes entre le notebook que vous avez créé dans cette session et le notebook existant. Notez peut-être ce qui est similaire et ce qui est différent. </p>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>
<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@vertical+block@d893a149da2f45308466571870fee92c" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@a2b64991cb9d45f69f75e554289b1a7f">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@html+block@a2b64991cb9d45f69f75e554289b1a7f" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<p style="text-align: left;">Toutes nos félicitations! Vous avez créé votre propre notebook d’analyse de variation d’étendue d’eau. Il est comparable au <a href="https://github.com/digitalearthafrica/deafrica-sandbox-notebooks/blob/master/Real_world_examples/Water_extent_WOfS.ipynb" target="[object Object]">notebook existant</a>.</p>
<p>Vous avez maintenant construit votre deuxième étude de cas ! Vous souhaitez réfléchir à ce qui était similaire et différent entre les deux. Y a-t-il des morceaux de code que vous pourriez réutiliser pour une nouvelle analyse ? Comment pourriez-vous modifier vos études de cas pour effectuer des analyses plus complexes ?</p>
<p>Si vous souhaitez pousser l’expérience plus loin, essayez d’exécuter le code avec différentes zones. Avez-vous appris quelque chose d’intéressant à partager avec nous ?</p>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@problem+block@9058a1425f824031b0e440c79ceb0eff">
<div class="xblock xblock-public_view xblock-public_view-problem xmodule_display xmodule_ProblemBlock" data-course-id="course-v1:digitalearthafrica+DEA101-fr+2021" data-block-type="problem" data-usage-id="block-v1:digitalearthafrica+DEA101-fr+2021+type@problem+block@9058a1425f824031b0e440c79ceb0eff" data-request-token="21b26072ff0a11ee8182fd390e3a51ef" data-graded="True" data-has-score="True">
<div class="page-banner"><div class="alert alert-warning"><span class="icon icon-alert fa fa fa-warning" aria-hidden="true"></span><div class="message-content">Sondage : Étude de cas sur l'eau is only accessible to enrolled learners. Sign in or register, and enroll in this course to view it.</div></div></div>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.be68acdff619.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>