def presnyields(self, *cycles, **keyw):
abund_list  = []<EOL>xm_list  = []<EOL>if ("<STR_LIT>" in keyw) == False:<EOL><INDENT>keyw["<STR_LIT>"] = "<STR_LIT>"<EOL><DEDENT>if ("<STR_LIT>" in keyw) == False:<EOL><INDENT>keyw["<STR_LIT>"] = "<STR_LIT>"<EOL><DEDENT>if ("<STR_LIT>" in keyw) == False:<EOL><INDENT>mrem = <NUM_LIT:0.><EOL><DEDENT>else:<EOL><INDENT>mrem = keyw["<STR_LIT>"]<EOL><DEDENT>cylen = len(cycles)<EOL>if cylen > <NUM_LIT:2>:<EOL><INDENT>cylen = <NUM_LIT:2><EOL><DEDENT>for i in range(cylen):<EOL><INDENT>cycle = cycles[i]<EOL>abund_list.append(self.se.get(cycle, keyw['<STR_LIT>']))<EOL>xm_list.append(self.se.get(cycle, keyw['<STR_LIT>']))<EOL><DEDENT>isoX = abund_list[<NUM_LIT:0>]<EOL>xm = xm_list[<NUM_LIT:0>]<EOL>if cylen == <NUM_LIT:2>:<EOL><INDENT>isoXini = abund_list[<NUM_LIT:1>] <EOL><DEDENT>niso = len(isoX[<NUM_LIT:0>,:])<EOL>nshells = len(xm)<EOL>X_i = np.zeros([niso], float)<EOL>ybound = np.zeros([niso], float)<EOL>xarray = np.zeros([nshells+<NUM_LIT:1>], float)<EOL>yarray = np.zeros([nshells+<NUM_LIT:1>], float)<EOL>for k in range(nshells):<EOL><INDENT>k1 = k<EOL>if mrem<=xm[k]:<EOL><INDENT>break<EOL><DEDENT><DEDENT>for i in range(niso):<EOL><INDENT>if k1>=<NUM_LIT:1>:<EOL><INDENT>if isoX[k1-<NUM_LIT:1>,i]!=<NUM_LIT:0.0>:<EOL><INDENT>m=old_div((isoX[k1,i]-isoX[k1-<NUM_LIT:1>,i]),(xm[k1]-xm[k1-<NUM_LIT:1>]))<EOL>ybound[i] = isoX[k1-<NUM_LIT:1>,i] +m*(mrem-xm[k1-<NUM_LIT:1>])<EOL><DEDENT>else:<EOL><INDENT>ybound[i]=<NUM_LIT><EOL><DEDENT><DEDENT>if k1==<NUM_LIT:0>:<EOL><INDENT>if isoX[k1,i]!=<NUM_LIT:0.0>:<EOL><INDENT>ybound[i]=isoX[k1,i]<EOL><DEDENT>else:<EOL><INDENT>ybound[i]=<NUM_LIT><EOL><DEDENT><DEDENT><DEDENT>xarray[<NUM_LIT:0>] = mrem<EOL>xarray[<NUM_LIT:1>:nshells-k1+<NUM_LIT:1>] = xm[k1:nshells]<EOL>for i in range(niso):<EOL><INDENT>yarray[<NUM_LIT:0>] = ybound[i]<EOL>for j in range(nshells-k1):<EOL><INDENT>if isoX[k1+j,i] != <NUM_LIT:0.0>:<EOL><INDENT>yarray[j+<NUM_LIT:1>] = isoX[k1+j,i]<EOL><DEDENT>else:<EOL><INDENT>yarray[j+<NUM_LIT:1>] = <NUM_LIT><EOL><DEDENT><DEDENT>if cylen == <NUM_LIT:1>:<EOL><INDENT>for j in range(nshells-k1):<EOL><INDENT>X_i[i] = X_i[i] + ((<NUM_LIT:0.5>*(yarray[j+<NUM_LIT:1>] + yarray[j])) *(xarray[j+<NUM_LIT:1>] - xarray[j]))<EOL><DEDENT><DEDENT>elif cylen == <NUM_LIT:2>:<EOL><INDENT>for j in range(nshells-k1):<EOL><INDENT>X_i[i] = X_i[i] + ((<NUM_LIT:0.5>*(yarray[j+<NUM_LIT:1>] + yarray[j]) - isoXini[-<NUM_LIT:1>,i]) *(xarray[j+<NUM_LIT:1>] - xarray[j]))<EOL><DEDENT><DEDENT><DEDENT>return X_i<EOL>
This function calculates the presupernova yields of a full
structure profile from a remnant mass, mrem, to the surface.

Parameters
----------
cycles : variadic tuple
    cycle[0] is the cycle to perform the presupernova yields
    calculations on.  If cycle[1] is also specified, the yields
    are outputted using 'initial' abundances from cycle[1],
    otherwise the ejected masses are outputted.
keyw : dict
    A dict of key word arguments.

Notes
-----
The following keywords can be used:

+------------------+---------------+
| Keyword Argument | Default Value |
+==================+===============+
| abund            | "iso_massf"   |
+------------------+---------------+
| xm               | "mass"        |
+------------------+---------------+
| mrem             | 0             |
+------------------+---------------+

abund and xm are used when the variables within the input file
differ in their names.  The default values are set to the
output typically found in an MPPNP output file.  For example,
if the table for the abundances is called "abundances" instead
of the default value, use abund = "abundances" as a keyword
argument.

mrem is specified using a keyword argument and tells the program
where to begin integrating.