docs: def burnstage(self, **keyw):
          """
          This function calculates the presence of burning stages and
          outputs the ages when key isotopes are depleted and uses them
          to calculate burning lifetimes.
  
          Parameters
          ----------
          keyw : dict
              A dict of key word arguments.
  
          Returns
          -------
          list
              A list containing the following information: burn_cycles,
              burn_ages, burn_abun, burn_type and burn_lifetime.
  
          Notes
          -----
          The following keywords can also be used:
  
          +------------------+---------------+
          | Keyword Argument | Default Value |
          +==================+===============+
          | abund            | "iso_massf"   |
          +------------------+---------------+
          | isoa             | "A"           |
          +------------------+---------------+
          | isoz             | "Z"           |
          +------------------+---------------+
          | mass             | "mass"        |
          +------------------+---------------+
          | cycle            | "cycle"       |
          +------------------+---------------+
          | cyclefin         | 0             |
          +------------------+---------------+
  
          All arguments change the name of fields used to read data from
          HDF5 files, other than cyclefin.  Cyclefin is the last timestep
          to use when reading files.
  
          Cycles contain the cycle numbers for the various points where
          the abundance is abun.  The age of the star at each point and
          the type of burning is indicated by those arrays.  The lifetimes
          are calculated by.
  
          """
  
          if ("isoa" in keyw) == False:
              keyw["isoa"] = "A"
          if ("isoz" in keyw) == False:
              keyw["isoz"] = "Z"
          if ("mass" in keyw) == False:
              keyw["mass"] = "mass"
          if ("age" in keyw) == False:
              keyw["age"] = "age"
          if ("abund" in keyw) == False:
              keyw["abund"] = "iso_massf"
          if ("cycle" in keyw) == False:
              keyw["cycle"] = "cycle"
          if ("cyclefin" in keyw) == False:
              cyclefin = 1.e99
          else:
              cyclefin = keyw["cyclefin"]
  
          burn_cycles = []
          burn_ages = []
          burn_abun = []
          burn_type = []
  
          burn_lifetime = []
  
          firstfile = True
  
          hemax, cmax, nemax, omax = 0, 0, 0, 0
  
  
          cycles_list = self.se.cycles
          xm_list     = self.se.get(keyw["mass"])
          age_list    = self.se.get(keyw["age"])
          abund_list  = self.se.get(keyw["abund"])
          tables = self.se.Tables()
          isoa_list   = tables[0]
          isoz_list   = tables[1]
  
          # Check the order of the input data
          xm_init = xm_list[0]
          centre = 0
          if isinstance(xm_init, list) == True:
              if xm_init[0] > xm_init[1]:
                  # mass is descending with shell number and the centre of the star
                  # is the last shell
                  centre = -1
  
          # Determine yps indices for certain abundances
          for i in range(len(isoa_list)):
              try:
                  A = int(isoa_list[i])
                  Z = int(isoz_list[i])
              except TypeError:
                  A = int(isoa_list[i][0])
                  Z = int(isoz_list[i][0])
  
              if A == 1 and Z == 1:
                  h1index = i
              elif A == 4 and Z == 2:
                  he4index = i
              elif A == 12 and Z == 6:
                  c12index = i
              elif A == 16 and Z == 8:
                  o16index = i
              elif A == 20 and Z == 10:
                  ne20index = i
              elif A == 28 and Z == 14:
                  si28index = i
  
          if firstfile == True:
              hmax = abund_list[0][centre][h1index]
              firstfile = False
  
          # Try and determine the location of a convective core using the central and
          # next from central shells
          for i in range(1, len(cycles_list)-1):
              if cycles_list[i] > cyclefin and cyclefin != 0:
                  pair = False
                  age1 = -1
                  for i in range(len(burn_type)):
                      if 'start' in burn_type[i] and pair == False:
                          age1 = burn_ages[i]
                          pair = True
                      elif 'end' in burn_type[i] and pair == True:
                          age2 = burn_ages[i]
                          pair = False
                          if age1 != -1:
                              burn_lifetime.append(age2 - age1)
                              age1 = -1
  
                  return [burn_cycles, burn_ages, burn_abun, burn_type,
                  burn_lifetime]
  
              # H-burning
              hcen  = abund_list[i][centre][h1index]
              hcennext = abund_list[i+1][centre][h1index]
              if hcen >1.e-10:
                  if hcennext < hmax-0.003 and hcen >= hmax-0.003:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(hcen)
                      burn_type.append('H_start')
  
                  if hcennext < 1.e-1 and hcen >= 1.e-1:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-1)
                      burn_type.append('H')
  
                  if hcennext < 1.e-2 and hcen >= 1.e-2:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-2)
                      burn_type.append('H')
  
                  if hcennext < 1.e-3 and hcen >= 1.e-3:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-3)
                      burn_type.append('H')
  
                  if hcennext < 1.e-4 and hcen >= 1.e-4:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-4)
                      burn_type.append('H')
  
                  if hcennext < 1.e-5 and hcen >= 1.e-5:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-5)
                      burn_type.append('H_end')
                      hemax = abund_list[i][centre][he4index]
  
                  if hcennext < 1.e-6 and hcen >= 1.e-6:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-6)
                      burn_type.append('H')
  
                  if hcennext < 1.e-9 and hcen >= 1.e-9:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-9)
                      burn_type.append('H')
  
              # He-burning
              hecen  = abund_list[i][centre][he4index]
              hecennext = abund_list[i+1][centre][he4index]
              if hcen < 1.e-5 and hecen > 1.e-10:
                  if hecennext < hemax-0.003 and hecen >= hemax-0.003:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(hecen)
                      burn_type.append('He_start')
  
                  if hecennext < 1.e-1 and hecen >= 1.e-1:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-1)
                      burn_type.append('He')
  
                  if hecennext < 1.e-2 and hecen >= 1.e-2:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-2)
                      burn_type.append('He')
  
                  if hecennext < 1.e-3 and hecen >= 1.e-3:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-3)
                      burn_type.append('He')
  
                  if hecennext < 1.e-4 and hecen >= 1.e-4:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-4)
                      burn_type.append('He')
  
                  if hecennext < 1.e-5 and hecen >= 1.e-5:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-5)
                      burn_type.append('He_end')
                      cmax = abund_list[i][centre][c12index]
  
                  if hecennext < 1.e-6 and hecen >= 1.e-6:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-6)
                      burn_type.append('He')
  
                  if hecennext < 1.e-9 and hecen >= 1.e-9:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-9)
                      burn_type.append('He')
  
              # C-burning
              ccen  = abund_list[i][centre][c12index]
              ccennext = abund_list[i+1][centre][c12index]
              if hcen < 1.e-5 and hecen < 1.e-5 and ccen > 1.e-10:
                  if ccennext < cmax-0.003 and ccen >= cmax-0.003:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(ccen)
                      burn_type.append('C_start')
  
                  if ccennext < 1.e-1 and ccen >= 1.e-1:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-1)
                      burn_type.append('C')
  
                  if ccennext < 1.e-2 and ccen >= 1.e-2:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-2)
                      burn_type.append('C')
  
                  if ccennext < 1.e-3 and ccen >= 1.e-3:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-3)
                      burn_type.append('C')
  
                  if ccennext < 1.e-4 and ccen >= 1.e-4:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-4)
                      burn_type.append('C')
  
                  if ccennext < 1.e-5 and ccen >= 1.e-5:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-5)
                      burn_type.append('C_end')
                      nemax = abund_list[i][centre][ne20index]
  
                  if ccennext < 1.e-6 and ccen >= 1.e-6:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-6)
                      burn_type.append('C')
  
                  if ccennext < 1.e-9 and ccen >= 1.e-9:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-9)
                      burn_type.append('C')
  
              # Ne-burning
              necen  = abund_list[i][centre][ne20index]
              necennext = abund_list[i+1][centre][ne20index]
              if hcen < 1.e-5 and hecen < 1.e-5 and ccen < 1.e-3 and necen > 1.e-10:
                  if necennext < nemax-0.003 and necen >= nemax-0.003:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(necen)
                      burn_type.append('Ne_start')
  
                  if necennext < 1.e-1 and necen >= 1.e-1:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-1)
                      burn_type.append('Ne')
  
                  if necennext < 1.e-2 and necen >= 1.e-2:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-2)
                      burn_type.append('Ne')
  
  
                  if necennext < 1.e-3 and necen >= 1.e-3:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-3)
                      burn_type.append('Ne_end')
                      omax = abund_list[i][centre][o16index]
  
                  if necennext < 1.e-4 and necen >= 1.e-4:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-4)
                      burn_type.append('Ne')
  
                  if necennext < 1.e-5 and necen >= 1.e-5:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-5)
                      burn_type.append('Ne')
  
                  if necennext < 1.e-6 and necen >= 1.e-6:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-6)
                      burn_type.append('Ne')
  
                  if necennext < 1.e-9 and necen >= 1.e-9:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-9)
                      burn_type.append('Ne')
  
              # O-burning
              ocen  = abund_list[i][centre][o16index]
              ocennext = abund_list[i+1][centre][o16index]
              if hcen < 1.e-5 and hecen < 1.e-5 and ccen < 1.e-3 and ocen > 1.e-10:
                  if ocennext < omax-0.003 and ocen >= omax-0.003:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(ccen)
                      burn_type.append('O_start')
  
                  if ocennext < 1.e-1 and ocen >= 1.e-1:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-1)
                      burn_type.append('O')
  
                  if ocennext < 1.e-2 and ocen >= 1.e-2:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-2)
                      burn_type.append('O')
  
                  if ocennext < 1.e-3 and ocen >= 1.e-3:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-3)
                      burn_type.append('O')
  
                  if ocennext < 1.e-4 and ocen >= 1.e-4:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-4)
                      burn_type.append('O')
  
                  if ocennext < 1.e-5 and ocen >= 1.e-5:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-5)
                      burn_type.append('O_end')
  
                  if ocennext < 1.e-6 and ocen >= 1.e-6:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-6)
                      burn_type.append('O')
  
                  if ocennext < 1.e-9 and ocen >= 1.e-9:
                      burn_cycles.append(cycles_list[i])
                      burn_ages.append(age_list[i])
                      burn_abun.append(1.e-9)
                      burn_type.append('O')
  
  
          pair = False
          age1 = -1
          for i in range(len(burn_type)):
              if 'start' in burn_type[i] and pair == False:
                  age1 = burn_ages[i]
                  pair = True
              elif 'end' in burn_type[i] and pair == True:
                  age2 = burn_ages[i]
                  pair = False
                  if age1 != -1:
                      burn_lifetime.append(age2 - age1)
                      age1 = -1
  
          return [burn_cycles, burn_ages, burn_abun, burn_type, burn_lifetime]