Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Made time constant in the movie animation script
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 29, 2022
1 parent 016ef73 commit 32e2fc2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/Fragmentation/Fragmentation_Movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ def encounter_combiner(sim):

# The following will combine the two datasets along the time dimension, sort the time dimension, and then fill in any time gaps with interpolation
ds = xr.combine_nested([data,enc],concat_dim='time').sortby("time").interpolate_na(dim="time")

# Interpolate in time to make a smooth, constant time step dataset
smooth_time = np.linspace(start=tgood.isel(time=0), stop=tgood.isel(time=-1), num=2400)
ds = ds.interp(time=smooth_time)

return ds

Expand Down

0 comments on commit 32e2fc2

Please sign in to comment.