You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generates a movie by applying the `plot` function to each step in `steps`, and saving the resulting figure at the specified `fpath` with the specified `dpi`.
214
+
Create plot frames from a set of timesteps of the same dataset.
170
215
171
216
Parameters
172
217
----------
173
218
plot : function
174
-
A function that accepts a single argument 'st' and returns a figure.
175
-
steps : list
176
-
A list of steps that the `plot` function will be applied to.
219
+
A function that generates and saves the plot. The function must take a time index
220
+
as its first argument, followed by the data source, and the path for png files.
221
+
ds : object
222
+
The data source used to generate the plots.
223
+
steps : array_like, optional
224
+
The time indices to use for generating the movie. If None, use all
225
+
time indices in `ds` (defined by the `t` key).
177
226
fpath : str
178
-
The file path where the figures will be saved.
179
-
dpi : int, optional
180
-
The dpi of the saved figures. Defaults to 300.
227
+
The file path to save the frames.
181
228
num_cpus : int, optional
182
-
The number of CPUs to use for parallel processing. Defaults to the number of CPUs on the current machine.
229
+
The number of CPUs to use for parallel processing. If None, use all available CPUs.
183
230
184
231
Returns
185
232
-------
186
-
None
233
+
list
234
+
A list of results returned by the `plot` function, one for each time index.
235
+
236
+
Raises
237
+
------
238
+
ValueError
239
+
If `plot` is not a callable function.
240
+
241
+
Notes
242
+
-----
243
+
This function uses the `multiprocessing` module to parallelize the generation
244
+
of the plots, and `tqdm` module to display a progress bar.
0 commit comments