@classmethod<EOL><INDENT>def _parse_siz_segment(cls, fptr):<DEDENT>
offset = fptr.tell() - <NUM_LIT:2><EOL>read_buffer = fptr.read(<NUM_LIT:2>)<EOL>length, = struct.unpack('<STR_LIT>', read_buffer)<EOL>read_buffer = fptr.read(length - <NUM_LIT:2>)<EOL>data = struct.unpack_from('<STR_LIT>', read_buffer)<EOL>rsiz = data[<NUM_LIT:0>]<EOL>if rsiz not in _KNOWN_PROFILES:<EOL><INDENT>msg = "<STR_LIT>".format(rsiz=rsiz)<EOL>warnings.warn(msg, UserWarning)<EOL><DEDENT>xysiz = (data[<NUM_LIT:1>], data[<NUM_LIT:2>])<EOL>xyosiz = (data[<NUM_LIT:3>], data[<NUM_LIT:4>])<EOL>xytsiz = (data[<NUM_LIT:5>], data[<NUM_LIT:6>])<EOL>xytosiz = (data[<NUM_LIT:7>], data[<NUM_LIT:8>])<EOL>Csiz = data[<NUM_LIT:9>]<EOL>data = struct.unpack_from('<STR_LIT:>>' + '<STR_LIT:B>' * (length - <NUM_LIT> - <NUM_LIT:2>),<EOL>read_buffer, offset=<NUM_LIT>)<EOL>bitdepth = tuple(((x & <NUM_LIT>) + <NUM_LIT:1>) for x in data[<NUM_LIT:0>::<NUM_LIT:3>])<EOL>signed = tuple(((x & <NUM_LIT>) > <NUM_LIT:0>) for x in data[<NUM_LIT:0>::<NUM_LIT:3>])<EOL>xrsiz = data[<NUM_LIT:1>::<NUM_LIT:3>]<EOL>yrsiz = data[<NUM_LIT:2>::<NUM_LIT:3>]<EOL>for j, subsampling in enumerate(zip(xrsiz, yrsiz)):<EOL><INDENT>if <NUM_LIT:0> in subsampling:<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>msg = msg.format(comp=j, dx=subsampling[<NUM_LIT:0>], dy=subsampling[<NUM_LIT:1>])<EOL>warnings.warn(msg, UserWarning)<EOL><DEDENT><DEDENT>try:<EOL><INDENT>num_tiles_x = (xysiz[<NUM_LIT:0>] - xyosiz[<NUM_LIT:0>]) / (xytsiz[<NUM_LIT:0>] - xytosiz[<NUM_LIT:0>])<EOL>num_tiles_y = (xysiz[<NUM_LIT:1>] - xyosiz[<NUM_LIT:1>]) / (xytsiz[<NUM_LIT:1>] - xytosiz[<NUM_LIT:1>])<EOL><DEDENT>except ZeroDivisionError:<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>msg = msg.format(num_tile_rows=xytsiz[<NUM_LIT:1>],<EOL>num_tile_cols=xytsiz[<NUM_LIT:0>],<EOL>row_offset=xytosiz[<NUM_LIT:1>],<EOL>col_offset=xytosiz[<NUM_LIT:0>])<EOL>warnings.warn(msg, UserWarning)<EOL><DEDENT>else:<EOL><INDENT>numtiles = math.ceil(num_tiles_x) * math.ceil(num_tiles_y)<EOL>if numtiles > <NUM_LIT>:<EOL><INDENT>msg = "<STR_LIT>"<EOL>msg = msg.format(numtiles=numtiles)<EOL>warnings.warn(msg, UserWarning)<EOL><DEDENT><DEDENT>kwargs = {<EOL>'<STR_LIT>': rsiz,<EOL>'<STR_LIT>': xysiz,<EOL>'<STR_LIT>': xyosiz,<EOL>'<STR_LIT>': xytsiz,<EOL>'<STR_LIT>': xytosiz,<EOL>'<STR_LIT>': Csiz,<EOL>'<STR_LIT>': bitdepth,<EOL>'<STR_LIT>': signed,<EOL>'<STR_LIT>': (xrsiz, yrsiz),<EOL>'<STR_LIT>': length,<EOL>'<STR_LIT>': offset<EOL>}<EOL>segment = SIZsegment(**kwargs)<EOL>cls._csiz = Csiz<EOL>return segment<EOL>
Parse the SIZ segment.

        Parameters
        ----------
        fptr : file
            Open file object.

        Returns
        -------
        SIZSegment
            The current SIZ segment.