@classmethod
def fromdata(cls, data, header=None, verify=True, **kwargs):
    """Construct frame from data and header.

        Parameters
        ----------
        data : `~numpy.ndarray`
            Array holding complex or real data to be encoded.
        header : `~baseband.vdif.VDIFHeader` or None
            If not given, will attempt to generate one using the keywords.
        verify : bool, optional
            Whether or not to do basic assertions that check the integrity
            (e.g., that channel information and whether or not data are complex
            are consistent between header and data). Default: `True`.
        **kwargs
            If ``header`` is not given, these are used to initialize one.
        """
    if header is None:
        header = cls._header_class.fromvalues(verify=verify, **kwargs)
    payload = cls._payload_class.fromdata(data, header=header)
    return cls(header, payload, verify=True)
