@@ -943,13 +943,13 @@ def _time_index(self, time):
943943 if time_index .all ():
944944 # If given time > last known field time, use
945945 # the last field frame without interpolation
946- return ( len (self .grid .time ) - 1 , 0 )
946+ return len (self .grid .time ) - 1
947947 elif np .logical_not (time_index ).all ():
948948 # If given time < any time in the field, use
949949 # the first field frame without interpolation
950- return ( 0 , 0 )
950+ return 0
951951 else :
952- return ( time_index .argmin () - 1 if time_index .any () else 0 , 0 )
952+ return time_index .argmin () - 1 if time_index .any () else 0
953953
954954 def _check_velocitysampling (self ):
955955 if self .name in ["U" , "V" , "W" ]:
@@ -976,8 +976,7 @@ def eval(self, time, z, y, x, particle=None, applyConversion=True):
976976 conversion to the result. Note that we defer to
977977 scipy.interpolate to perform spatial interpolation.
978978 """
979- (ti , periods ) = self ._time_index (time )
980- time -= periods * (self .grid .time_full [- 1 ] - self .grid .time_full [0 ])
979+ ti = self ._time_index (time )
981980 if self .gridindexingtype == "croco" and self not in [self .fieldset .H , self .fieldset .Zeta ]:
982981 z = _croco_from_z_to_sigma_scipy (self .fieldset , time , z , y , x , particle = particle )
983982 if ti < self .grid .tdim - 1 and time > self .grid .time [ti ]:
@@ -1770,8 +1769,7 @@ def eval(self, time, z, y, x, particle=None, applyConversion=True):
17701769 "freeslip" : {"2D" : self .spatial_slip_interpolation , "3D" : self .spatial_slip_interpolation },
17711770 }
17721771 grid = self .U .grid
1773- (ti , periods ) = self .U ._time_index (time )
1774- time -= periods * (grid .time_full [- 1 ] - grid .time_full [0 ])
1772+ ti = self .U ._time_index (time )
17751773 if ti < grid .tdim - 1 and time > grid .time [ti ]:
17761774 t0 = grid .time [ti ]
17771775 t1 = grid .time [ti + 1 ]
0 commit comments