From 32e2fc21a9627f9bdc713fbe950a6520ea035cbb Mon Sep 17 00:00:00 2001 From: David A Minton Date: Thu, 29 Dec 2022 18:44:19 -0500 Subject: [PATCH] Made time constant in the movie animation script --- examples/Fragmentation/Fragmentation_Movie.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/Fragmentation/Fragmentation_Movie.py b/examples/Fragmentation/Fragmentation_Movie.py index f216fc242..8f0d7d22b 100644 --- a/examples/Fragmentation/Fragmentation_Movie.py +++ b/examples/Fragmentation/Fragmentation_Movie.py @@ -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