def _h5_moments_to_dict(h5obj, fmd):
    """
    Convert gamic HDF5 moment Dataset and attached Attributes to a dictionary.
    """
    d = fmd.get_metadata('default')
    d['valid_min'] = h5obj.attrs['dyn_range_min']
    d['valid_max'] = h5obj.attrs['dyn_range_max']
    d['standard_name'] = h5obj.attrs['moment']
    d['long_name'] = h5obj.attrs['moment']
    #d['units'] =

    if h5obj.attrs['format'] == 'UV8':
        div = 256.0
    else:
        div = 65536.0

    d['data'] = (d['valid_min'] + h5obj[...] *
                 (d['valid_max'] - d['valid_min']) / div)
    return d