@classmethod
def fromfile(cls, fh, kday=None, ref_time=None, nchan=1, bps=2, valid=None,
    verify=True):
    """Read a frame from a filehandle.

        Parameters
        ----------
        fh : filehandle
            To read the header and payload from.
        kday : int or None
            Explicit thousands of MJD of the observation time.  Can instead
            pass an approximate ``ref_time``.
        ref_time : `~astropy.time.Time` or None
            Reference time within 500 days of the observation time, used to
            infer the full MJD.  Used only if ``kday`` is not given.
        nchan : int, optional
            Number of channels.   Default: 1.
        bps : int, optional
            Bits per elementary sample.  Default: 2.
        verify : bool
            Whether to do basic checks of frame integrity (default: `True`).
        """
    header = cls._header_class.fromfile(fh, kday=kday, ref_time=ref_time,
        verify=verify)
    payload = cls._payload_class.fromfile(fh, nchan=nchan, bps=bps)
    return cls(header, payload, valid, verify)
