original_docstring: 
          Function for assigning peaks based on a local database file.
          The database is controlled with the SpectralCatalog class, which will handle all of the searching.
  
          Parameters
          ----------
          auto : bool, optional
              If True, the assignments are made automatically.
          dbpath : str or None, optional
              Filepath to the local database. If none is supplied, uses the default value from the user's home directory.
  
          
docstring: Function for assigning peaks based on a local database file.
  The database is controlled with the SpectralCatalog class, which will handle all of the searching.
  
  Parameters
  
  auto : bool, optional
  If True, the assignments are made automatically.
  dbpath : str or None, optional
  Filepath to the local database. If none is supplied, uses the default value from the user's home directory.
docstring_tokens: Function for assigning peaks based on a local database file . The database is controlled with the SpectralCatalog class which will handle all of the searching . Parameters auto : bool optional If True the assignments are made automatically . dbpath : str or None optional Filepath to the local database . If none is supplied uses the default value from the user ' s home directory .
code: def process_db(self, auto=True, dbpath=None):
          """
          Function for assigning peaks based on a local database file.
          The database is controlled with the SpectralCatalog class, which will handle all of the searching.
  
          Parameters
          ----------
          auto : bool, optional
              If True, the assignments are made automatically.
          dbpath : str or None, optional
              Filepath to the local database. If none is supplied, uses the default value from the user's home directory.
  
          """
          # Get the U-line list
          ulines = self.line_lists.get("Peaks", None).get_ulines()
          old_nulines = len(ulines.get_ulines())
          db = database.SpectralCatalog(dbpath)
          self.logger.info(f"Processing local database: {dbpath}")
          for index, uline in tqdm(enumerate(ulines)):
              self.logger.info(f"Searching database for {uline.frequency:.4f}")
              catalog_df = db.search_frequency(
                  uline.frequency, self.session.freq_prox, self.session.freq_abs
              )
              if catalog_df is not None:
                  catalog_df["frequency"].replace(0.0, np.nan, inplace=True)
                  catalog_df["frequency"].fillna(
                      catalog_df["catalog_frequency"], inplace=True
                  )
                  if len(catalog_df) > 0:
                      sliced_catalog = analysis.line_weighting(
                          uline.frequency,
                          catalog_df,
                          prox=self.session.freq_prox,
                          abs=self.session.freq_abs,
                          freq_col="frequency",
                      )
                      if self.verbose is True:
                          display(HTML(sliced_catalog.to_html()))
                      if auto is False:
                          index = int(input("Please choose a candidate by index."))
                      elif auto is True:
                          index = 0
                      if index in catalog_df.index:
                          select_df = catalog_df.iloc[index]
                          # Create an approximate quantum number string
                          new_dict = {
                              "index": index,
                              "frequency": uline.frequency,
                              "source": "Database",
                              "deviation": uline.frequency - select_df["frequency"],
                              "uline": False,
                          }
                          assign_dict = select_df.to_dict()
                          assign_dict.update(**new_dict)
                          # Use assign_line function to mark peak as assigned
                          uline.__dict__.update(**assign_dict)
                      else:
                          raise IndexError("Invalid index chosen for assignment.")
          # Update the internal table
          ass_df = pd.DataFrame(data=[ass_obj.__dict__ for ass_obj in self.assignments])
          remaining_ulines = self.line_lists.get("Peaks").get_ulines()
          self.table = ass_df
          self.logger.info(f"Prior number of ulines: {old_nulines}")
          self.logger.info(f"Current number of ulines: {len(remaining_ulines)}")
          self.logger.info("Finished processing local database.")
code_tokens: def process_db ( self , auto = True , dbpath = None ) : ulines = self . line_lists . get ( "Peaks" , None ) . get_ulines ( ) old_nulines = len ( ulines . get_ulines ( ) ) db = database . SpectralCatalog ( dbpath ) self . logger . info ( f"Processing local database: {dbpath}" ) for index , uline in tqdm ( enumerate ( ulines ) ) : self . logger . info ( f"Searching database for {uline.frequency:.4f}" ) catalog_df = db . search_frequency ( uline . frequency , self . session . freq_prox , self . session . freq_abs ) if catalog_df is not None : catalog_df [ "frequency" ] . replace ( 0.0 , np . nan , inplace = True ) catalog_df [ "frequency" ] . fillna ( catalog_df [ "catalog_frequency" ] , inplace = True ) if len ( catalog_df ) > 0 : sliced_catalog = analysis . line_weighting ( uline . frequency , catalog_df , prox = self . session . freq_prox , abs = self . session . freq_abs , freq_col = "frequency" , ) if self . verbose is True : display ( HTML ( sliced_catalog . to_html ( ) ) ) if auto is False : index = int ( input ( "Please choose a candidate by index." ) ) elif auto is True : index = 0 if index in catalog_df . index : select_df = catalog_df . iloc [ index ] new_dict = { "index" : index , "frequency" : uline . frequency , "source" : "Database" , "deviation" : uline . frequency - select_df [ "frequency" ] , "uline" : False , } assign_dict = select_df . to_dict ( ) assign_dict . update ( ** new_dict ) uline . __dict__ . update ( ** assign_dict ) else : raise IndexError ( "Invalid index chosen for assignment." ) ass_df = pd . DataFrame ( data = [ ass_obj . __dict__ for ass_obj in self . assignments ] ) remaining_ulines = self . line_lists . get ( "Peaks" ) . get_ulines ( ) self . table = ass_df self . logger . info ( f"Prior number of ulines: {old_nulines}" ) self . logger . info ( f"Current number of ulines: {len(remaining_ulines)}" ) self . logger . info ( "Finished processing local database." )
short_docstring: Function for assigning peaks based on a local database file.
short_docstring_tokens: Function for assigning peaks based on a local database file .
comment: """
          Function for assigning peaks based on a local database file.
          The database is controlled with the SpectralCatalog class, which will handle all of the searching.
  
          Parameters
          ----------
          auto : bool, optional
              If True, the assignments are made automatically.
          dbpath : str or None, optional
              Filepath to the local database. If none is supplied, uses the default value from the user's home directory.
  
          """$SEP$# Get the U-line list$SEP$# Create an approximate quantum number string$SEP$# Use assign_line function to mark peak as assigned$SEP$# Update the internal table