def load_xanes_ref(*arg):
    """
    load reference spectrum, use it as:    ref = load_xanes_ref(Ni, Ni2, Ni3)
    each spectrum is two-column array, containing: energy(1st column) and absortion(2nd column)

    It returns a dictionary, which can be used as: spectrum_ref['ref0'], spectrum_ref['ref1'] ....
    """

    num_ref = len(arg)
    assert num_ref > 1, "num of reference should larger than 1"
    spectrum_ref = {}
    for i in range(num_ref):
        spectrum_ref[f"ref{i}"] = arg[i]
    return spectrum_ref