code: def format_index_array_attrs(series):
      
      attrs = {}
      # loop through named axes
      for i, axis in zip(range(series.ndim), ('x', 'y')):
          # find property names
          unit = '{}unit'.format(axis)
          origin = '{}0'.format(axis)
          delta = 'd{}'.format(axis)
  
          # store attributes
          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
docs: 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.