Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/py_eddy_tracker/dataset/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ def get_step_in_km(self, lat, wave_length):
min_wave_length = max(step_x_km, step_y_km) * 2
if wave_length < min_wave_length:
logger.error(
"Wavelength too short for resolution, must be > %d km",
"Wave_length too short for resolution, must be > %d km",
ceil(min_wave_length),
)
raise Exception()
Expand Down Expand Up @@ -1315,7 +1315,7 @@ def finalize_kernel(self, kernel, order, half_x_pt, half_y_pt):

def kernel_lanczos(self, lat, wave_length, order=1):
"""Not really operational
wavelength in km
wave_length in km
order must be int
"""
order = self.check_order(order)
Expand All @@ -1327,7 +1327,7 @@ def kernel_lanczos(self, lat, wave_length, order=1):
return self.finalize_kernel(kernel, order, half_x_pt, half_y_pt)

def kernel_bessel(self, lat, wave_length, order=1):
"""wavelength in km
"""wave_length in km
order must be int
"""
order = self.check_order(order)
Expand Down
2 changes: 2 additions & 0 deletions src/py_eddy_tracker/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def reverse_index(index, nb):
:return: mask of value selected
:rtype: array
"""

m = ones(nb, dtype=numba_types.bool_)
for i in index:
m[i] = False
Expand All @@ -76,6 +77,7 @@ def build_index(groups):
>>> build_index(array((1, 1, 3, 4, 4)))
(array([0, 2, 2, 3]), array([2, 2, 3, 5]), 1)
"""

i0, i1 = groups.min(), groups.max()
amplitude = i1 - i0 + 1
# Index of first observation for each group
Expand Down
2 changes: 1 addition & 1 deletion src/py_eddy_tracker/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, *args, **kwargs):

class GUIAxes(PlatCarreAxes):
"""
Axes which will use full space available
Axes that uses full space available
"""

name = "full_axes"
Expand Down
2 changes: 1 addition & 1 deletion src/py_eddy_tracker/observations/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def get_missing_indices(


ex : array_time = np.array([67, 68, 70, 71, 74, 75])
array_track= np.array([ 1, 1, 1, 1, 1, 1])
array_track= np.array([ 1, 1, 1, 1, 1, 1])
return : np.array([2, 4, 4])
"""

Expand Down
13 changes: 7 additions & 6 deletions src/py_eddy_tracker/observations/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def correct_close_events(self, nb_days_max=20):
# FIXME : we want to change
# segment A splits from segment B, then x days after segment B merges with A
# to
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe create a project note or an issue for improvement, about that

# segment A splits from segment B the x days after segement A merges with B (B will be longer)
# segment A splits from segment B then x days after segement A merges with B (B will be longer)
# comments are in the wrong way but the example works as wanted

_time = self.time
Expand Down Expand Up @@ -321,7 +321,6 @@ def sort(self, order=("track", "segment", "time")):

:param tuple order: order or sorting. Given to :func:`numpy.argsort`
"""

index_order = self.obs.argsort(order=order)
for field in self.elements:
self[field][:] = self[field][index_order]
Expand Down Expand Up @@ -497,8 +496,10 @@ def relatives(self, obs, order=2):
"""
Extract the segments at a certain order from multiple observations.

:param iterable,int obs: indexes of observation for relatives computation. Can be one observation (int) or collection of observations (iterable(int))
:param int order: order of relatives wanted. 0 means only observations in obs, 1 means direct relatives (1 interaction event), ...
:param iterable,int obs: indexes of observation for relatives computation.
Can be one observation (int) or collection of observations (iterable(int))
:param int order: order of relatives wanted.
0 means only observations in obs, 1 means direct relatives (1 interaction event), ...

:return: all segments' relatives
:rtype: EddiesObservations
Expand Down Expand Up @@ -1206,8 +1207,8 @@ def fully_connected(self):

def remove_trash(self):
"""
Remove the lonely eddies (only 1 obs in segment, associated segment number is 0)"""

Remove the lonely eddies (only 1 obs in segment, associated segment number is 0)
"""
return self.extract_with_mask(self.track != 0)

def plot(self, ax, ref=None, color_cycle=None, **kwargs):
Expand Down
12 changes: 6 additions & 6 deletions src/py_eddy_tracker/observations/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ def load_from_zarr(
:param bool raw_data: If true load data without scale_factor and add_offset
:param None,list(str) remove_vars: List of variable name that will be not loaded
:param None,list(str) include_vars: If defined only this variable will be loaded
:param None,dict indexs: Indexs to laod only a slice of data
:param None,dict indexs: Indexes to load only a slice of data
:param int buffer_size: Size of buffer used to load zarr data
:param class_kwargs: argument to set up observations class
:return: Obsevations selected
Expand Down Expand Up @@ -885,7 +885,7 @@ def load_from_netcdf(
:param bool raw_data: If true load data without apply scale_factor and add_offset
:param None,list(str) remove_vars: List of variable name which will be not loaded
:param None,list(str) include_vars: If defined only this variable will be loaded
:param None,dict indexs: Indexs to laod only a slice of data
:param None,dict indexs: Indexes to load only a slice of data
:param class_kwargs: argument to set up observations class
:return: Obsevations selected
:return type: class
Expand Down Expand Up @@ -1054,7 +1054,7 @@ def propagate(
self, previous_obs, current_obs, obs_to_extend, dead_track, nb_next, model
):
"""
Filled virtual obs (C).
Fill virtual obs (C).

:param previous_obs: previous obs from current (A)
:param current_obs: previous obs from virtual (B)
Expand Down Expand Up @@ -1166,7 +1166,7 @@ def re_reference_index(index, ref):
:param array,int index: local index to re ref
:param slice,array ref:
reference could be a slice in this case we juste add start to index
or could be indexs and in this case we need to translate
or could be indexes and in this case we need to translate
"""
if isinstance(ref, slice):
return index + ref.start
Expand Down Expand Up @@ -1341,7 +1341,7 @@ def solve_simultaneous(cost):
eddies_merge = 1 < other_links
test = eddies_separation.any() or eddies_merge.any()
if test:
# We extract matrix that contains concflict
# We extract matrix that contains conflict
obs_linking_to_self = mask[eddies_separation].any(axis=0)
obs_linking_to_other = mask[:, eddies_merge].any(axis=1)
i_self_keep = where(obs_linking_to_other + eddies_separation)[0]
Expand Down Expand Up @@ -1370,7 +1370,7 @@ def solve_simultaneous(cost):
security_increment += 1
i_min_value = cost_reduce.argmin()
i, j = floor(i_min_value / shape[1]).astype(int), i_min_value % shape[1]
# Set to False all link
# Set to False all links
mask[i_self_keep[i]] = False
mask[:, i_other_keep[j]] = False
cost_reduce.mask[i] = True
Expand Down