class_docstr: Fake GRIB file returned by pygrib.open.
class_docstr_tok: ["Fake","GRIB","file","returned","by","pygrib.open","."]
docstr: Init the grib file.
docstr_tok: ["Init","the","grib","file","."]
code: def __init__(self, messages=None, proj_params=None, latlons=None):
      """Init the grib file."""
      super(FakeGRIB, self).__init__()
      if messages is not None:
          self._messages = messages
      else:
          self._messages = [
              FakeMessage(
                  values=fake_gribdata(),
                  name="TEST",
                  shortName="t",
                  level=100,
                  pressureUnits="hPa",
                  cfName="air_temperature",
                  units="K",
                  dataDate=20180504,
                  dataTime=1200,
                  validityDate=20180504,
                  validityTime=1800,
                  distinctLongitudes=np.arange(5.0),
                  distinctLatitudes=np.arange(5.0),
                  missingValue=9999,
                  modelName="notknown",
                  minimum=100.0,
                  maximum=200.0,
                  typeOfLevel="isobaricInhPa",
                  jScansPositively=0,
                  proj_params=proj_params,
                  latlons=latlons,
              ),
              FakeMessage(
                  values=fake_gribdata(),
                  name="TEST",
                  shortName="t",
                  level=200,
                  pressureUnits="hPa",
                  cfName="air_temperature",
                  units="K",
                  dataDate=20180504,
                  dataTime=1200,
                  validityDate=20180504,
                  validityTime=1800,
                  distinctLongitudes=np.arange(5.0),
                  distinctLatitudes=np.arange(5.0),
                  missingValue=9999,
                  modelName="notknown",
                  minimum=100.0,
                  maximum=200.0,
                  typeOfLevel="isobaricInhPa",
                  jScansPositively=1,
                  proj_params=proj_params,
                  latlons=latlons,
              ),
              FakeMessage(
                  values=fake_gribdata(),
                  name="TEST",
                  shortName="t",
                  level=300,
                  pressureUnits="hPa",
                  cfName="air_temperature",
                  units="K",
                  dataDate=20180504,
                  dataTime=1200,
                  validityDate=20180504,
                  validityTime=1800,
                  distinctLongitudes=np.arange(5.0),
                  distinctLatitudes=np.arange(5.0),
                  missingValue=9999,
                  minimum=100.0,
                  maximum=200.0,
                  typeOfLevel="isobaricInhPa",
                  jScansPositively=0,
                  proj_params=proj_params,
                  latlons=latlons,
              ),
          ]
      self.messages = len(self._messages)
  
imports: import os
  import sys
  from unittest import mock
  import numpy
  import pytest
  import xarray
  from satpy.dataset import DataQuery
label_desc: Use image node_id 1 to create a new FakeGRIB object from inherited base classes: object with example: obj = FakeGRIB(messages, proj_params, latlons)