From 678bfe92a741798160cb251a353113472bbcc187 Mon Sep 17 00:00:00 2001 From: Lionel GUEZ <guez@lmd.ens.fr> Date: Tue, 5 Jul 2022 16:07:54 +0200 Subject: [PATCH] Rename n1 to `n_prime` --- Convert_Matlab/inst_eddies_v6.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Convert_Matlab/inst_eddies_v6.py b/Convert_Matlab/inst_eddies_v6.py index 03794cc3..a31b8350 100755 --- a/Convert_Matlab/inst_eddies_v6.py +++ b/Convert_Matlab/inst_eddies_v6.py @@ -165,7 +165,7 @@ if filter_ghosts: # indices are correct so we compute our own n_prime from the date # of the adt file. For this we need d_init and e_overestim. with open("node_id_param.json") as f: node_id_param = json.load(f) - n1 = (d - node_id_param["d_init"]) * node_id_param["e_overestim"] + 1 + n_prime = (d - node_id_param["d_init"]) * node_id_param["e_overestim"] + 1 # (same starting node id for both orientations) else: cell_mask = itertools.repeat(False) # no ghost @@ -214,9 +214,10 @@ while True: # factory["id"]: id_array = np.rint(id_array).astype(int) n_eddies = id_array.count() # excluding ghosts - equal_range \ - = id_array.compressed() == np.arange(n1, n1 + n_eddies) + equal_range = id_array.compressed() \ + == np.arange(n_prime, n_prime + n_eddies) assert np.all(equal_range) + cell_mask = id_array.mask write_to_shp(factory["writers"], factory["cyclone"], d, @@ -233,7 +234,7 @@ while True: my_date += datetime.timedelta(1) if my_date > final_date: break d += 1 - if filter_ghosts: n1 += node_id_param["e_overestim"] + if filter_ghosts: n_prime += node_id_param["e_overestim"] basename = my_date.strftime(date_format) adt_file = path.join(dirname, basename) -- GitLab