def _kip_cont2(self, sparse, cycle_start=<NUM_LIT:0>, cycle_end=<NUM_LIT:0>,<EOL>plot=['<STR_LIT>'], thresholds=[<NUM_LIT>],<EOL>xax='<STR_LIT>', alphas=[<NUM_LIT:1.0>], yllim=<NUM_LIT:0.>, yulim=<NUM_LIT:0.>,<EOL>y_res=<NUM_LIT>, xllim=<NUM_LIT:0.>, xulim=<NUM_LIT:0.>, age='<STR_LIT>',<EOL>sparse_intrinsic=<NUM_LIT:20>, engen=False,<EOL>netnuc_name='<STR_LIT>', engenalpha=<NUM_LIT>,<EOL>outfile='<STR_LIT>', annotation='<STR_LIT>',<EOL>KEPLER=False):
<EOL>original_cyclelist = self.se.cycles<EOL>if cycle_end==<NUM_LIT:0.>:<EOL><INDENT>cycle_end = original_cyclelist[-<NUM_LIT:1>]<EOL><DEDENT>cycle_end = old_div(int(cycle_end),sparse_intrinsic) - <NUM_LIT:1><EOL>if cycle_start==<NUM_LIT:0>:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>cycle_start = old_div(int(cycle_start),sparse_intrinsic) - <NUM_LIT:1><EOL><DEDENT>cyclelist = original_cyclelist[cycle_start:cycle_end:sparse]<EOL>original_ages= self.se.ages<EOL>age_at_restart = <NUM_LIT:0.><EOL>age_at_restart_idx = <NUM_LIT:0><EOL>if KEPLER == True:<EOL><INDENT>for i in range(<NUM_LIT:1>,len(original_ages)):<EOL><INDENT>if (original_ages[i]-original_ages[i-<NUM_LIT:1>]) < <NUM_LIT:0.>:<EOL><INDENT>age_at_restart_idx = i-<NUM_LIT:1><EOL>age_at_restart = original_ages[i-<NUM_LIT:1>]<EOL>print('<STR_LIT>'+str(age_at_restart_idx)+'<STR_LIT>'+str(age_at_restart))<EOL>KEPLER = True<EOL>break<EOL><DEDENT><DEDENT>for i in range(age_at_restart_idx+<NUM_LIT:1>,len(original_ages)):<EOL><INDENT>original_ages[i] = original_ages[i] + age_at_restart<EOL><DEDENT><DEDENT>fig = pl.figure()<EOL>ax = pl.axes()<EOL>params = {'<STR_LIT>':  <NUM_LIT:15>,<EOL>'<STR_LIT>':   <NUM_LIT:15>,<EOL>'<STR_LIT>': <NUM_LIT:15>,<EOL>'<STR_LIT>': <NUM_LIT:15>,<EOL>'<STR_LIT>': <NUM_LIT:15>,<EOL>'<STR_LIT>': False}<EOL>fsize=<NUM_LIT><EOL>pl.rcParams.update(params)<EOL>if xax == '<STR_LIT>':<EOL><INDENT>if KEPLER == True:<EOL><INDENT>xxtmp = original_ages[cycle_start:cycle_end:sparse]<EOL><DEDENT>else:<EOL><INDENT>xxtmp = self.se.ages[cycle_start:cycle_end:sparse]<EOL><DEDENT>if age == '<STR_LIT>':<EOL><INDENT>if KEPLER == True:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>xxtmp = self.se.ages[cycle_start:cycle_end:sparse]<EOL><DEDENT><DEDENT>elif age == '<STR_LIT>':<EOL><INDENT>if KEPLER == True:<EOL><INDENT>for i in range(len(cyclelist)):<EOL><INDENT>xxtmp[i] = old_div(original_ages[cycle_start:cycle_end:sparse][i],<NUM_LIT>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for i in range(len(cyclelist)):<EOL><INDENT>xxtmp[i] = old_div(self.se.ages[cycle_start:cycle_end:sparse][i],<NUM_LIT>)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if xax == '<STR_LIT>':<EOL><INDENT>xx = cyclelist<EOL>xxtmp = cyclelist<EOL><DEDENT>if xax == '<STR_LIT>':<EOL><INDENT>xx=np.zeros(len(xxtmp))<EOL>agemin = max(old_div(abs(xxtmp[-<NUM_LIT:1>]-xxtmp[-<NUM_LIT:2>]),<NUM_LIT>),<NUM_LIT>)<EOL>for i in np.arange(len(xxtmp)):<EOL><INDENT>if xxtmp[-<NUM_LIT:1>]-xxtmp[i]>agemin:<EOL><INDENT>xx[i]=np.log10(xxtmp[-<NUM_LIT:1>]-xxtmp[i]+agemin)<EOL><DEDENT>else :<EOL><INDENT>xx[i]=np.log10(agemin)<EOL><DEDENT><DEDENT>ax.set_xlabel('<STR_LIT>',fontsize=fsize-<NUM_LIT:1>)<EOL><DEDENT>if xax == '<STR_LIT>':<EOL><INDENT>ax.set_xlabel('<STR_LIT>',fontsize=fsize-<NUM_LIT:1>)<EOL><DEDENT>totalmass = []<EOL>try:<EOL><INDENT>m_ini = float(self.se.get('<STR_LIT>'))<EOL><DEDENT>except:<EOL><INDENT>mini=m.se.get(<NUM_LIT:0>,'<STR_LIT>')<EOL>mini=old_div(mini,constants.mass_sun)<EOL>print('<STR_LIT>')<EOL><DEDENT>if yulim==<NUM_LIT:0.>:<EOL><INDENT>yulim = m_ini<EOL><DEDENT>dy = old_div(m_ini,float(y_res))<EOL>vlinetol = <NUM_LIT><EOL>y = np.arange(<NUM_LIT:0.>, m_ini, dy)<EOL>if engen == True:<EOL><INDENT>Z = np.zeros([len(y),len(xxtmp),len(plot)+<NUM_LIT:2>],float)<EOL><DEDENT>else:<EOL><INDENT>Z = np.zeros([len(y),len(xxtmp),len(plot)],float)<EOL><DEDENT>def getlims(variable_array,thresh,massco_array):<EOL><INDENT>"""<STR_LIT>"""<EOL>plotlims = []<EOL>if len(massco_array) == <NUM_LIT:2>:<EOL><INDENT>massco_array = massco_array[<NUM_LIT:0>]<EOL><DEDENT>if len(variable_array) == <NUM_LIT:2>:<EOL><INDENT>variable_array = variable_array[<NUM_LIT:0>]<EOL><DEDENT>if massco_array[<NUM_LIT:0>] > massco_array[-<NUM_LIT:1>]:<EOL><INDENT>for j in range(-<NUM_LIT:1>,-len(variable_array)-<NUM_LIT:1>,-<NUM_LIT:1>):<EOL><INDENT>if j == -<NUM_LIT:1>:<EOL><INDENT>if variable_array[j] >= thresh:<EOL><INDENT>plotlims.append(massco_array[j])<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>elif (variable_array[j]-thresh)*(variable_array[j+<NUM_LIT:1>]-thresh) < <NUM_LIT:0>:<EOL><INDENT>plotlims.append(massco_array[j])<EOL><DEDENT>if j == -len(variable_array):<EOL><INDENT>if variable_array[j] >= thresh:<EOL><INDENT>plotlims.append(massco_array[j])<EOL><DEDENT><DEDENT><DEDENT>return plotlims<EOL><DEDENT>else:<EOL><INDENT>for j in range(len(variable_array)):<EOL><INDENT>if j == <NUM_LIT:0>:<EOL><INDENT>if variable_array[j] >= thresh:<EOL><INDENT>plotlims.append(massco_array[j])<EOL><DEDENT>else:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>elif (variable_array[j]-thresh)*(variable_array[j-<NUM_LIT:1>]-thresh) < <NUM_LIT:0>:<EOL><INDENT>plotlims.append(massco_array[j])<EOL><DEDENT>if j == len(variable_array)-<NUM_LIT:1>:<EOL><INDENT>if variable_array[j] >= thresh:<EOL><INDENT>plotlims.append(massco_array[j])<EOL><DEDENT><DEDENT><DEDENT>return plotlims<EOL><DEDENT><DEDENT>if engen == True:<EOL><INDENT>plot = ['<STR_LIT>']<EOL><DEDENT>ypscoeff = [-<NUM_LIT:1>,-<NUM_LIT:1>,-<NUM_LIT:1>] <EOL>total_massco = []<EOL>for i in range(len(cyclelist)):<EOL><INDENT>print '<STR_LIT>', cyclelist[i]<EOL>
!! EXPERIMENTAL FEATURE (flagged as private) !!

This function creates a Kippenhahn diagram as a contour plot of
the .se.h5 or .out.h5 files using any continuous variable
(columns in the hdf5 cycle data). Multiple columns may be
plotted, their name indicated in the list "plot", and their
thresholds in the list "thresholds".

Currently, this is only designed to take one threshold for each
variable but future versions will hopefully be able to plot with
multiple thresholds, however you may circumvent this issue by
repeating the variable in "plots" and entering a second
threshold for it in "thresholds".

Parameters
----------
sparse : integer
    x-axis (timestep) sparsity.  The true sparsity is
    sparse*sparse_intrinsic.  Try 100 or 500 for .se.h5 and 20
    for .out.h5 files and for preliminaxllimry plots.
cycle_start : integer, optional
    Cycle from which you wish to plot.  The default is 0.
cycle_end : integer, optional
    Maximum cycle that you wish to plot.  If cycle_end is 0,
    then it will plot up to the last cycle available.  The
    default is 0.
plot : list, optional
    1-D array containing the variables to be plotted (as
    strings, e.g. plots=['dcoeff','C-13'].  I recommend always
    plotting 'dcoeff' as plots[0]).  The default is ['dcoeff'].
thresholds : list, optional
    1-D array containing the thresholds corresponding to the
    variables in "plots".  The default is [1.0E+12].
xax : string, optional
    x-axis quantity; either 'log_time_left' or 'cycles'.  The
    default is 'log_time_left'.
alphas : list, optional
    Array containing the opacity (0 to 1) of the contour for
    each variable.  The default is [1.0].
yllim : float, optional
    Lower plot limit for y-axis (mass co-ordinate).  The default
    is 0..
yulim : float, optional
    Upper plot limit for y-axis (mass co-ordinate).  The default
    is 0..
y_res : integer, optional
    y-axis resolution. Defaults to 2000 but increasing to as
    much as 10000 does not significantly affect the plotting
    time.  The default is 2000.
xllim : float, optional
    Lower plot limit for x-axis.  The default is 0..
xulim : float, optional
    Upper plot limit for x-axis.  The default is 0..
age : string, optional
    Either 'years' or 'seconds', depending on the data.  The
    default is 'seconds'.
sparse_intrinsic : integer, optional
    Sparsity of timesteps in the data provided (usually 20 for
    .out.h5 files and 1 for .se.h5 files).  The default is 20.
engen : boolean, optional
    Whether the user would like to plot Kippenhahn of convective
    zones and energy generation.  If True, please still include
    plots=['dcoeff'] and thresholds=[1.0E+12'] in your call.
    This will require the data to have an 'eps_nuc' column, so
    the plot is only working for .se.h5 files from MESA in the
    current se library.  This is the most recent addition, so
    probably the most buggy.  The plot script will automatically
    calculate and assign multiple thresholds according to the
    model.  The default is False.
netnuc_name : string, optional
    The name of the column containing (eps_nuc-eps_neu).  If you
    do not have available eps_neu, then you can give
    netnuc_name="eps_nuc" to just plot energy generation.  The
    default is "eps_nuc".
engenalpha : float, optional
    Opacity of the energy generation contours.  The default
    is 0.6.
outfile : string, optional
    The name to save the plot as.  The default is 'plot.pdf'.
annotation : string, optional
    Some optional annotation to add to the plot.   The default
    is ''.
KEPLER : boolean, optional
    The default is False.