diff --git a/Convert_Matlab/inst_eddies_v6.py b/Convert_Matlab/inst_eddies_v6.py index 4fad994aa78986892e5df70c36a2b1e0873ece7a..bbf63ade01de033bc5d67ed1ebfc4ee914fd13bc 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, "...")