def write_deltatable(self, filename='<STR_LIT:default>', decayed=True,<EOL>dcycle=<NUM_LIT>, iniabufile='<STR_LIT>'):
print('<STR_LIT>')<EOL>filename = '<STR_LIT>'<EOL>if decayed:<EOL><INDENT>isomassmf = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>isomassmf = '<STR_LIT>'<EOL><DEDENT>tp_pos, co_return = self._tp_finder(dcycle)<EOL>noele = <NUM_LIT:1>   <EOL>elelist = list()<EOL>isolisttmp = list()<EOL>isolist = list()<EOL>isoabulist = list()<EOL>isoabulisttmp = list()<EOL>inut = iniabu(iniabufile)<EOL>itmp = inut.names[<NUM_LIT:0>][<NUM_LIT:0>:<NUM_LIT:2>].replace('<STR_LIT:U+0020>','<STR_LIT>')<EOL>elelist.append([itmp, inut.z[<NUM_LIT:0>]])<EOL>isolisttmp.append(inut.a[<NUM_LIT:0>])<EOL>isoabulisttmp.append(inut.abu[<NUM_LIT:0>])<EOL>for i in range(<NUM_LIT:1>,len(inut.names)):<EOL><INDENT>if inut.names[i][<NUM_LIT:0>:<NUM_LIT:2>].replace('<STR_LIT:U+0020>','<STR_LIT>') != itmp:<EOL><INDENT>itmp = inut.names[i][<NUM_LIT:0>:<NUM_LIT:2>].replace('<STR_LIT:U+0020>','<STR_LIT>')<EOL>elelist.append([itmp, inut.z[i]])<EOL>isolist.append(isolisttmp)<EOL>isolisttmp = list()<EOL>isolisttmp.append(inut.a[i])<EOL>isoabulist.append(isoabulisttmp)<EOL>isoabulisttmp = list()<EOL>isoabulisttmp.append(inut.abu[i])<EOL>noele += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>isolisttmp.append(inut.a[i])<EOL>isoabulisttmp.append(inut.abu[i])<EOL><DEDENT><DEDENT>isolist.append(isolisttmp)<EOL>isoabulist.append(isoabulisttmp)<EOL>elelist = elelist[<NUM_LIT:5>:len(elelist)-<NUM_LIT:2>]<EOL>isolist = isolist[<NUM_LIT:5>:len(elelist)-<NUM_LIT:2>]<EOL>isoabulist = isoabulist[<NUM_LIT:5>:len(elelist)-<NUM_LIT:2>]<EOL>isoabuindex = zeros(len(isoabulist),dtype=int)   <EOL>for i in range(len(isoabulist)):<EOL><INDENT>tmp = <NUM_LIT:0><EOL>for j in range(len(isoabulist[i])):<EOL><INDENT>if isoabulist[i][j] > tmp:<EOL><INDENT>isoabuindex[i] = j<EOL>tmp = isoabulist[i][j]<EOL><DEDENT><DEDENT><DEDENT>deltalist = list()<EOL>solsysratio = list()<EOL>for i in range(len(isolist)):<EOL><INDENT>if len(isolist[i]) > <NUM_LIT:1>:<EOL><INDENT>for j in range(len(isolist[i])):<EOL><INDENT>if j != isoabuindex[i]:<EOL><INDENT>deltalist.append([elelist[i][<NUM_LIT:0>], isolist[i][j], isolist[i][isoabuindex[i]]])<EOL>solsysratio.append(old_div(isoabulist[i][j], isoabulist[i][isoabuindex[i]]))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>solsysratio = array(solsysratio)<EOL>write_out = zeros((len(tp_pos), len(deltalist) + <NUM_LIT:2>))<EOL>for i in range(len(write_out)):<EOL><INDENT>write_out[i][<NUM_LIT:0>] = tp_pos[i]<EOL>write_out[i][<NUM_LIT:1>] = co_return[i]<EOL><DEDENT>deltaheader = list()<EOL>for deli in range(len(deltalist)):<EOL><INDENT>iso1 = zeros(len(tp_pos))<EOL>iso2 = zeros(len(tp_pos))<EOL>if len(deltalist[deli][<NUM_LIT:0>]) == <NUM_LIT:1>:<EOL><INDENT>iso1name = deltalist[deli][<NUM_LIT:0>].upper() + '<STR_LIT:->' + str(int(deltalist[deli][<NUM_LIT:1>]))<EOL>iso2name = deltalist[deli][<NUM_LIT:0>].upper() + '<STR_LIT:->' + str(int(deltalist[deli][<NUM_LIT:2>]))<EOL><DEDENT>else:<EOL><INDENT>iso1name = deltalist[deli][<NUM_LIT:0>][<NUM_LIT:0>].upper() + deltalist[deli][<NUM_LIT:0>][<NUM_LIT:1>] + '<STR_LIT:->' + str(int(deltalist[deli][<NUM_LIT:1>]))<EOL>iso2name = deltalist[deli][<NUM_LIT:0>][<NUM_LIT:0>].upper() + deltalist[deli][<NUM_LIT:0>][<NUM_LIT:1>] + '<STR_LIT:->' + str(int(deltalist[deli][<NUM_LIT:2>]))<EOL><DEDENT>iso_data = self.get(tp_pos,isomassmf,[iso1name,iso2name])<EOL>iso1 = np.zeros(len(iso_data))<EOL>iso2 = np.zeros(len(iso_data))<EOL>for i in range(len(iso_data)):<EOL><INDENT>iso1[i] = iso_data[i][<NUM_LIT:0>]<EOL>iso2[i] = iso_data[i][<NUM_LIT:1>]<EOL><DEDENT>deltavalues = (iso1/iso2 / solsysratio[deli] - <NUM_LIT:1.>) * <NUM_LIT><EOL>for i in range(len(deltavalues)):<EOL><INDENT>write_out[i][deli+<NUM_LIT:2>] = deltavalues[i]<EOL><DEDENT>deltaheader.append('<STR_LIT>' + deltalist[deli][<NUM_LIT:0>] + str(int(deltalist[deli][<NUM_LIT:1>])) + '<STR_LIT:_>' + deltalist[deli][<NUM_LIT:0>] + str(int(deltalist[deli][<NUM_LIT:2>])))<EOL><DEDENT>outf = open(filename,'<STR_LIT:w>')<EOL>outf.writelines('<STR_LIT>'.ljust(<NUM_LIT>) + '<STR_LIT>'.ljust(<NUM_LIT>))<EOL>for i in range(len(deltaheader)):<EOL><INDENT>if i != len(deltaheader)-<NUM_LIT:1>:<EOL><INDENT>outfstr = deltaheader[i] + '<STR_LIT:U+002C>'<EOL><DEDENT>else:<EOL><INDENT>outfstr = deltaheader[i]<EOL><DEDENT>outf.writelines(outfstr.ljust(<NUM_LIT>))<EOL><DEDENT>outf.writelines('<STR_LIT:\n>')<EOL>for i in range(len(write_out)):<EOL><INDENT>for j in range(len(write_out[i])):<EOL><INDENT>if j != len(write_out[i])-<NUM_LIT:1>:<EOL><INDENT>outfstr = format(write_out[i][j],'<STR_LIT>') + '<STR_LIT:U+002C>'<EOL><DEDENT>else:<EOL><INDENT>outfstr = format(write_out[i][j],'<STR_LIT>')<EOL><DEDENT>outf.writelines(outfstr.ljust(<NUM_LIT>))<EOL><DEDENT>outf.writelines('<STR_LIT:\n>')<EOL><DEDENT>outf.close()<EOL>
This subroutine is to write out tables with delta values for
cosmochemists to use in comparison with their data.

No options are necessarily needed to load this routine, however,
it might be useful to specify a filename.  This file furthermore
searches for thermal pulses, hence, it's only useful for
non-explosive TP-AGB stars!

Parameters
----------
filename : string, optional
    Choose the filename you want.  The default is "default".
decayed : boolean, optional
    Value if decayed massfractions of isotope should be taken
    or not.  The default is False.
dcycle : integer, optional
    Difference between cycles to search for thermal pulses.  The
    default is 500.
iniabufile : string, optional
    File with initial abundances.  As a standard value, the
    GN93 file is used (in USEEPP folder).  Important, input
    file has to be USEEPP conforming, see NuGrid book! The
    default is '../../frames/mppnp/USEEPP/iniab2.0E-02GN93.ppn'.

Notes
-----
Regardless of what value is used as filename it will be replaced
with 'delta_outfile.txt'.