Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
15 changes: 15 additions & 0 deletions src/py_eddy_tracker/dataset/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -2264,6 +2264,16 @@ def from_netcdf_list(cls, filenames, t, x_name, y_name, indexs=None, heigth=None
new.datasets.append((t, d))
return new

def shift_files(self, t, filename, x_name, y_name, indexs, heigth):
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe add default value to index and height? And maybe kwargs directly to regular grid

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok for default values, but what do you mean by kwargs directly to regular grid ?

Copy link
Owner

Choose a reason for hiding this comment

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

Lot of those arguments are not used by method just transfer to another one, so maybe we could **kwargs to be transparent

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, done

"""Add next file to the list and remove the oldest"""

self.datasets = self.datasets[1:]

d = RegularGridDataset(filename, x_name, y_name, indexs=indexs)
if heigth is not None:
d.add_uv(heigth)
self.datasets.append((t, d))

def interp(self, grid_name, t, lons, lats, method="bilinear"):
"""
Compute z over lons, lats
Expand Down Expand Up @@ -2541,6 +2551,11 @@ def get_uv_quad(i0, j0, u, v, m, nb_x=0):
i1, j1 = i0 + 1, j0 + 1
if nb_x != 0:
i1 %= nb_x
i_max, j_max = m.shape

# if i1 >= i_max or j1 >= j_max:
# return True, nan, nan, nan, nan, nan, nan, nan, nan

if m[i0, j0] or m[i0, j1] or m[i1, j0] or m[i1, j1]:
return True, nan, nan, nan, nan, nan, nan, nan, nan
# Extract value for u and v
Expand Down
Loading