code: def read_dataset(fid, key):
      """Read dataset."""
      dsid = DSET_NAMES[key["name"]]
      dset = fid["/PWLR/" + dsid]
      if dset.ndim == 3:
          dims = ["y", "x", "level"]
      else:
          dims = ["y", "x"]
      data = xr.DataArray(
          da.from_array(dset[()], chunks=CHUNK_SIZE),
          name=key["name"],
          dims=dims,
      ).astype(np.float32)
      data = xr.where(data > 1e30, np.nan, data)
  
      dset_attrs = dict(dset.attrs)
      data.attrs.update(dset_attrs)
  
      return data
  
imports: import datetime
  import logging
  import dask.array
  import h5py
  import numpy
  import xarray
  from satpy.readers.file_handlers import BaseFileHandler
  from satpy.utils import get_legacy_chunk_size
  from .netcdf_utils import NetCDF4FsspecFileHandler
label_desc: Use image node_id 1 for calling a global function with example usage: read_dataset(fid, key) and returns: data