diff --git a/Inst_eddies/Analysis/plot_velocity.py b/Inst_eddies/Analysis/plot_velocity.py index c9a15661f68e4bca401a075df9902b07ade9201b..e8d5e9e0c70a400e05d0fa715cd87d6764fcb7f0 100755 --- a/Inst_eddies/Analysis/plot_velocity.py +++ b/Inst_eddies/Analysis/plot_velocity.py @@ -1,5 +1,10 @@ #!/usr/bin/env python3 +"""This script just plots a velocity field. There is not much in it +that is special to surface ocean current coming from AVISO ADT files. + +""" + import numpy as np import cartopy.crs as ccrs import sys diff --git a/Inst_eddies/Documentation_texfol/documentation.tex b/Inst_eddies/Documentation_texfol/documentation.tex index 7f2bb65dc847dbd24a960005389cc3fcac3f206f..8e08378abfb56302f4197f0a4d2060408b9082f9 100644 --- a/Inst_eddies/Documentation_texfol/documentation.tex +++ b/Inst_eddies/Documentation_texfol/documentation.tex @@ -1,4 +1,4 @@ -\documentclass[a4paper,french]{article} +\documentclass[a4paper,english,french]{article} \usepackage[utf8x]{inputenc} @@ -23,6 +23,7 @@ \usepackage{algorithm} \newcommand{\ud}{\mathrm{d}} +\newcommand{\Eng}[1]{\textit{\foreignlanguage{english}{#1}}} \renewcommand{\algorithmicfor}{\textbf{pour}} \renewcommand{\algorithmicend}{\textbf{fin}} @@ -1707,6 +1708,24 @@ pourquoi. \section{Améliorations, prolongements} +Le stockage de la vitesse en chaque point d'un contour serait +problématique. Le format shapefile ne permet de stocker qu'un scalaire, +avec le format PolygonM. Le format GeoJSon n'est pas adapté non plus : +\href{https://tools.ietf.org/html/rfc7946#section-3.1.1}{spécification + GeoJSon}, +\href{https://macwright.com/2015/03/23/geojson-second-bite.html#position}{More + than you ever wanted to know about GeoJSON, § \og + Position\fg{}}. Dans +\href{https://macwright.com/2015/03/23/geojson-second-bite.html}{What + you can’t do with GeoJSON} : \og \Eng{Positions don’t have + attributes. [\dots] there’s no clear answer for how to represent + that data. You can store additional data in positions as fourth and + fifth coordinates, or in properties as an array with the same length + as the coordinate array, but neither option is well-supported by the + ecosystem of tools. The Simple Features Specification, which + directly inspired GeoJSON and most GIS formats, doesn’t support this + notion of attributes-at-positions.}\fg{}. + Dans \verb+set_all_outerm+, si le domaine considéré n'est pas global, comment traiter un tourbillon au bord du domaine ? La taille du contour le plus extérieur peut être artificiellement diminuée. (Ce diff --git a/Trajectories/Documentation_texfol/documentation.tex b/Trajectories/Documentation_texfol/documentation.tex index 6145cda89fc5edb030f8fcdcd7c6c4d81bf51a86..5e8e75e86f20f959a744f7411aa36594d68cf49b 100644 --- a/Trajectories/Documentation_texfol/documentation.tex +++ b/Trajectories/Documentation_texfol/documentation.tex @@ -2,6 +2,8 @@ \usepackage[utf8]{inputenc} +\usepackage{amsmath} + \usepackage[T1]{fontenc} \usepackage{lmodern} @@ -30,7 +32,7 @@ Lorsque plusieurs tourbillons fusionnent ou lorsqu'un tourbillon se divise, il peut être utile de suivre dans le futur un des tourbillons issus de la division, ou de suivre dans le passé un des tourbillons -fusionnant, jugé comme tourbillon prinicpal dans l'événement de fusion +fusionnant, jugé comme tourbillon principal dans l'événement de fusion ou division. Le graphe des recouvrements est complètement neutre et objectif sur cette question : il représente toute les divisions et fusions par des arcs. On peut donc traiter ce graphe pour @@ -42,7 +44,7 @@ le graphe en composantes connexes, ou chercher le graphe amont ou aval Des bibliothèques Python de traitement de graphe semblent bien adaptées pour cette partie. En Python. Création d'une liste de chemins -qui recouvre tout le graphe. +qui recouvrent tout le graphe. Vocabulaire : fusion pour \Eng{merging} et division pour \Eng{splitting}. @@ -66,6 +68,28 @@ peuvent être quelconques. Le graphe des segments est-il un lissage du graphe des tourbillons instantanés ? +\`A une jonction entre segments (division ou fusion), calcul sur sept +jours avant et après la jonction, pour chaque segment, de moyennes sur +le segment : $\overline{\Delta N_\mathrm{Ro}}$, +$\overline{\Delta N_\mathrm{Bu}}$, $\bar d$ et d'écarts-types sur le +segment : $\sigma_{\Delta N_\mathrm{Ro}}$, +$\sigma_{\Delta N_\mathrm{Bu}}$, $\sigma_d$. Le nombre de Rossby +$N_\mathrm{Ro}$ : +\begin{equation*} + N_\mathrm{Ro} = \frac{|v|}{R |f|} +\end{equation*} +est calculé sur le contour de vitesse maximale, et le nombre de Burger +$N_\mathrm{Bu}$ : +\begin{equation*} + N_\mathrm{Bu} = \frac{g A}{R^2 f^2} +\end{equation*} +où $A$ est l'amplitude, est calculé sur le contour extérieur. $d$ est +la distance entre les extremums. Calcul d'une fonction de coût à +partir des grandeurs ci-dessus, analogue à celle de Pegliasco (2015 +k0998, équation (1)) qui permet de faire un choix à travers la +jonction. Ou bien utilisation de la fonction de coût de Le Vu (2018 +k1000). + Les trajectoires forment une partition du graphe en géodésiques. \verb+cost_function.py+. En extrayant les $10^6$ premières arêtes dans diff --git a/Trajectories/cost_function.py b/Trajectories/cost_function.py index d2e5470428b0065e9c6e8fb864edc3e5a0385147..3bb03ce95dd0b464b2351bb4f14aa1cf3a7f3c44 100755 --- a/Trajectories/cost_function.py +++ b/Trajectories/cost_function.py @@ -1,17 +1,17 @@ #!/usr/bin/env python3 -"""This script takes the graph of segments without cost functions and -computes the non-local cost functions applied to edges. +"""This script takes the graph of segments without cost and computes +the non-local cost applied to edges. Input: -- "e_overestim.txt", expected to be in the current directory +-- "e_overestim.txt", expected to be in the current directory; -- the graph of segments without cost functions +-- the graph of segments without cost; -- the SHPC +-- the SHPC. -Output: the graph of segments with cost functions +Output: the graph of segments with cost. The inst_eddies property of vertices is not modified by this script. @@ -210,7 +210,7 @@ for edge in g.edges(): Delta_R_Vmax = g.vp.last_av_rad[source_node] \ - g.vp.first_av_rad[target_node] - # Calculate the cost function and assign to the edge: + # Calculate the cost and assign to the edge: g.ep.cost_function[edge] \ = math.sqrt(((Delta_Cent - delta_cent_mean) / delta_cent_std)**2 + ((Delta_Ro - delta_ro_mean) / delta_ro_std)**2 diff --git a/Trajectories/trajectories.py b/Trajectories/trajectories.py index f8e1a81c81db94cbb09d171f2fd5f6186a7f6058..dfd94c29d79a56a74c9b44ad07805c35ce572a2d 100755 --- a/Trajectories/trajectories.py +++ b/Trajectories/trajectories.py @@ -1,11 +1,11 @@ #!/usr/bin/env python3 -"""This script loads the graph of segments, with cost functions, and +"""This script loads the graph of segments, with cost values, and identifies trajectories. -Input: the graph of segments produced by Graph-tool (in gt or graphml -format). Output: trajectories as lists of segments and as lists of -instantaneous eddies, in JSon files. +Input: the graph of segments, with cost values, produced by Graph-tool +(in gt or graphml format). Output: trajectories as lists of segments +and as lists of instantaneous eddies, in JSon files. By construction, the segments and the instantaneous eddies in each trajectory are in ascending order.