code: def read_dataset(fid, key):
      
      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.value, 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
docs: Read dataset