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

Rename `util_detect_eddies.py` to `util_eddies.py`

parent ddec6697
No related branches found
No related tags found
No related merge requests found
File moved
......@@ -11,7 +11,7 @@ from os import path
import pprint
import sys
sys.path.append(path.join(sys.path[0], "../../Common"))
import util_detect_eddies
import util_eddies
parser = argparse.ArgumentParser()
parser.add_argument("directory", help = "containing the three shapefiles")
......@@ -21,7 +21,7 @@ reply = input("days_1950, eddy_index = ? ").split(",")
days_1950 = int(reply[0])
eddy_index = int(reply[1])
readers, d_init, ishape_last = util_detect_eddies.open_shpc(args.directory)
readers, d_init, ishape_last = util_eddies.open_shpc(args.directory)
# Find ishape:
if ishape_last is None:
......@@ -33,8 +33,7 @@ if ishape_last is None:
else:
sys.exit("Eddy with this date and index not found")
else:
ishape = util_detect_eddies.comp_ishape(d_init, ishape_last, days_1950,
eddy_index)
ishape = util_eddies.comp_ishape(d_init, ishape_last, days_1950, eddy_index)
for layer in ["extremum", "outermost_contour", "max_speed_contour"]:
shapeRec = readers[layer].shapeRecord(ishape)
......
......@@ -28,7 +28,7 @@ from matplotlib import animation, patches
import f90nml
import sys
sys.path.append(path.join(sys.path[0], "../../Common"))
import util_detect_eddies
import util_eddies
def select_ishapes(d, d_init, ishape_last, reader_extr, window = None):
"""Select ishapes at date d and in window.
......@@ -52,7 +52,7 @@ def select_ishapes(d, d_init, ishape_last, reader_extr, window = None):
shape_rec_extr = reader_extr.shapeRecord(ishape)
points = shape_rec_extr.shape.points[0]
if util_detect_eddies.in_window(points, window):
if util_eddies.in_window(points, window):
ishape_list.append(ishape)
return ishape_list
......@@ -263,8 +263,7 @@ if __name__ == "__main__":
lon_mask = np.ones(len(longitude), dtype = bool)
lat_mask = np.ones(len(latitude), dtype = bool)
readers, d_init, ishape_last \
= util_detect_eddies.open_shpc(args.shpc_dir)
readers, d_init, ishape_last = util_eddies.open_shpc(args.shpc_dir)
if ishape_last is None:
print("We will use all the shapes.")
......
......@@ -98,7 +98,7 @@ if __name__ == "__main__":
import sys
from os import path
sys.path.append(path.join(sys.path[0], "../../Common"))
import util_detect_eddies
import util_eddies
import time
parser = argparse.ArgumentParser(description = __doc__)
......@@ -142,7 +142,7 @@ if __name__ == "__main__":
for G in [G_cyclo, G_anti]:
for n, d in G.nodes.items():
if util_detect_eddies.in_window(d["coordinates"], args.window):
if util_eddies.in_window(d["coordinates"], args.window):
if "component" not in d: report_graph.add_component(G, n)
if args.time:
......
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