From 901088bd4d3a5bf69dc015ad4ad419ea53332243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20G=C3=B3mez?= Date: Wed, 30 Nov 2022 16:09:40 +0100 Subject: [PATCH] small string changes --- .../Sentinel2_example_notebook.ipynb | 129 +++++------------- 1 file changed, 36 insertions(+), 93 deletions(-) diff --git a/examples/Sentinel_2_example_notebook/Sentinel2_example_notebook.ipynb b/examples/Sentinel_2_example_notebook/Sentinel2_example_notebook.ipynb index 479d1958..dc8adf15 100644 --- a/examples/Sentinel_2_example_notebook/Sentinel2_example_notebook.ipynb +++ b/examples/Sentinel_2_example_notebook/Sentinel2_example_notebook.ipynb @@ -1,18 +1,12 @@ { "cells": [ - { - "cell_type": "markdown", - "id": "74b1ac03", - "metadata": {}, - "source": [ - "# Sentinel-2 example notebook" - ] - }, { "cell_type": "markdown", "id": "79556fc6", "metadata": {}, "source": [ + "# Sentinel-2 example notebook\n", + "\n", "This notebook showcases how to use `PASEOS` to simulate **Sentinel2-B (S2B)**. In particular, the notebook shows how to create `space_actors` orbiting as the **S2B** around Earth. In addition, it shows how to add a `power` device and demonstrates how to register activities to perform onboard data acquisition and processing to detect **volcanic eruptions** on `Sentinel-2 L1C data`.
**DISCLAIMER**: the notebook requires `rasterio` and `scikit-image` to run correctly, which is not included in the packets required to install `PASEOS`. To install `rasterio` you can use:
```conda install -c conda-forge rasterio``` or alternatively ```pip install rasterio```
\n", "
To install `scikit-image` you can use:
```conda install scikit-image``` or alternatively ```pip install scikit-image```
" ] @@ -65,15 +59,11 @@ "id": "3670f211", "metadata": {}, "source": [ - "# 1) - Instantiate Sentinel 2 space actors" - ] - }, - { - "cell_type": "markdown", - "id": "cd78d83a", - "metadata": {}, - "source": [ - "First of all, let's create the scaffolds for **S2B**. The scaffolds are objects which are not equipped with any `communication_device` nor `power_devices`. Furthermore, they neither have any `orbit`. " + "# 1) - Instantiate Sentinel 2 space actors\n", + "\n", + "First of all, let's create the scaffolds for **S2B**. The scaffolds are objects which are not equipped with any `communication_device` nor `power_devices`. Furthermore, they neither have any `orbit`. \n", + "\n", + "S2B will be the local actor, i.e. the one paseos models. In this example, we only model this one satellite." ] }, { @@ -92,15 +82,11 @@ "id": "ba6a533b", "metadata": {}, "source": [ - "#### 1.a) - Add an orbit for S2B" - ] - }, - { - "cell_type": "markdown", - "id": "9f77772e", - "metadata": {}, - "source": [ - "Since **S2B** is orbiting around Earth, let's define `earth` as `pykep.planet` object. " + "#### 1.a) - Add an orbit for S2B\n", + "\n", + "Since **S2B** is orbiting around Earth, let's define `earth` as `pykep.planet` object. \n", + "\n", + "Internally, paseos uses pykep.planet objects to model gravitational acceleration and Keplerian orbits." ] }, { @@ -169,14 +155,8 @@ "id": "d3cb8c32", "metadata": {}, "source": [ - "### 1.b) - Add communication and power devices" - ] - }, - { - "cell_type": "markdown", - "id": "c510ec67", - "metadata": {}, - "source": [ + "### 1.b) - Add communication and power devices\n", + "\n", "Adding power devices. Max battery level: 102 Ah @ 28V is 2.81 kWh (effect of aging is neglected). To identify the charging rate, we are assuming to be dependent only by the power of solar panels. We are neglecting eventual charging rate limits due to battery technology. The solar-panels power is 2300 W at begin of life and 1730 W at end of life.
Please, refer to: [Copernicus: Sentinel-2](https://www.eoportal.org/satellite-missions/copernicus-sentinel-2#space-segment.)" ] }, @@ -198,14 +178,8 @@ "id": "a1f00fd5", "metadata": {}, "source": [ - "# 2) - Instantiate PASEOS simulation" - ] - }, - { - "cell_type": "markdown", - "id": "8d7f07aa", - "metadata": {}, - "source": [ + "# 2) - Instantiate PASEOS simulation\n", + "\n", "To instantiate `PASEOS`, we consider **S2B** as `local_actor`. The initial time is set to `today`." ] }, @@ -216,28 +190,24 @@ "metadata": {}, "outputs": [], "source": [ - "cfg=load_default_cfg()\n", + "cfg=load_default_cfg() # loading cfg to modify defaults\n", "cfg.sim.start_time=today.mjd2000 * pk.DAY2SEC # convert epoch to seconds\n", "cfg.sim.activity_timestep = 0.5 # update rate for plots. \n", "sim = paseos.init_sim(S2B, cfg)" ] }, - { - "cell_type": "markdown", - "id": "c0097d30", - "metadata": {}, - "source": [ - "## 3) - Dealing with PASEOS activities " - ] - }, { "cell_type": "markdown", "id": "087004a9", "metadata": {}, "source": [ + "## 3) - Dealing with PASEOS activities \n", + "\n", "Here we demonstrate how you can use `PASEOS` to perform activities. To this aim, we will use `detection of volcanic eruptions` as use case, assuming it will be possible to run it onboard `S2B`.
We exploit a simplified version of the algorithm `[1]`, which leverages the spectral bands `B8A`, `B11` and `B12` to create a binary-map containing pixels marked as thermal anomalies. To detect the volcanic eruptions, we cluster those pixels in bounding boxes and return their coordinates to simulate an alert creation.
We will assume `S2B` will acquire images and then process them by using [1]. In this notebook, we assume to be able to detect the following images regardless of their proper geographical position. We thank the `ESA` project `Sentinel2_L0` for providing images and the implementation of [1].
\n", + "\n", "**References**:
\n", "`[1] Massimetti, Francesco, et al. \"\"Volcanic hot-spot detection using SENTINEL-2: a comparison with MODIS–MIROVA thermal data series.\"\" Remote Sensing 12.5 (2020): 820.`
\n", + "\n", "The next cell will download the files that are needed to execute the next parts of the notebook. The files belong to the `Sentinel2_L0` dataset project (to be released soon with GPL license)." ] }, @@ -259,19 +229,13 @@ " urllib.request.urlretrieve(\"https://actcloud.estec.esa.int/actcloud/index.php/s/e0MyilW1plYdehL/download\", \"Mayon_02.tif\")" ] }, - { - "cell_type": "markdown", - "id": "eb838004", - "metadata": {}, - "source": [ - "### 3.a) - PASEOS visualization " - ] - }, { "cell_type": "markdown", "id": "105d2dcb", "metadata": {}, "source": [ + "### 3.a) - PASEOS visualization \n", + "\n", "`PASEOS` offers a visualization tool that can be used to display the position of `S2B` around its orbit, the state of charge of the battery, and the name of the performed activity.
To enable the visualization, let's define a `plotter`.
**N.B.** `PASEOS` visualization is supported only for `Jupyter` but not for [Visual Studio Code](https://code.visualstudio.com/). " ] }, @@ -291,14 +255,8 @@ "id": "33b8fa5f", "metadata": {}, "source": [ - "### 3.b) - Registering activities " - ] - }, - { - "cell_type": "markdown", - "id": "0f001501", - "metadata": {}, - "source": [ + "### 3.b) - Registering activities \n", + "\n", "The next lines will show how to register an activity to simulate data acquisition on **S2B**.
Each activity is bound to an `asynchronous function`. Let's define the asynchornous function `acquire_data_async()` as follow." ] }, @@ -469,14 +427,8 @@ "id": "7f8b9b67", "metadata": {}, "source": [ - "### 3.c) - Performing activities." - ] - }, - { - "cell_type": "markdown", - "id": "b63750f7", - "metadata": {}, - "source": [ + "### 3.c) - Performing activities.\n", + "\n", "We can now perform the activities. In scheduling the activities, we assume that data are acquired and stored into the mass memory to be, then, processed during the off part of the satellite duty cycle. Please, refer to: [Copernicus: Sentinel-2](https://www.eoportal.org/satellite-missions/copernicus-sentinel-2#space-segment.).
**N.B.** Notice that, when `sim.perform_activity(...)` is called, the keyword `await` is needed **only for Jupyter notebooks** to ensure the correct management of asynchronous functions. **Remove it otherwise**. " ] }, @@ -524,14 +476,8 @@ "id": "08173794", "metadata": {}, "source": [ - "### 3.d) - Showing detected volcanic eruptions" - ] - }, - { - "cell_type": "markdown", - "id": "71073cdb", - "metadata": {}, - "source": [ + "### 3.d) - Showing detected volcanic eruptions\n", + "\n", "The next plot will show an example of onboard coarse volcanic eruptions detection on some Sentinel-2 L1C tiles. The different eruptions will be surrounded a bounding box, and their coordinates will be printed to raise an alert." ] }, @@ -567,21 +513,13 @@ " print(\"ALERT! Eruption found at: \\n\\t Top left corner(lon, lat): \"+str(coords[0]) +\"\\n\\t bottom right corner(lon, lat): \"+str(coords[1])+\"\\n\")\n", " print(\"\\n\")" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "da80b45f", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { "kernelspec": { - "display_name": "paseos", + "display_name": "Python 3.10.6 ('paseos')", "language": "python", - "name": "paseos" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -594,6 +532,11 @@ "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.6" + }, + "vscode": { + "interpreter": { + "hash": "457d73575bcd07fce3b582d06bfae9446395c25f1ea618852d5f58e28a465e48" + } } }, "nbformat": 4,