def import_mch_gif(filename, product, unit, accutime, **kwargs):
    """
    Import a 8-bit gif radar reflectivity composite from the MeteoSwiss
    archive.

    Parameters
    ----------
    filename: str
        Name of the file to import.
    product: {"AQC", "CPC", "RZC", "AZC"}
        The name of the MeteoSwiss QPE product.\n
        Currently supported prducts:

        +------+----------------------------+
        | Name |          Product           |
        +======+============================+
        | AQC  |     Acquire                |
        +------+----------------------------+
        | CPC  |     CombiPrecip            |
        +------+----------------------------+
        | RZC  |     Precip                 |
        +------+----------------------------+
        | AZC  |     RZC accumulation       |
        +------+----------------------------+

    unit: {"mm/h", "mm", "dBZ"}
        the physical unit of the data
    accutime: float
        the accumulation time in minutes of the data

    {extra_kwargs_doc}

    Returns
    -------
    out: tuple
        A three-element tuple containing the precipitation field in mm/h imported
        from a MeteoSwiss gif file and the associated quality field and metadata.
        The quality field is currently set to None.
    """
    if not PIL_IMPORTED:
        raise MissingOptionalDependency(
            "PIL package is required to import "
            "radar reflectivity composite from MeteoSwiss"
            "but it is not installed"
        )

    geodata = _import_mch_geodata()

    metadata = geodata

    # import gif file
    img = Image.open(filename)

    if product.lower() in ["azc", "rzc", "precip"]:
        # convert 8-bit GIF colortable to RGB values
        img_rgb = img.convert("RGB")

        # load lookup table
        if product.lower() == "azc":
            lut_filename = os.path.join(
                os.path.dirname(__file__), "mch_lut_8bit_Metranet_AZC_V104.txt"
            )
        else:
            lut_filename = os.path.join(
                os.path.dirname(__file__), "mch_lut_8bit_Metranet_v103.txt"
            )
        lut = np.genfromtxt(lut_filename, skip_header=1)
        lut = dict(zip(zip(lut[:, 1], lut[:, 2], lut[:, 3]), lut[:, -1]))

        # apply lookup table conversion
        precip = np.zeros(len(img_rgb.getdata()))
        for i, dn in enumerate(img_rgb.getdata()):
            precip[i] = lut.get(dn, np.nan)

        # convert to original shape
        width, height = img.size
        precip = precip.reshape(height, width)

        # set values outside observational range to NaN,
        # and values in non-precipitating areas to zero.
        precip[precip < 0] = 0
        precip[precip > 9999] = np.nan

    elif product.lower() in ["aqc", "cpc", "acquire ", "combiprecip"]:
        # convert digital numbers to physical values
        img = np.array(img).astype(int)

        # build lookup table [mm/5min]
        lut = np.zeros(256)
        a = 316.0
        b = 1.5
        for i in range(256):
            if (i < 2) or (i > 250 and i < 255):
                lut[i] = 0.0
            elif i == 255:
                lut[i] = np.nan
            else:
                lut[i] = (10.0 ** ((i - 71.5) / 20.0) / a) ** (1.0 / b)

        # apply lookup table
        precip = lut[img]

    else:
        raise ValueError("unknown product %s" % product)

    metadata["accutime"] = accutime
    metadata["unit"] = unit
    metadata["transform"] = None
    metadata["zerovalue"] = np.nanmin(precip)
    metadata["threshold"] = _get_threshold_value(precip)
    metadata["institution"] = "MeteoSwiss"
    metadata["product"] = product
    metadata["zr_a"] = 316.0
    metadata["zr_b"] = 1.5

    return precip, None, metadata
Import a 8-bit gif radar reflectivity composite from the MeteoSwiss
archive.

Parameters
----------
filename: str
Name of the file to import.
product: {"AQC", "CPC", "RZC", "AZC"}
The name of the MeteoSwiss QPE product.\n
Currently supported prducts:

+------+----------------------------+
| Name |          Product           |
+======+============================+
| AQC  |     Acquire                |
+------+----------------------------+
| CPC  |     CombiPrecip            |
+------+----------------------------+
| RZC  |     Precip                 |
+------+----------------------------+
| AZC  |     RZC accumulation       |
+------+----------------------------+

unit: {"mm/h", "mm", "dBZ"}
the physical unit of the data
accutime: float
the accumulation time in minutes of the data

{extra_kwargs_doc}

Returns
-------
out: tuple
A three-element tuple containing the precipitation field in mm/h imported
from a MeteoSwiss gif file and the associated quality field and metadata.
The quality field is currently set to None.
pysteps/io/importers.py