def parse_proj4_string(proj4str):
    """
    Construct a dictionary from a PROJ.4 projection string.

    Parameters
    ----------
    proj4str: str
      A PROJ.4-compatible projection string.

    Returns
    -------
    out: dict
      Dictionary, where keys and values are parsed from the projection
      parameter tokens beginning with '+'.
    """

    if not PYPROJ_IMPORTED:
        raise MissingOptionalDependency(
            "pyproj package is required for parse_proj4_string function utility "
            "but it is not installed"
        )

    with warnings.catch_warnings():
        warnings.simplefilter("ignore", category=UserWarning)
        # Ignore the warning raised by to_dict() about losing information.
        proj_dict = pyproj.Proj(proj4str).crs.to_dict()

    return proj_dict
Construct a dictionary from a PROJ.4 projection string.

Parameters
----------
proj4str: str
A PROJ.4-compatible projection string.

Returns
-------
out: dict
Dictionary, where keys and values are parsed from the projection
parameter tokens beginning with '+'.
pysteps/visualization/utils.py