class_docstr: Tests for the AHI HSD file handler.
class_docstr_tok: ["Tests","for","the","AHI","HSD","file","handler","."]
docstr: Test masking of space pixels.
docstr_tok: ["Test","masking","of","space","pixels","."]
code: def test_scene_loading(self, calibrate, *mocks):
      """Test masking of space pixels."""
      from satpy import Scene
  
      nrows = 25
      ncols = 100
      calibrate.return_value = np.ones((nrows, ncols))
      with _fake_hsd_handler() as fh:
          with mock.patch(
              "satpy.readers.ahi_hsd.AHIHSDFileHandler"
          ) as fh_cls:
              fh_cls.return_value = fh
              fh.filename_info["total_segments"] = 1
              fh.filename_info["segment"] = 1
              fh.data_info["number_of_columns"] = ncols
              fh.data_info["number_of_lines"] = nrows
              scn = Scene(
                  reader="ahi_hsd",
                  filenames=[
                      "HS_H08_20210225_0700_B07_FLDK_R20_S0110.DAT"
                  ],
              )
              with warnings.catch_warnings():
                  # The header isn't valid
                  warnings.filterwarnings(
                      "ignore",
                      category=UserWarning,
                      message=r"Actual .* header size",
                  )
                  scn.load(["B07"])
              im = scn["B07"]
  
              # Make sure space masking worked
              mask = im.to_masked_array().mask
              ref_mask = np.logical_not(
                  get_geostationary_mask(fh.area).compute()
              )
              np.testing.assert_equal(mask, ref_mask)
  
              # Make sure proj_id is correct
              assert (
                  fh.area.proj_id
                  == f'geosh{FAKE_BASIC_INFO["satellite"][-1]}'
              )
  
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 6 for calling the TestAHIHSDFileHandler obj's underlying member method code with example usage: obj.test_scene_loading(calibrate) without return types