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

Rename n1 to `n_prime`

parent e62a030f
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
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