def format_index_array_attrs(series):
    """Format metadata attributes for and indexed array

    This function is used to provide the necessary metadata to meet
    the (proposed) LIGO Common Data Format specification for series data
    in HDF5.
    """
    attrs = {}
    for i, axis in zip(range(series.ndim), ('x', 'y')):
        unit = '{}unit'.format(axis)
        origin = '{}0'.format(axis)
        delta = 'd{}'.format(axis)
        aunit = getattr(series, unit)
        attrs.update({unit: str(aunit), origin: getattr(series, origin).to(
            aunit).value, delta: getattr(series, delta).to(aunit).value})
    return attrs
