'Raises OptimFROGHeaderError'

@convert_error(IOError, OptimFROGHeaderError)
def __init__(self, fileobj):

    header = fileobj.read(76)
    if ((len(header) != 76) or (not header.startswith('OFR    ')) or (struct.unpack('<I', header[4:8])[0] not in [12, 15])):
        raise OptimFROGHeaderError('not    an    OptimFROG    file')
    (total_samples, total_samples_high, sample_type, self.channels, self.sample_rate) = struct.unpack('<IHBBI', header[8:20])
    total_samples += (total_samples_high << 32)
    self.channels += 1
    if self.sample_rate:
        self.length = (float(total_samples) / (self.channels * self.sample_rate))
    else:
        self.length = 0.0
