def import_knmi_hdf5(filename, qty="ACRR", accutime=5.0, pixelsize=1000.0, **kwargs):
    """
    Import a precipitation or reflectivity field (and optionally the quality
    field) from a HDF5 file conforming to the KNMI Data Centre specification.

    Parameters
    ----------
    filename: str
        Name of the file to import.
    qty: {'ACRR', 'DBZH'}
        The quantity to read from the file. The currently supported identifiers
        are: 'ACRR'=hourly rainfall accumulation (mm) and 'DBZH'=max-reflectivity
        (dBZ). The default value is 'ACRR'.
    accutime: float
        The accumulation time of the dataset in minutes. A 5 min accumulation
        is used as default, but hourly, daily and monthly accumulations
        are also available.
    pixelsize: float
        The pixel size of a raster cell in meters. The default value for the
        KNMI datasets is a 1000 m grid cell size, but datasets with 2400 m pixel
        size are also available.

    {extra_kwargs_doc}

    Returns
    -------
    out: tuple
        A three-element tuple containing precipitation accumulation [mm] /
        reflectivity [dBZ] of the KNMI product, the associated quality field
        and metadata. The quality field is currently set to None.

    Notes
    -----
    Every KNMI data type has a slightly different naming convention. The
    standard setup is based on the accumulated rainfall product on 1 km2 spatial
    and 5 min temporal resolution.
    See https://data.knmi.nl/datasets?q=radar for a list of all available KNMI
    radar data.
    """

    # TODO: Add quality field.

    if not H5PY_IMPORTED:
        raise MissingOptionalDependency(
            "h5py package is required to import "
            "KNMI's radar datasets "
            "but it is not installed"
        )

    if qty not in ["ACRR", "DBZH"]:
        raise ValueError(
            "unknown quantity %s: the available options are 'ACRR' and 'DBZH' "
        )

    ####
    # Precipitation fields
    ####

    f = h5py.File(filename, "r")
    dset = f["image1"]["image_data"]
    precip_intermediate = np.copy(dset)  # copy the content

    # In case precip is a rainfall accumulation (ACRR), precip is divided by 100.0,
    # because the data is saved as hundreds of mm (so, as integers). 65535 is
    # the no data value. The precision of the data is two decimals (0.01 mm).
    if qty == "ACRR":
        precip = np.where(
            precip_intermediate == 65535, np.nan, precip_intermediate / 100.0
        )

    # In case reflectivities are imported, the no data value is 255. Values are
    # saved as integers. The reflectivities are not directly saved in dBZ, but
    # as: dBZ = 0.5 * pixel_value - 32.0 (this used to be 31.5).
    if qty == "DBZH":
        precip = np.where(
            precip_intermediate == 255, np.nan, precip_intermediate * 0.5 - 32.0
        )

    if precip is None:
        raise IOError("requested quantity not found")

    ####
    # Meta data
    ####

    metadata = {}

    if qty == "ACRR":
        unit = "mm"
        transform = None
    elif qty == "DBZH":
        unit = "dBZ"
        transform = "dB"

    # The 'where' group of mch- and Opera-data, is called 'geographic' in the
    # KNMI data.
    geographic = f["geographic"]
    proj4str = "+proj=stere +lat_0=90 +lon_0=0.0 +lat_ts=60.0 +a=6378137 +b=6356752 +x_0=0 +y_0=0"
    pr = pyproj.Proj(proj4str)
    metadata["projection"] = proj4str

    # Get coordinates
    latlon_corners = geographic.attrs["geo_product_corners"]
    ll_lat = latlon_corners[1]
    ll_lon = latlon_corners[0]
    ur_lat = latlon_corners[5]
    ur_lon = latlon_corners[4]
    lr_lat = latlon_corners[7]
    lr_lon = latlon_corners[6]
    ul_lat = latlon_corners[3]
    ul_lon = latlon_corners[2]

    ll_x, ll_y = pr(ll_lon, ll_lat)
    ur_x, ur_y = pr(ur_lon, ur_lat)
    lr_x, lr_y = pr(lr_lon, lr_lat)
    ul_x, ul_y = pr(ul_lon, ul_lat)
    x1 = min(ll_x, ul_x)
    y1 = min(ll_y, lr_y)
    x2 = max(lr_x, ur_x)
    y2 = max(ul_y, ur_y)

    # Fill in the metadata
    metadata["x1"] = x1
    metadata["y1"] = y1
    metadata["x2"] = x2
    metadata["y2"] = y2
    metadata["xpixelsize"] = pixelsize
    metadata["ypixelsize"] = pixelsize
    metadata["cartesian_unit"] = "m"
    metadata["yorigin"] = "upper"
    metadata["institution"] = "KNMI - Royal Netherlands Meteorological Institute"
    metadata["accutime"] = accutime
    metadata["unit"] = unit
    metadata["transform"] = transform
    metadata["zerovalue"] = 0.0
    metadata["threshold"] = _get_threshold_value(precip)
    metadata["zr_a"] = 200.0
    metadata["zr_b"] = 1.6

    f.close()

    return precip, None, metadata
Import a precipitation or reflectivity field (and optionally the quality
field) from a HDF5 file conforming to the KNMI Data Centre specification.

Parameters
----------
filename: str
Name of the file to import.
qty: {'ACRR', 'DBZH'}
The quantity to read from the file. The currently supported identifiers
are: 'ACRR'=hourly rainfall accumulation (mm) and 'DBZH'=max-reflectivity
(dBZ). The default value is 'ACRR'.
accutime: float
The accumulation time of the dataset in minutes. A 5 min accumulation
is used as default, but hourly, daily and monthly accumulations
are also available.
pixelsize: float
The pixel size of a raster cell in meters. The default value for the
KNMI datasets is a 1000 m grid cell size, but datasets with 2400 m pixel
size are also available.

{extra_kwargs_doc}

Returns
-------
out: tuple
A three-element tuple containing precipitation accumulation [mm] /
reflectivity [dBZ] of the KNMI product, the associated quality field
and metadata. The quality field is currently set to None.

Notes
-----
Every KNMI data type has a slightly different naming convention. The
standard setup is based on the accumulated rainfall product on 1 km2 spatial
and 5 min temporal resolution.
See https://data.knmi.nl/datasets?q=radar for a list of all available KNMI
radar data.
pysteps/io/importers.py