Skip to content
Snippets Groups Projects
Commit 4d80f25c authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Polish

parent b84fb5dd
No related branches found
No related tags found
No related merge requests found
...@@ -123,5 +123,4 @@ def plot_all(dict_list, label = None): ...@@ -123,5 +123,4 @@ def plot_all(dict_list, label = None):
if __name__ == "__main__": if __name__ == "__main__":
d = read() d = read()
plot_all([d]) plot_all([d])
plt.show() plt.show()
#!/usr/bin/env python3 #!/usr/bin/env python3
"""Note: the creation of ishape_last.txt assumes no missing date in """Note: the creation of ishape_last.txt assumes no missing date in
the output.""" the filtered output."""
import shapefile import shapefile
import argparse import argparse
......
#!/usr/bin/env python3 #!/usr/bin/env python3
"""Must be run from directory containing edgelist.csv, ishape_last.txt
and SHP-triplet directory for interpolated eddies.
"""
def compute_ishape(n, k1, ishape_last): def compute_ishape(n, k1, ishape_last):
"""n: node, tuple (date_index, eddy_index). k1: first date in triplet """n: node, tuple (date_index, eddy_index). k1: first date in triplet
of shapefiles. of shapefiles.
...@@ -33,6 +38,10 @@ if __name__ == "__main__": ...@@ -33,6 +38,10 @@ if __name__ == "__main__":
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import networkx as nx import networkx as nx
if len(sys.argv) != 2:
sys.exit("Required argument: directory containing triplet of "
"shapefiles, result of extracting the eddies at all dates")
shp_tr_dir = sys.argv[1] shp_tr_dir = sys.argv[1]
G = report_graph.read_eddy_graph() G = report_graph.read_eddy_graph()
ishape_last = np.loadtxt(path.join(shp_tr_dir, "ishape_last.txt"), ishape_last = np.loadtxt(path.join(shp_tr_dir, "ishape_last.txt"),
...@@ -63,7 +72,7 @@ if __name__ == "__main__": ...@@ -63,7 +72,7 @@ if __name__ == "__main__":
nx.draw_networkx(G, pos, edgelist = G.edges(component), nx.draw_networkx(G, pos, edgelist = G.edges(component),
nodelist = component, edge_color=color, node_size=10, nodelist = component, edge_color=color, node_size=10,
node_color=color, with_labels=False) node_color=color, with_labels=False)
H= G.subgraph(component) H = G.subgraph(component)
t = nx.topological_sort(H) t = nx.topological_sort(H)
ancestor = next(t) ancestor = next(t)
plt.annotate(str(ancestor), pos[ancestor], color = color, plt.annotate(str(ancestor), pos[ancestor], color = color,
......
...@@ -1254,8 +1254,8 @@ Le processus $m$ envoie au processus $m - 1$. Cf. figure ...@@ -1254,8 +1254,8 @@ Le processus $m$ envoie au processus $m - 1$. Cf. figure
\includegraphics[width=\textwidth]{processes} \includegraphics[width=\textwidth]{processes}
\caption[Raccordement des processus]{Raccordement des processus. Les \caption[Raccordement des processus]{Raccordement des processus. Les
comparaisons représentées ici en couleurs sont faites par le comparaisons représentées ici en couleurs sont faites par le
processus m. En rouge dans la boucle principale, en bleu, vert et processus $m$. En rouge dans la boucle principale, en bleu, vert
marron dans l'épilogue.} et marron dans l'épilogue.}
\label{fig:processes} \label{fig:processes}
\end{figure} \end{figure}
Il faut, pour $m < n_p - 1$ : Il faut, pour $m < n_p - 1$ :
...@@ -1391,10 +1391,11 @@ Exemples : cf. tableaux (\ref{tab:m2}) et (\ref{tab:m3}) et figures ...@@ -1391,10 +1391,11 @@ Exemples : cf. tableaux (\ref{tab:m2}) et (\ref{tab:m3}) et figures
1 & 6 & 10 & 10 1 & 6 & 10 & 10
\end{tabular} \end{tabular}
\caption[$\max \delta = 4$, n\_dates = 10, $n_p = \caption[$\max \delta = 4$, n\_dates = 10, $n_p =
2$]{$\max \delta = 4$, n\_dates = 10, $n_p = 2$, $k_1 = 1$. $m = 0$ : lecture 2$]{$\max \delta = 4$, n\_dates = 10, $n_p = 2$, $k_1 = 1$. $m$ est
dates 1 à 5, écriture date 1, réception date 6, écriture dates 2 à le numéro du processus MPI. $m = 0$ : lecture dates 1 à 5,
4, réception dates 7 à 9, écriture dates 5 à 9. $m = 1$ : lecture écriture date 1, réception date 6, écriture dates 2 à 4, réception
6 à 10, envoi 6 à 9, écriture 10.} dates 7 à 9, écriture dates 5 à 9. $m = 1$ : lecture 6 à 10, envoi
6 à 9, écriture 10.}
\label{tab:m2} \label{tab:m2}
\end{table} \end{table}
\begin{table}[htbp] \begin{table}[htbp]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment