class_docstr: Test saving a MultiScene to various formats.
class_docstr_tok: ["Test","saving","a","MultiScene","to","various","formats","."]
docstr: Test the crop method.
docstr_tok: ["Test","the","crop","method","."]
code: def test_crop(self):
      """Test the crop method."""
      import numpy as np
      from pyresample.geometry import AreaDefinition
      from xarray import DataArray
  
      from satpy import MultiScene, Scene
  
      scene1 = Scene()
      area_extent = (
          -5570248.477339745,
          -5561247.267842293,
          5567248.074173927,
          5570248.477339745,
      )
      proj_dict = {
          "a": 6378169.0,
          "b": 6356583.8,
          "h": 35785831.0,
          "lon_0": 0.0,
          "proj": "geos",
          "units": "m",
      }
      x_size = 3712
      y_size = 3712
      area_def = AreaDefinition(
          "test",
          "test",
          "test",
          proj_dict,
          x_size,
          y_size,
          area_extent,
      )
      area_def2 = AreaDefinition(
          "test2",
          "test2",
          "test2",
          proj_dict,
          x_size // 2,
          y_size // 2,
          area_extent,
      )
      scene1["1"] = DataArray(np.zeros((y_size, x_size)))
      scene1["2"] = DataArray(
          np.zeros((y_size, x_size)), dims=("y", "x")
      )
      scene1["3"] = DataArray(
          np.zeros((y_size, x_size)),
          dims=("y", "x"),
          attrs={"area": area_def},
      )
      scene1["4"] = DataArray(
          np.zeros((y_size // 2, x_size // 2)),
          dims=("y", "x"),
          attrs={"area": area_def2},
      )
      mscn = MultiScene([scene1])
  
      # by lon/lat bbox
      new_mscn = mscn.crop(ll_bbox=(-20.0, -5.0, 0, 0))
      new_scn1 = list(new_mscn.scenes)[0]
      assert "1" in new_scn1
      assert "2" in new_scn1
      assert "3" in new_scn1
      assert new_scn1["1"].shape == (y_size, x_size)
      assert new_scn1["2"].shape == (y_size, x_size)
      assert new_scn1["3"].shape == (184, 714)
      assert new_scn1["4"].shape == (92, 357)
  
file_path: satpy/satpy/tests/multiscene_tests/test_save_animation.py
imports: import os
  import shutil
  import tempfile
  import unittest
  from datetime import datetime
  from unittest import mock
  import pytest
  from satpy.tests.multiscene_tests.test_utils import _create_test_area, _create_test_dataset, _create_test_scenes, _fake_get_enhanced_image
label_desc: Use image node_id 8 for calling the TestMultiSceneSave obj's underlying member method code with example usage: obj.test_crop() without return types