class_docstr: Test individual functions used for blending.
class_docstr_tok: ["Test","individual","functions","used","for","blending","."]
docstr: Test stacking two scenes using weights.
  
  Here we test that the start and end times can be combined so that they
  describe the start and times of the entire data series. We also test
  the various types of weighted stacking functions (ex. select, blend).
docstr_tok: ["Test","stacking","two","scenes","using","weights",".","Here","we","test","that","the","start","and","end","times","can","be","combined","so","that","they","describe","the","start","and","times","of","the","entire","data","series",".","We","also","test","the","various","types","of","weighted","stacking","functions","(","ex",".","select",",","blend",")","."]
code: def test_blend_two_scenes_using_stack_weighted(
      self,
      multi_scene_and_weights,
      groups,
      scene1_with_weights,
      scene2_with_weights,
      combine_times,
      blend_func,
      exp_result_func,
  ):
      """Test stacking two scenes using weights.
  
      Here we test that the start and end times can be combined so that they
      describe the start and times of the entire data series. We also test
      the various types of weighted stacking functions (ex. select, blend).
  
      """
      from functools import partial
  
      multi_scene, weights = multi_scene_and_weights
      scene1, weights1 = scene1_with_weights
      scene2, weights2 = scene2_with_weights
  
      simple_groups = {
          DataQuery(name="CloudType"): groups[
              DataQuery(name="CloudType")
          ]
      }
      multi_scene.group(simple_groups)
  
      weights = [weights[0][0], weights[1][0]]
      stack_func = partial(
          stack,
          weights=weights,
          blend_type=blend_func,
          combine_times=combine_times,
      )
      weighted_blend = multi_scene.blend(blend_function=stack_func)
  
      expected = exp_result_func(scene1, scene2)
      result = weighted_blend["CloudType"].compute()
      # result has NaNs and xarray's xr.testing.assert_equal doesn't support NaN comparison
      np.testing.assert_allclose(result.data, expected.data)
  
      _check_stacked_metadata(result, "CloudType")
      if combine_times:
          assert result.attrs["start_time"] == datetime(
              2023, 1, 16, 11, 9, 17
          )
          assert result.attrs["end_time"] == datetime(
              2023, 1, 16, 11, 28, 1, 900000
          )
      else:
          assert result.attrs["start_time"] == datetime(
              2023, 1, 16, 11, 11, 7, 250000
          )
          assert result.attrs["end_time"] == datetime(
              2023, 1, 16, 11, 20, 11, 950000
          )
  
imports: from datetime import datetime
  import dask.array
  import numpy
  import pytest
  import xarray
  from pyresample.geometry import AreaDefinition
  from satpy import DataQuery, Scene
  from satpy.multiscene import stack, timeseries
  from satpy.tests.multiscene_tests.test_utils import DEFAULT_SHAPE, _create_test_area, _create_test_dataset, _create_test_int8_dataset
  from satpy.tests.utils import make_dataid
label_desc: Use image node_id 3 for calling the TestBlendFuncs obj's underlying member method code with example usage: obj.test_blend_two_scenes_using_stack_weighted(multi_scene_and_weights, groups, scene1_with_weights, scene2_with_weights, combine_times, blend_func, exp_result_func) without return types