def file_to_oq(fileimt):
    """Convert filename friendly IMT form to openquake form.

    Examples:
    psa1p0 (Spectral Acceleration at 1 second) -> SA(1.0)
    psa0p3 (Spectral Acceleration at 0.3 second) -> SA(0.3)
    psa15p0 (Spectral Acceleration at 15 seconds) -> SA(15.0)

    Args:
        fileimt (str): Filename friendly IMT string.
    Returns:
        str: Openquake IMT nomenclature string.
    """
    if fileimt in ["pga", "pgv", "mmi"]:
        return fileimt.upper()
    if "p" not in fileimt:
        fmt = "%s is not a valid filename-friendly IMT string."
        raise ValueError(fmt % fileimt)
    integer, fraction = fileimt.replace("psa", "").split("p")
    if not len(fraction):
        fmt = "%s is not a valid filename-friendly IMT string."
        raise ValueError(fmt % fileimt)
    oqimt = "SA(%s.%s)" % (integer, fraction)
    return oqimt