Skip to content

Commit

Permalink
update to integer division for times
Browse files Browse the repository at this point in the history
  • Loading branch information
freemansw1 committed Nov 10, 2023
1 parent 7126697 commit 7986c8a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tobac/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def make_simple_sample_data_2D(data_type="iris"):
) * np.exp(-np.power(yy - y_i, 2.0) / (2 * np.power(10e3, 2.0)))

t_start = datetime.datetime(1970, 1, 1, 0, 0)
t_points = (t - t_start).astype("timedelta64[ms]").astype(int) / 1000
t_points = (t - t_start).astype("timedelta64[ms]").astype(int) // 1000
t_coord = DimCoord(
t_points,
standard_name="time",
Expand Down Expand Up @@ -176,7 +176,7 @@ def make_sample_data_2D_3blobs(data_type="iris"):
-np.power(xx - x_i, 2.0) / (2 * np.power(10e3, 2.0))
) * np.exp(-np.power(yy - y_i, 2.0) / (2 * np.power(10e3, 2.0)))
t_start = datetime.datetime(1970, 1, 1, 0, 0)
t_points = (t - t_start).astype("timedelta64[ms]").astype(int) / 1000
t_points = (t - t_start).astype("timedelta64[ms]").astype(int) // 1000
t_coord = DimCoord(
t_points,
standard_name="time",
Expand Down Expand Up @@ -286,7 +286,7 @@ def make_sample_data_2D_3blobs_inv(data_type="iris"):
) * np.exp(-np.power(yy - y_i, 2.0) / (2 * np.power(10e3, 2.0)))

t_start = datetime.datetime(1970, 1, 1, 0, 0)
t_points = (t - t_start).astype("timedelta64[ms]").astype(int) / 1000
t_points = (t - t_start).astype("timedelta64[ms]").astype(int) // 1000

t_coord = DimCoord(
t_points,
Expand Down Expand Up @@ -432,7 +432,7 @@ def make_sample_data_3D_3blobs(data_type="iris", invert_xy=False):
)

t_start = datetime.datetime(1970, 1, 1, 0, 0)
t_points = (t - t_start).astype("timedelta64[ms]").astype(int) / 1000
t_points = (t - t_start).astype("timedelta64[ms]").astype(int) // 1000
t_coord = DimCoord(
t_points,
standard_name="time",
Expand Down

0 comments on commit 7986c8a

Please sign in to comment.