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

Commit

Permalink
Added the chunk method in order to use the interpolation on dask-comp…
Browse files Browse the repository at this point in the history
…atible ufuncs
  • Loading branch information
daminton committed Feb 20, 2023
1 parent 13f6a8a commit 2e7f0be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/Fragmentation/Fragmentation_Movie.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def encounter_combiner(sim):
enc = enc.sel(time=tgood)

# 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", method="akima")
ds = xr.combine_nested([data,enc],concat_dim='time').sortby("time").chunk(dict(time=-1)).interpolate_na(dim="time", method="akima")

# Rename the merged Target body so that their data can be combined
tname=[n for n in ds['name'].data if names[0] in n]
Expand Down Expand Up @@ -359,7 +359,7 @@ def vec_props(self, c):
minimum_fragment_gmass = 0.01 * body_Gmass[style][1]
gmtiny = 0.10 * body_Gmass[style][1]
sim.set_parameter(collision_model="fraggle", encounter_save="both", gmtiny=gmtiny, minimum_fragment_gmass=minimum_fragment_gmass, nfrag_reduction=nfrag_reduction[style])
sim.run(dt=5e-4, tstop=tstop[style], istep_out=1, dump_cadence=0)
sim.run(dt=5e-4, tstop=tstop[style], istep_out=1, dump_cadence=0, dask=False)

print("Generating animation")
anim = AnimatedScatter(sim,movie_filename,movie_titles[style],style,nskip=1)

0 comments on commit 2e7f0be

Please sign in to comment.