class_docstr: Test the AHI HSD reader navigation.
class_docstr_tok: ["Test","the","AHI","HSD","reader","navigation","."]
docstr: Test region navigation.
docstr_tok: ["Test","region","navigation","."]
code: def test_region(self, fromfile, np2str):
      """Test region navigation."""
      from pyproj import CRS
  
      np2str.side_effect = lambda x: x
      m = mock.mock_open()
      with mock.patch("satpy.readers.ahi_hsd.open", m, create=True):
          fh = AHIHSDFileHandler(
              "somefile",
              {"segment": 1, "total_segments": 1},
              filetype_info={"file_type": "hsd_b01"},
              user_calibration=None,
          )
          fh.proj_info = {
              "CFAC": 40932549,
              "COFF": -591.5,
              "LFAC": 40932549,
              "LOFF": 5132.5,
              "blocklength": 127,
              "coeff_for_sd": 1737122264.0,
              "distance_from_earth_center": 42164.0,
              "earth_equatorial_radius": 6378.137,
              "earth_polar_radius": 6356.7523,
              "hblock_number": 3,
              "req2_rpol2": 1.006739501,
              "req2_rpol2_req2": 0.0066943844,
              "resampling_size": 4,
              "resampling_types": 0,
              "rpol2_req2": 0.993305616,
              "spare": "",
              "sub_lon": 140.7,
          }
  
          fh.data_info = {
              "blocklength": 50,
              "compression_flag_for_data": 0,
              "hblock_number": 2,
              "number_of_bits_per_pixel": 16,
              "number_of_columns": np.array([1000]),
              "number_of_lines": np.array([1000]),
              "spare": "",
          }
  
          area_def = fh.get_area_def(None)
          expected_crs = CRS.from_dict(
              dict(
                  a=6378137.0,
                  b=6356752.3,
                  h=35785863.0,
                  lon_0=140.7,
                  proj="geos",
                  units="m",
              )
          )
          assert area_def.crs == expected_crs
          np.testing.assert_allclose(
              area_def.area_extent,
              (
                  592000.0038256242,
                  4132000.0267018233,
                  1592000.0102878273,
                  5132000.033164027,
              ),
          )
  
imports: from __future__ import annotations
  import contextlib
  import unittest
  import warnings
  from datetime import datetime
  from typing import Any, Dict
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  from satpy.readers.ahi_hsd import AHIHSDFileHandler
  from satpy.readers.utils import get_geostationary_mask
  from satpy.tests.utils import make_dataid
label_desc: Use image node_id 1 for calling the TestAHIHSDNavigation obj's underlying member method code with example usage: obj.test_region(fromfile, np2str) without return types