def calc_offset(cube):
i = <NUM_LIT:0><EOL>while pd.Series(cube.img[:, i]).count() < <NUM_LIT:200>:<EOL><INDENT>i += <NUM_LIT:1><EOL><DEDENT>return max(i, <NUM_LIT:20>)<EOL>
Calculate an offset.

    Calculate offset from the side of data so that at least 200 image pixels are in the MAD stats.

    Parameters
    ==========
    cube : pyciss.ringcube.RingCube
        Cubefile with ring image