Skip to content

Commit ce49751

Browse files
committed
Remove lon, lat, and depth from Field class
These variables mainly apply to structured grids. With the new API, they aren't needed in the codebase (we can add this on the repective grid classes if needed).
1 parent 25c589b commit ce49751

1 file changed

Lines changed: 0 additions & 36 deletions

File tree

parcels/field.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import xarray as xr
1111

1212
from parcels._core.utils.time import TimeInterval
13-
from parcels._core.utils.unstructured import get_vertical_location_from_dims
1413
from parcels._reprs import default_repr
1514
from parcels._typing import (
1615
Mesh,
@@ -206,41 +205,6 @@ def units(self, value):
206205
raise ValueError(f"Units must be a UnitConverter object, got {type(value)}")
207206
self._units = value
208207

209-
@property
210-
def lat(self):
211-
if type(self.data) is ux.UxDataArray:
212-
if self.data.attrs["location"] == "node":
213-
return self.grid.node_lat
214-
elif self.data.attrs["location"] == "face":
215-
return self.grid.face_lat
216-
elif self.data.attrs["location"] == "edge":
217-
return self.grid.edge_lat
218-
else:
219-
return self.grid.lat
220-
221-
@property
222-
def lon(self):
223-
if type(self.data) is ux.UxDataArray:
224-
if self.data.attrs["location"] == "node":
225-
return self.grid.node_lon
226-
elif self.data.attrs["location"] == "face":
227-
return self.grid.face_lon
228-
elif self.data.attrs["location"] == "edge":
229-
return self.grid.edge_lon
230-
else:
231-
return self.grid.lon
232-
233-
@property
234-
def depth(self):
235-
if type(self.data) is ux.UxDataArray:
236-
vertical_location = get_vertical_location_from_dims(self.data.dims)
237-
if vertical_location == "center":
238-
return self.grid.nz1
239-
elif vertical_location == "face":
240-
return self.grid.nz
241-
else:
242-
return self.grid.depth
243-
244208
@property
245209
def xdim(self):
246210
if type(self.data) is xr.DataArray:

0 commit comments

Comments
 (0)