Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
tdcwilliams authored and akorosov committed Apr 30, 2024
1 parent d88bcf4 commit 667bc8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions geodataset/custom_geodataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_lonlat_arrays(self, ij_range=(None,None,None,None), **kwargs):
ij_range : tuple(int)
- [i0, i1, j0, j1]
- pixel indices for subsetting
- return lon[i0:i1+1,j0:j1+1], lat[i0:i1+1,j0:j1+1]
- return lon[i0:i1,j0:j1], lat[i0:i1,j0:j1]
instead of full arrays
dummy kwargs
Expand Down Expand Up @@ -122,7 +122,7 @@ def get_xy_arrays(ij_range=(None,None,None,None), **kwargs):
ij_range : tuple(int)
- [i0, i1, j0, j1]
- pixel indices for subsetting
- return x[i0:i1+1,j0:j1+1], y[i0:i1+1,j0:j1+1]
- return x[i0:i1,j0:j1], y[i0:i1,j0:j1]
instead of full arrays
dummy kwargs
Expand Down Expand Up @@ -180,5 +180,4 @@ def datetimes(self):
"""
bname = os.path.basename(self.filepath())
datestr = bname.split('_')[1][:8]
return [dt.datetime.strptime(datestr, '%Y%m%d')
+ dt.timedelta(hours=12)]
return [dt.datetime.strptime(datestr, '%Y%m%d') + dt.timedelta(hours=12)]
2 changes: 1 addition & 1 deletion geodataset/geodataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,8 @@ def get_var_for_nextsim(self, var_name, nbo, on_elements=True, **kwargs):
# get elements coordinates in neXtSIM projection
nb_x = nbo.mesh_info.nodes_x
nb_y = nbo.mesh_info.nodes_y
t = nbo.mesh_info.indices
if on_elements:
t = nbo.mesh_info.indices
nb_x, nb_y = [i[t].mean(axis=1) for i in [nb_x, nb_y]]

# transform nextsim coordinates to lon/lat
Expand Down

0 comments on commit 667bc8b

Please sign in to comment.