Skip to content

Commit a17cdca

Browse files
committed
Update README.md
1 parent a5a38ec commit a17cdca

File tree

1 file changed

+17
-71
lines changed

1 file changed

+17
-71
lines changed

README.md

+17-71
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,26 @@ New version compatible with [VirtualFleet 0.4.0](https://virtualfleet.readthedoc
1010

1111
# Documentation (preliminary)
1212

13-
## Working design of the procedure
13+
## Overall prediction procedure
1414
1. Given a specific float cycle to predict ``C``, we extract:
1515
- space/time position of the previous cycle ``C-1``,
1616
- configuration parameters of the previous cycle ``C-1``, such as parking depth, profiling depth and cycling period using the EA API (but these can be overwritten if necessary).
1717

18-
2. We download the hourly CMEMS velocity fields for a large region around the previous cycle ``C-1`` coordinates
18+
2. We download the daily CMEMS velocity fields for a region around the previous cycle ``C-1`` coordinates
1919

2020
3. We run a VirtualFleet simulation:
2121
- where we use a large number of virtual floats located with a random perturbations around the float cycle ``C-1`` position in space/time
2222
- for the cycle ``C-1`` duration
2323

2424
4. We compute the most probable position of the float cycle ``C`` and prediction metrics and figures.
2525

26-
The reason why we make random perturbations of the float cycle ``C-1`` position is not because the float position is uncertain (with GPS it is fairly accurate most of the time), but because it is a cheap way to account for errors in the velocity field. Indeed, we assume that the _phase_ of the velocity field used to advect floats is the primary source of uncertainties to predict the final position. We do not account for strain errors at this point.
26+
The reason why we make random perturbations of the float cycle ``C-1`` position is not because the float position is uncertain (with GPS it is fairly accurate most of the time), but because it is a cheap way to account for errors in the velocity field. Indeed, we assume that the _phase_ of the velocity field used to advect floats is the primary source of uncertainties to predict the final position. We do not account for velocity shear/strain errors at this point.
2727

2828
## Installation
29-
- Get this repository:
29+
30+
Our goal is to distribute VFrecovery as a standalone pipy package. In the meantime, one need to work with this repo only.
31+
32+
- Download his repository:
3033
```bash
3134
git clone [email protected]:euroargodev/VirtualFleet_recovery.git
3235
```
@@ -38,9 +41,9 @@ export PATH="/Users/gmaze/git/github/euroargodev/VirtualFleet_recovery/cli:$PATH
3841
```bash
3942
mamba env create -f environment.yml
4043
```
41-
- Install the experimental VirtualFleet "GulfStream" branch:
44+
- Install the last VirtualFleet version:
4245
```bash
43-
git clone --branch gulf-stream [email protected]:euroargodev/VirtualFleet.git
46+
git clone [email protected]:euroargodev/VirtualFleet.git
4447
```
4548

4649
## Command line instructions
@@ -62,7 +65,9 @@ recovery_prediction.py 6902919 99
6265

6366
A few options are available:
6467
```
65-
usage: recovery_prediction.py [-h] [--nfloats NFLOATS] [--output OUTPUT] [--velocity VELOCITY] [--save_figure SAVE_FIGURE] [--save_sim SAVE_SIM] [--vf VF] [--json] [--cfg_parking_depth CFG_PARKING_DEPTH] [--cfg_cycle_duration CFG_CYCLE_DURATION] wmo cyc
68+
usage: recovery_prediction.py [-h] [--nfloats NFLOATS] [--output OUTPUT] [--velocity VELOCITY] [--save_figure SAVE_FIGURE] [--save_sim SAVE_SIM] [--vf VF] [--json]
69+
[--cfg_parking_depth CFG_PARKING_DEPTH] [--cfg_cycle_duration CFG_CYCLE_DURATION]
70+
wmo cyc
6671
6772
VirtualFleet recovery predictor
6873
@@ -86,14 +91,15 @@ optional arguments:
8691
Virtual floats cycle duration in [hours], default: use previous cycle value
8792
8893
This script can be used to make prediction of a specific float cycle position.
89-
This script is for testing the prediction system.
90-
Note that in order to download online velocity fields from 'https://nrt.cmems-du.eu', you need to set the environment variables: MOTU_USERNAME and MOTU_PASSWORD.
94+
This script can be used on past or unknown float cycles.
95+
Note that in order to download online velocity fields from the Copernicus Marine Data Store, you need to have the
96+
appropriate credentials file setup.
9197
92-
(c) Argo-France/Ifremer/LOPS, 2022
98+
(c) Argo-France/Ifremer/LOPS, 2022-2024
9399
```
94100

95101
So, don't forget to:
96-
- set the environment variables ``MOTU_USERNAME`` and ``MOTU_PASSWORD`` to be able to download the velocity field
102+
- set up your environment to be able to download velocity fields from the Copernicus Marine Toolbox
97103
- use the option ``vf`` to specify where the VirtualFleet software has been cloned (this is temporary and will change once VirtualFleet will be available on Pypi).
98104

99105
### Example
@@ -105,63 +111,3 @@ Below is an example of this prediction for the 99th cycle of the 6902919 float.
105111
The really observed 99th cycle is shown at the tip of the arrow (red point) starting from the previous 98th cycle.
106112
The VirtualFleet Recovery prediction is in the probabilistic red shading: the most probable position predicted is in the redder region.
107113
![Figure](docs/img/vfrecov_predictions_recap_VELARMOR3D_NF2000_CYCDUR240_PDPTH1000.png)
108-
109-
## web API (highly experimental)
110-
111-
In order to easily use prediction results with other (web)applications, we set-up a small web API based on [Flask](https://flask.palletsprojects.com/).
112-
113-
### Server set up
114-
115-
If you used the environment provided with this repo you already have Flask installed.
116-
In order to set up the (dev) server to access the VirtualFleet Recovery web API, open a terminal, navigate to the ``webapi`` folder and type:
117-
```bash
118-
export FLASK_DEBUG=True
119-
export FLASK_APP=myapp
120-
flask -A myapp run
121-
```
122-
123-
### Usage
124-
125-
You should know the <IP> address of the server where the Flask app is running.
126-
127-
#### Make a prediction
128-
129-
**Method 1**
130-
131-
Simply visit the prediction triggering form at:
132-
133-
```
134-
http://<IP>:5000/trigger
135-
```
136-
137-
**Method 2**
138-
139-
Go the full webAPI way: to make a prediction for the position of the ``CYC`` cycle from float ``WMO``, send a POST, request to:
140-
```
141-
http://<IP>:5000/predict/<WMO>/<CYC>
142-
```
143-
This will return a json file with the prediction results. Predictions are saved in cache, so that if you send a request for a prediction already computed, you will have the json results right away.
144-
145-
Options available :
146-
- ``velocity``: to select the velocity field to use, it can be ``ARMOR3D`` (default) or ``GLORYS``
147-
- ``nfloats``: to set the number of virtual floats to use in the probabilistic prediction. The default value is 2000.
148-
- ``cfg_parking_depth``: to set the parking depth, in db, of virtual floats. The default values is that of the previous cycle.
149-
- ``cfg_cycle_duration``: to set the cycle duration, in hours, of virtual floats. The default values is that of the previous cycle.
150-
151-
Options can be used, or combined:
152-
```
153-
http://<IP>:5000/predict/<WMO>/<CYC>?nfloats=1000
154-
http://<IP>:5000/predict/<WMO>/<CYC>?velocity=ARMOR3D
155-
http://<IP>:5000/predict/<WMO>/<CYC>?nfloats=1000&velocity=GLORYS
156-
```
157-
158-
#### Visualise prediction results
159-
160-
We made a small webpage with figures and prediction data results. It is accessible at:
161-
```
162-
http://<IP>:5000/<WMO>/<CYC>
163-
# or
164-
http://<IP>:5000/results/<WMO>/<CYC>
165-
```
166-
Here is a screenshot:
167-
![Screenshot 2022-12-06 at 16 14 17](https://user-images.githubusercontent.com/1956032/205950317-935b815f-c6fd-4e67-8bc3-71ab27d305d0.png)

0 commit comments

Comments
 (0)