@@ -964,13 +964,13 @@ def _time_index(self, time):
964964 if time_index .all ():
965965 # If given time > last known field time, use
966966 # the last field frame without interpolation
967- return ( len (self .grid .time ) - 1 , 0 )
967+ return len (self .grid .time ) - 1
968968 elif np .logical_not (time_index ).all ():
969969 # If given time < any time in the field, use
970970 # the first field frame without interpolation
971- return ( 0 , 0 )
971+ return 0
972972 else :
973- return ( time_index .argmin () - 1 if time_index .any () else 0 , 0 )
973+ return time_index .argmin () - 1 if time_index .any () else 0
974974
975975 def _check_velocitysampling (self ):
976976 if self .name in ["U" , "V" , "W" ]:
@@ -997,8 +997,7 @@ def eval(self, time, z, y, x, particle=None, applyConversion=True):
997997 conversion to the result. Note that we defer to
998998 scipy.interpolate to perform spatial interpolation.
999999 """
1000- (ti , periods ) = self ._time_index (time )
1001- time -= periods * (self .grid .time_full [- 1 ] - self .grid .time_full [0 ])
1000+ ti = self ._time_index (time )
10021001 if self .gridindexingtype == "croco" and self not in [self .fieldset .H , self .fieldset .Zeta ]:
10031002 z = _croco_from_z_to_sigma_scipy (self .fieldset , time , z , y , x , particle = particle )
10041003 if ti < self .grid .tdim - 1 and time > self .grid .time [ti ]:
@@ -1791,8 +1790,7 @@ def eval(self, time, z, y, x, particle=None, applyConversion=True):
17911790 "freeslip" : {"2D" : self .spatial_slip_interpolation , "3D" : self .spatial_slip_interpolation },
17921791 }
17931792 grid = self .U .grid
1794- (ti , periods ) = self .U ._time_index (time )
1795- time -= periods * (grid .time_full [- 1 ] - grid .time_full [0 ])
1793+ ti = self .U ._time_index (time )
17961794 if ti < grid .tdim - 1 and time > grid .time [ti ]:
17971795 t0 = grid .time [ti ]
17981796 t1 = grid .time [ti + 1 ]
0 commit comments