class_docstr: Small class for inspecting a HDF5 file and retrieve its metadata/header data.
class_docstr_tok: ["Small","class","for","inspecting","a","HDF5","file","and","retrieve","its","metadata\/header","data","."]
docstr: Get item for given key.
docstr_tok: ["Get","item","for","given","key","."]
code: def __getitem__(self, key):
      """Get item for given key."""
      val = self.file_content[key]
      if isinstance(val, h5py.Dataset):
          # these datasets are closed and inaccessible when the file is closed, need to reopen
          f_obj = open_file_or_filename(self.filename)
          dset = h5py.File(f_obj, "r")[key]
          dset_data = da.from_array(dset, chunks=CHUNK_SIZE)
          attrs = self._attrs_cache.get(key, dset.attrs)
          if dset.ndim == 2:
              return xr.DataArray(
                  dset_data, dims=["y", "x"], attrs=attrs
              )
          return xr.DataArray(dset_data, attrs=attrs)
  
      return val
  
file_path: satpy/satpy/readers/hdf5_utils.py
imports: import logging
  import dask.array
  import h5py
  import numpy
  import xarray
  from satpy.readers import open_file_or_filename
  from satpy.readers.file_handlers import BaseFileHandler
  from satpy.readers.utils import np2str
  from satpy.utils import get_legacy_chunk_size
label_desc: Use image node_id 6 for calling the HDF5FileHandler obj's underlying member method code with example usage: obj.__getitem__(key) and returns: val, xr, xr