class_docstr: Container for multiple `Scene` objects.
class_docstr_tok: ["Container","for","multiple","`","Scene","`","objects","."]
docstr: Save series of Scenes to movie (MP4) or GIF formats.
  
  Supported formats are dependent on the `imageio` library and are
  determined by filename extension by default.
  
  .. note::
  
      Starting with ``imageio`` 2.5.0, the use of FFMPEG depends on
      a separate ``imageio-ffmpeg`` package.
  
  By default all datasets available will be saved to individual files
  using the first Scene's datasets metadata to format the filename
  provided. If a dataset is not available from a Scene then a black
  array is used instead (np.zeros(shape)).
  
  This function can use the ``dask.distributed`` library for improved
  performance by computing multiple frames at a time (see `batch_size`
  option below). If the distributed library is not available then frames
  will be generated one at a time, one product at a time.
  
  Args:
      filename (str): Filename to save to. Can include python string
                      formatting keys from dataset ``.attrs``
                      (ex. "{name}_{start_time:%Y%m%d_%H%M%S.gif")
      datasets (list): DataIDs to save (default: all datasets)
      fps (int): Frames per second for produced animation
      fill_value (int): Value to use instead creating an alpha band.
      batch_size (int): Number of frames to compute at the same time.
          This only has effect if the `dask.distributed` package is
          installed. This will default to 1. Setting this to 0 or less
          will attempt to process all frames at once. This option should
          be used with care to avoid memory issues when trying to
          improve performance. Note that this is the total number of
          frames for all datasets, so when saving 2 datasets this will
          compute ``(batch_size / 2)`` frames for the first dataset and
          ``(batch_size / 2)`` frames for the second dataset.
      ignore_missing (bool): Don't include a black frame when a dataset
                             is missing from a child scene.
      client (bool or dask.distributed.Client): Dask distributed client
          to use for computation. If this is ``True`` (default) then
          any existing clients will be used.
          If this is ``False`` or ``None`` then a client will not be
          created and ``dask.distributed`` will not be used. If this
          is a dask ``Client`` object then it will be used for
          distributed computation.
      enh_args (Mapping): Optional, arguments passed to
          :func:`satpy.writers.get_enhanced_image`.  If this includes a
          keyword "decorate", in any text added
          to the image, string formatting will be applied based on
          dataset attributes.  For example, passing
          ``enh_args={"decorate": {"decorate": [{"text": {"txt":
          "{start_time:%H:%M}"}}]}`` will replace the decorated text
          accordingly.
      kwargs: Additional keyword arguments to pass to
             `imageio.get_writer`.
code: def save_animation(
      self,
      filename,
      datasets=None,
      fps=10,
      fill_value=None,
      batch_size=1,
      ignore_missing=False,
      client=True,
      enh_args=None,
      **kwargs,
  ):
      """Save series of Scenes to movie (MP4) or GIF formats.
  
      Supported formats are dependent on the `imageio` library and are
      determined by filename extension by default.
  
      .. note::
  
          Starting with ``imageio`` 2.5.0, the use of FFMPEG depends on
          a separate ``imageio-ffmpeg`` package.
  
      By default all datasets available will be saved to individual files
      using the first Scene's datasets metadata to format the filename
      provided. If a dataset is not available from a Scene then a black
      array is used instead (np.zeros(shape)).
  
      This function can use the ``dask.distributed`` library for improved
      performance by computing multiple frames at a time (see `batch_size`
      option below). If the distributed library is not available then frames
      will be generated one at a time, one product at a time.
  
      Args:
          filename (str): Filename to save to. Can include python string
                          formatting keys from dataset ``.attrs``
                          (ex. "{name}_{start_time:%Y%m%d_%H%M%S.gif")
          datasets (list): DataIDs to save (default: all datasets)
          fps (int): Frames per second for produced animation
          fill_value (int): Value to use instead creating an alpha band.
          batch_size (int): Number of frames to compute at the same time.
              This only has effect if the `dask.distributed` package is
              installed. This will default to 1. Setting this to 0 or less
              will attempt to process all frames at once. This option should
              be used with care to avoid memory issues when trying to
              improve performance. Note that this is the total number of
              frames for all datasets, so when saving 2 datasets this will
              compute ``(batch_size / 2)`` frames for the first dataset and
              ``(batch_size / 2)`` frames for the second dataset.
          ignore_missing (bool): Don't include a black frame when a dataset
                                 is missing from a child scene.
          client (bool or dask.distributed.Client): Dask distributed client
              to use for computation. If this is ``True`` (default) then
              any existing clients will be used.
              If this is ``False`` or ``None`` then a client will not be
              created and ``dask.distributed`` will not be used. If this
              is a dask ``Client`` object then it will be used for
              distributed computation.
          enh_args (Mapping): Optional, arguments passed to
              :func:`satpy.writers.get_enhanced_image`.  If this includes a
              keyword "decorate", in any text added
              to the image, string formatting will be applied based on
              dataset attributes.  For example, passing
              ``enh_args={"decorate": {"decorate": [{"text": {"txt":
              "{start_time:%H:%M}"}}]}`` will replace the decorated text
              accordingly.
          kwargs: Additional keyword arguments to pass to
                 `imageio.get_writer`.
  
      """
      if imageio is None:
          raise ImportError("Missing required 'imageio' library")
  
      (writers, frames) = self._get_writers_and_frames(
          filename,
          datasets,
          fill_value,
          ignore_missing,
          enh_args,
          imio_args={"fps": fps, **kwargs},
      )
  
      client = self._get_client(client=client)
      # get an ordered list of frames
      frame_keys, frames_to_write = list(zip(*frames.items()))
      frames_to_write = zip(*frames_to_write)
      if client is not None:
          self._distribute_frame_compute(
              writers,
              frame_keys,
              frames_to_write,
              client,
              batch_size=batch_size,
          )
      else:
          self._simple_frame_compute(
              writers, frame_keys, frames_to_write
          )
  
      for writer in writers.values():
          writer.close()
  
imports: from __future__ import annotations
  import copy
  import logging
  import warnings
  from queue import Queue
  from threading import Thread
  from typing import Callable, Collection, Mapping
  import dask.array
  import numpy
  import xarray
  from satpy.dataset import DataID
  from satpy.scene import Scene
  from satpy.writers import get_enhanced_image, split_results
label_desc: Use image node_id 29 for calling the MultiScene obj's underlying member method code with example usage: obj.save_animation(filename, datasets, fps, fill_value, batch_size, ignore_missing, client, enh_args) without return types