class_docstr: Test SEVIRI L2 BUFR Reader.
docstr: Test data loaded with AreaDefinition.
docstr_tok: ["Test","data","loaded","with","AreaDefinition","."]
code: def test_data_with_area_definition(self, input_file):
      """Test data loaded with AreaDefinition."""
      bufr_obj = SeviriL2BufrData(input_file, with_adef=True)
      _ = bufr_obj.get_data(
          DATASET_INFO_LAT
      )  # We need to load the lat/lon data in order to
      _ = bufr_obj.get_data(
          DATASET_INFO_LON
      )  # populate the file handler with these data
      z = bufr_obj.get_data(DATASET_INFO)
  
      ad = bufr_obj.fh.get_area_def(None)
      assert ad == AREA_DEF
      data_1d = np.concatenate((DATA, DATA), axis=0)
  
      # Put BUFR data on 2D grid that the 2D array returned by get_dataset should correspond to
      lons_1d, lats_1d = da.compute(
          bufr_obj.fh.longitude, bufr_obj.fh.latitude
      )
      icol, irow = ad.get_array_indices_from_lonlat(lons_1d, lats_1d)
  
      data_2d = np.empty(ad.shape)
      data_2d[:] = np.nan
      data_2d[irow.compressed(), icol.compressed()] = data_1d[
          ~irow.mask
      ]
      np.testing.assert_array_equal(z.values, data_2d)
  
      # Test that the correct AreaDefinition is identified for products with 3 pixel segements
      bufr_obj.fh.seg_size = 3
      ad_ext = bufr_obj.fh._construct_area_def(
          make_dataid(name="dummmy", resolution=9000)
      )
      assert ad_ext == AREA_DEF_EXT
  
imports: import sys
  import unittest
  from datetime import datetime
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  from pyresample import geometry
  from satpy.tests.utils import make_dataid
label_desc: Use image node_id 5 for calling the TestSeviriL2BufrReader obj's underlying member method code with example usage: obj.test_data_with_area_definition(input_file) without return types