cosmo flatten hdr

function ds = cosmo_flatten(arr, dim_labels, dim_values, dim, varargin)