class_docstr: NWCSAF MSG hdf5 reader.
class_docstr_tok: ["NWCSAF","MSG","hdf5","reader","."]
docstr: Load a dataset.
docstr_tok: ["Load","a","dataset","."]
code: def get_dataset(self, dataset_id, ds_info):
      """Load a dataset."""
      file_key = ds_info.get("file_key", dataset_id["name"])
      data = self[file_key]
  
      nodata = None
      if "SCALING_FACTOR" in data.attrs and "OFFSET" in data.attrs:
          dtype = np.dtype(data.data)
          if dataset_id["name"] in ["ctth_alti"]:
              data.attrs["valid_range"] = (0, 27000)
              data.attrs["_FillValue"] = np.nan
  
          if dataset_id["name"] in [
              "ctth_alti",
              "ctth_pres",
              "ctth_tempe",
              "ctth_effective_cloudiness",
          ]:
              dtype = np.dtype("float32")
              nodata = 255
  
          if dataset_id["name"] in ["ct"]:
              data.attrs["valid_range"] = (0, 20)
              data.attrs["_FillValue"] = 255
              # data.attrs['palette_meanings'] = list(range(21))
  
          attrs = data.attrs
          scaled_data = (
              data * data.attrs["SCALING_FACTOR"] + data.attrs["OFFSET"]
          ).astype(dtype)
          if nodata:
              scaled_data = scaled_data.where(data != nodata)
              scaled_data = scaled_data.where(scaled_data >= 0)
          data = scaled_data
          data.attrs = attrs
  
      for key in list(data.attrs.keys()):
          val = data.attrs[key]
          if isinstance(val, h5py.h5r.Reference):
              del data.attrs[key]
  
      return data
  
file_path: satpy/satpy/readers/nwcsaf_msg2013_hdf5.py
imports: import logging
  from datetime import datetime
  import h5py
  import numpy
  from pyresample.geometry import AreaDefinition
  from satpy.readers.hdf5_utils import HDF5FileHandler
label_desc: Use image node_id 2 for calling the Hdf5NWCSAF obj's underlying member method code with example usage: obj.get_dataset(dataset_id, ds_info) and returns: data