def convert_spectrum(data_17):
    """
    Converts units of ICRC17 spectrum to 2015 form:
    units before are: Flux J*E*10**(-27) [ m^-2 s^-1 sr^-1 ]
    units after are: Flux J [ eV^-1 km^-2 sr^-1 yr^-1 ]

    :param data_17: numpy array with 2017 spectrum data
    :return: converted array, same form
    """
    s2yr = 1.0 / (3.15576 * 10 ** 7)
    msq2kmsq = 10 ** -6
    data_17['mean'] = data_17['mean'] / 10 ** data_17['logE'
        ] * s2yr * msq2kmsq * 10 ** 27
    data_17['stathi'] = data_17['stathi'] / 10 ** data_17['logE'
        ] * s2yr * msq2kmsq * 10 ** 27
    data_17['statlo'] = data_17['statlo'] / 10 ** data_17['logE'
        ] * s2yr * msq2kmsq * 10 ** 27
    return data_17
