def _kip(self, cycle_end, mix_thresh, xaxis, sparse):
original_cyclelist = self.se.cycles<EOL>cyclelist = original_cyclelist[<NUM_LIT:0>:cycle_end:sparse]<EOL>xx = self.se.ages[:cycle_end:sparse]<EOL>totalmass = []<EOL>m_ini = float(self.se.get('<STR_LIT>'))<EOL>fig = pl.figure(<NUM_LIT:1>)<EOL>ax = pl.subplot(<NUM_LIT:1>,<NUM_LIT:1>,<NUM_LIT:1>)<EOL>fsize = <NUM_LIT:12><EOL>def getlims(d_coeff, massco):<EOL><INDENT>"""<STR_LIT>"""<EOL>plotlims = []<EOL>if massco[<NUM_LIT:0>] > massco[-<NUM_LIT:1>]:<EOL><INDENT>for j in range(-<NUM_LIT:1>,-len(d_coeff)-<NUM_LIT:1>,-<NUM_LIT:1>):<EOL><INDENT>if j == -<NUM_LIT:1>:<EOL><INDENT>if d_coeff[j] >= mix_thresh:<EOL><INDENT>plotlims.append(massco[j])<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>elif (d_coeff[j]-mix_thresh)*(d_coeff[j+<NUM_LIT:1>]-mix_thresh) < <NUM_LIT:0>:<EOL><INDENT>plotlims.append(massco[j])<EOL><DEDENT>if j == -len(d_coeff):<EOL><INDENT>if d_coeff[j] >= mix_thresh:<EOL><INDENT>plotlims.append(massco[j])<EOL><DEDENT><DEDENT><DEDENT>return plotlims<EOL><DEDENT>else:<EOL><INDENT>for j in range(len(d_coeff)):<EOL><INDENT>if j == <NUM_LIT:0>:<EOL><INDENT>if d_coeff[j] >= mix_thresh:<EOL><INDENT>plotlims.append(massco[j])<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>elif (d_coeff[j]-mix_thresh)*(d_coeff[j-<NUM_LIT:1>]-mix_thresh) < <NUM_LIT:0>:<EOL><INDENT>plotlims.append(massco[j])<EOL><DEDENT>if j == len(d_coeff)-<NUM_LIT:1>:<EOL><INDENT>if d_coeff[j] >= mix_thresh:<EOL><INDENT>plotlims.append(massco[j])<EOL><DEDENT><DEDENT><DEDENT>return plotlims<EOL><DEDENT><DEDENT>if xaxis == '<STR_LIT>':<EOL><INDENT>ax.set_xlabel('<STR_LIT>',fontsize=fsize)<EOL><DEDENT>elif xaxis == '<STR_LIT>':<EOL><INDENT>xx = cyclelist<EOL>ax.set_xlabel('<STR_LIT>',fontsize=fsize)<EOL><DEDENT>elif xaxis == '<STR_LIT>':<EOL><INDENT>for i in range(len(xx)):<EOL><INDENT>xx[i] = np.log10(xx[i])<EOL><DEDENT>ax.set_xlabel('<STR_LIT>',fontsize=fsize)<EOL><DEDENT>elif xaxis == '<STR_LIT>':<EOL><INDENT>for i in range(len(xx)):<EOL><INDENT>xx[i] = np.log10(max(xx)-xx[i])<EOL><DEDENT>xx[-<NUM_LIT:2>] = xx[-<NUM_LIT:3>]-abs(xx[-<NUM_LIT:4>]-xx[-<NUM_LIT:3>])<EOL>xx[-<NUM_LIT:1>] = xx[-<NUM_LIT:2>]-abs(xx[-<NUM_LIT:3>]-xx[-<NUM_LIT:2>])<EOL>ax.set_xlabel('<STR_LIT>',fontsize=fsize)<EOL><DEDENT>flag = False<EOL>if self.se.get(cyclelist[<NUM_LIT:1>],'<STR_LIT>')[<NUM_LIT:0>] > self.se.get(cyclelist[<NUM_LIT:1>],'<STR_LIT>')[-<NUM_LIT:1>]:<EOL><INDENT>flag = True<EOL><DEDENT>for i in range(len(cyclelist)):<EOL><INDENT>if flag == True:<EOL><INDENT>totalmass.append(self.se.get(cyclelist[i],'<STR_LIT>')[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>totalmass.append(self.se.get(cyclelist[i],'<STR_LIT>')[-<NUM_LIT:1>])<EOL><DEDENT>percent = int(i*<NUM_LIT:100>/len(cyclelist))<EOL>sys.stdout.flush()<EOL>sys.stdout.write("<STR_LIT>" + "<STR_LIT>" % percent)<EOL>d_coeff = self.se.get(cyclelist[i],'<STR_LIT>')<EOL>massco = self.se.get(cyclelist[i],'<STR_LIT>')<EOL>plotlims = getlims(d_coeff,massco)<EOL>for k in range(<NUM_LIT:0>,len(plotlims),<NUM_LIT:2>):<EOL><INDENT>ax.axvline(xx[i],ymin=old_div(plotlims[k],m_ini),ymax=old_div(plotlims[k+<NUM_LIT:1>],m_ini),color='<STR_LIT:b>',linewidth=<NUM_LIT:0.5>)<EOL><DEDENT><DEDENT>ax.plot(xx, totalmass, color='<STR_LIT>', linewidth=<NUM_LIT:1>)<EOL>if xaxis == '<STR_LIT>':<EOL><INDENT>ax.axis([xx[<NUM_LIT:0>],xx[-<NUM_LIT:1>],<NUM_LIT:0.>,m_ini])<EOL><DEDENT>else:<EOL><INDENT>ax.axis([min(xx),max(xx),<NUM_LIT:0.>,m_ini])<EOL><DEDENT>ax.set_ylabel('<STR_LIT>',fontsize=fsize)<EOL>pl.show()<EOL>
*** Should be used with care, therefore has been flagged as
a private routine ***
This function uses a threshold diffusion coefficient, above
which the the shell is considered to be convective, to plot a
Kippenhahn diagram.

Parameters
----------
cycle_end : integer
    The final cycle number.
mix_thresh : float
    The threshold diffusion coefficient.
xaxis : string
    Choose one of 'age', 'cycle', 'log_age' or 'log_time_left'.
sparse : integer
    Sparsity factor when plotting from cyclelist.

Examples
--------
>>> pt=mp.se('/ngpod1/swj/see/mppnp_out/scratch_data/M25.0Z1e-02','.h5')
>>> pt.kip(10000,'log_time_left',100)