Skip to content

Commit f3055d8

Browse files
committed
depth get_transect zeta compensation
1 parent 45d7cc8 commit f3055d8

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

gridded/depth.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,8 +839,8 @@ def num_levels(self):
839839
@property
840840
def num_layers(self):
841841
return len(self.s_rho)
842-
843-
def get_s_coord(self, points, time, data_shape=None, _hash=None, **kwargs):
842+
843+
def get_s_coordinate(self, points, time, data_shape=None, _hash=None, **kwargs):
844844
"""
845845
:param points: array of points to interpolate to
846846
:type points: numpy array of shape (n, 3)
@@ -860,8 +860,8 @@ def get_s_coord(self, points, time, data_shape=None, _hash=None, **kwargs):
860860

861861
s_c = self.s_rho if data_shape[0] == self.num_layers else self.s_w
862862
C_s = self.Cs_r if data_shape[0] == self.num_layers else self.Cs_w
863-
h = self.bathymetry.at(points, time, unmask=False, _hash=_hash, **kwargs)
864-
zeta = self.zeta.at(points, time, unmask=False, _hash=_hash, **kwargs)
863+
h = self.bathymetry.at(points, time, _hash=_hash, **kwargs)
864+
zeta = self.zeta.at(points, time, _hash=_hash, **kwargs)
865865
hc = self.hc
866866
hCs = h * C_s[np.newaxis, :]
867867
if self.vtransform == 1:
@@ -871,6 +871,10 @@ def get_s_coord(self, points, time, data_shape=None, _hash=None, **kwargs):
871871
S = ((hc * s_c) + hCs) / (hc + h)
872872
s_coord = -(zeta + (zeta + h) * S)
873873
return s_coord
874+
875+
def get_transect(self, points, time, data_shape=None, _hash=None, **kwargs):
876+
zeta = self.zeta.at(points, time, _hash=_hash, **kwargs)
877+
return self.get_s_coordinate(points, time, data_shape=data_shape, _hash=_hash, **kwargs) + zeta
874878

875879

876880
class FVCOM_Depth(S_Depth):

gridded/variable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def _compute_at(self, points, time, extrapolate, _mem=True, _hash=None, **kwargs
669669
value = value.reshape(-1, 1)
670670
return value
671671

672-
def _post_compute_at(self, value, points, time, unmask=False, _mem=True, _hash=None, **kwargs):
672+
def _post_compute_at(self, value, points, time, units=None, unmask=False, _mem=True, _hash=None, **kwargs):
673673
if isinstance(value, np.ma.MaskedArray):
674674
np.ma.set_fill_value(value, self.fill_value)
675675
if unmask:

0 commit comments

Comments
 (0)