A characterization of multiwavelet packets on general lattices