From 4035f3c66c8dfc3e15cbcaac2cdb10e678c59d20 Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Tue, 22 Jun 2021 14:33:04 +0200 Subject: [PATCH] Polish --- Convert_Matlab/inst_eddies_v6.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Convert_Matlab/inst_eddies_v6.py b/Convert_Matlab/inst_eddies_v6.py index 4fad994a..bbf63ade 100755 --- a/Convert_Matlab/inst_eddies_v6.py +++ b/Convert_Matlab/inst_eddies_v6.py @@ -44,9 +44,13 @@ def define_fields(writers): writers["max_speed"].field("eddy_index", "N", 5) def write(writers, cell, cyclone): - """writers is a dictionary. cell is a numpy.ndarray with shape (number - of eddies, 21). cyclone is a boolean. The eddy identification - numbers start at 1 and increment by 1 for each eddy in cell. + """Write to shapefiles eddies with a given orientation, at a given + date. + + writers is a dictionary. cell is a numpy.ndarray with shape + (number of eddies, 21). cyclone is a boolean. The eddy + identification numbers start at 1 and increment by 1 for each eddy + in cell. """ eddy_index = 0 @@ -115,6 +119,7 @@ if len(sys.argv) == 3: else: final_date = my_date +# There are two factories, one for cyclones and one for anticyclones: factories = [dict(writers = {}, cell_name = "Anticyclonic_Cell", cyclone = False, SHPC = "SHPC_anti"), dict(writers = {}, cell_name = "Cyclonic_Cell", cyclone = True, @@ -141,6 +146,7 @@ for f in factories: f["writers"]["ishape_last"] = open(file, "w") +# Loop on dates: while True: if os.access(adt_file, os.R_OK): print("Processing", my_date, "...") -- GitLab