parameters: (nuc_data, build_dir)
docstring: Adds the photofission product yields to the hdf5 library.
  
      Parameters
      ----------
      nuc_data : str
          Path to nuclide data file.
      build_dir : str
          Directory with cinder.dat file.
docstring_summary: Adds the photofission product yields to the hdf5 library.
docstring_tokens: Adds the photofission product yields to the hdf5 library .
function: def make_photon_fp_yields(nuc_data, build_dir):
      """Adds the photofission product yields to the hdf5 library.
  
      Parameters
      ----------
      nuc_data : str
          Path to nuclide data file.
      build_dir : str
          Directory with cinder.dat file.
      """
      # Open the HDF5 File
      db = tb.open_file(nuc_data, 'a', filters=BASIC_FILTERS)
  
      # Ensure that the appropriate file structure is present
      _init_cinder(db)
  
      # Read in cinder data file
      cinder_dat = os.path.join(build_dir, 'cinder.dat')
      with io.open(cinder_dat, 'rb') as f:
          raw_data = f.read()
      raw_data = safe_decode(raw_data)
  
      # Get group sizes
      N_n, N_g = get_fp_sizes(raw_data)
  
      # get the info table
      info_table = grab_photon_fp_info(raw_data)
  
      # Grab the part of the file that is a neutron fission product yields
      m_yields = re.search(gfp_yields_pattern, raw_data, re.DOTALL)
      gfp_yields_raw = m_yields.group(0)
  
      # Init the neutron fission product info table
      gfp_table = db.create_table('/photon/cinder_fission_products/', 'yields',
                                 np.empty(0, dtype=fp_yields_dtype),
                                 'CINDER Photofission Product Yields')
      gfprow = gfp_table.row
  
      # Iterate over all to-nucs
      fp_to_nuc_pattern = fp_to_nuc_base + N_g*fp_to_nuc_insert + ")"
      for m_to in re.finditer(fp_to_nuc_pattern, gfp_yields_raw):
          to_nuc = nucname.id(m_to.group(2).strip())
  
          # Check matestable state
          if 1 < to_nuc % 10:
              # Metastable state too high!
              continue
  
          # Get the array of yield data
          yields = np.array(m_to.group(3).split(), dtype=float)
          assert len(yields) == N_g
  
          # Prep rows to the table
          for n in range(N_g):
              info = info_table[n]
              gfprow['index'] = info[0]
              gfprow['from_nuc'] = info[1]
              gfprow['to_nuc'] = to_nuc
              gfprow['mass_frac'] = yields[n]
              gfprow.append()
  
          # Write the table
          gfp_table.flush()
  
      # Close the hdf5 file
      db.close()
function_tokens: def make_photon_fp_yields ( nuc_data , build_dir ) : # Open the HDF5 File db = tb . open_file ( nuc_data , 'a' , filters = BASIC_FILTERS ) # Ensure that the appropriate file structure is present _init_cinder ( db ) # Read in cinder data file cinder_dat = os . path . join ( build_dir , 'cinder.dat' ) with io . open ( cinder_dat , 'rb' ) as f : raw_data = f . read ( ) raw_data = safe_decode ( raw_data ) # Get group sizes N_n , N_g = get_fp_sizes ( raw_data ) # get the info table info_table = grab_photon_fp_info ( raw_data ) # Grab the part of the file that is a neutron fission product yields m_yields = re . search ( gfp_yields_pattern , raw_data , re . DOTALL ) gfp_yields_raw = m_yields . group ( 0 ) # Init the neutron fission product info table gfp_table = db . create_table ( '/photon/cinder_fission_products/' , 'yields' , np . empty ( 0 , dtype = fp_yields_dtype ) , 'CINDER Photofission Product Yields' ) gfprow = gfp_table . row # Iterate over all to-nucs fp_to_nuc_pattern = fp_to_nuc_base + N_g * fp_to_nuc_insert + ")" for m_to in re . finditer ( fp_to_nuc_pattern , gfp_yields_raw ) : to_nuc = nucname . id ( m_to . group ( 2 ) . strip ( ) ) # Check matestable state if 1 < to_nuc % 10 : # Metastable state too high! continue # Get the array of yield data yields = np . array ( m_to . group ( 3 ) . split ( ) , dtype = float ) assert len ( yields ) == N_g # Prep rows to the table for n in range ( N_g ) : info = info_table [ n ] gfprow [ 'index' ] = info [ 0 ] gfprow [ 'from_nuc' ] = info [ 1 ] gfprow [ 'to_nuc' ] = to_nuc gfprow [ 'mass_frac' ] = yields [ n ] gfprow . append ( ) # Write the table gfp_table . flush ( ) # Close the hdf5 file db . close ( )