class_docstr: Generic GRIB file handler.
class_docstr_tok: ["Generic","GRIB","file","handler","."]
docstr: Get metadata.
docstr_tok: ["Get","metadata","."]
code: def get_metadata(self, msg, ds_info):
      """Get metadata."""
      model_time = self._convert_datetime(msg, "dataDate", "dataTime")
      start_time = self._convert_datetime(
          msg, "validityDate", "validityTime"
      )
      end_time = start_time
      try:
          center_description = msg["centreDescription"]
      except (RuntimeError, KeyError):
          center_description = None
  
      key_dicts = {
          "shortName": "shortName",
          "long_name": "name",
          "pressureUnits": "pressureUnits",
          "typeOfLevel": "typeOfLevel",
          "standard_name": "cfName",
          "units": "units",
          "modelName": "modelName",
          "valid_min": "minimum",
          "valid_max": "maximum",
          "sensor": "modelName",
      }
  
      ds_info.update(
          {
              "filename": self.filename,
              "model_time": model_time,
              "centreDescription": center_description,
              "start_time": start_time,
              "end_time": end_time,
              "platform_name": "unknown",
          }
      )
  
      for key in key_dicts:
          if key_dicts[key] in msg.keys():
              ds_info[key] = msg[key_dicts[key]]
          else:
              ds_info[key] = "unknown"
  
      return ds_info
  
imports: import logging
  from datetime import datetime
  import dask.array
  import numpy
  import pygrib
  import xarray
  from pyproj import Proj
  from pyresample import geometry
  from satpy.dataset import DataQuery
  from satpy.readers.file_handlers import BaseFileHandler
  from satpy.utils import get_legacy_chunk_size
label_desc: Use image node_id 19 for calling the GRIBFileHandler obj's underlying member method code with example usage: obj.get_metadata(msg, ds_info) and returns: ds_info