original_docstring: 
          Function for searching the LineList for candidates. The first step uses pure Python to isolate transitions
          that meet three criteria: the lower state energy, the catalog intensity, and the frequency distance.
  
          If no candidates are found, the function will return None. Otherwise, it will return the list of transitions
          and a list of associated normalized weights.
  
          Parameters
          ----------
          frequency: float
              Frequency in MHz to try and match.
          lstate_threshold: float, optional
              Lower state energy threshold in Kelvin
          freq_tol: float, optional
              Frequency tolerance in MHz for matching two frequencies
          int_tol: float, optional
              log Intensity threshold
  
          Returns
          -------
          transitions, weighting or None
              If candidates are found, lists of the transitions and the associated weights are returned.
              Otherwise, returns None
          
docstring: Function for searching the LineList for candidates. The first step uses pure Python to isolate transitions
  that meet three criteria: the lower state energy, the catalog intensity, and the frequency distance.
  
  If no candidates are found, the function will return None. Otherwise, it will return the list of transitions
  and a list of associated normalized weights.
  
  Parameters
  
  float
  Frequency in MHz to try and match.
  lstate_threshold: float, optional
  Lower state energy threshold in Kelvin
  freq_tol: float, optional
  Frequency tolerance in MHz for matching two frequencies
  int_tol: float, optional
  log Intensity threshold
  
  Returns
  
  transitions, weighting or None
  If candidates are found, lists of the transitions and the associated weights are returned.
  Otherwise, returns None
docstring_tokens: Function for searching the LineList for candidates . The first step uses pure Python to isolate transitions that meet three criteria : the lower state energy the catalog intensity and the frequency distance . If no candidates are found the function will return None . Otherwise it will return the list of transitions and a list of associated normalized weights . Parameters float Frequency in MHz to try and match . lstate_threshold : float optional Lower state energy threshold in Kelvin freq_tol : float optional Frequency tolerance in MHz for matching two frequencies int_tol : float optional log Intensity threshold Returns transitions weighting or None If candidates are found lists of the transitions and the associated weights are returned . Otherwise returns None
code: def find_candidates(
          self,
          frequency: float,
          lstate_threshold=4.0,
          freq_tol=1e-1,
          int_tol=-10.0,
          max_uncertainty=0.2,
      ):
          """
          Function for searching the LineList for candidates. The first step uses pure Python to isolate transitions
          that meet three criteria: the lower state energy, the catalog intensity, and the frequency distance.
  
          If no candidates are found, the function will return None. Otherwise, it will return the list of transitions
          and a list of associated normalized weights.
  
          Parameters
          ----------
          frequency: float
              Frequency in MHz to try and match.
          lstate_threshold: float, optional
              Lower state energy threshold in Kelvin
          freq_tol: float, optional
              Frequency tolerance in MHz for matching two frequencies
          int_tol: float, optional
              log Intensity threshold
  
          Returns
          -------
          transitions, weighting or None
              If candidates are found, lists of the transitions and the associated weights are returned.
              Otherwise, returns None
          """
          # Filter out all transition objects quickly with a list comprehension
          # and if statement
          if self.source == "Peaks":
              freq_attr = "frequency"
          else:
              freq_attr = "catalog_frequency"
          transitions = [
              obj
              for obj in self.transitions
              if all(
                  [
                      obj.lstate_energy <= lstate_threshold,
                      obj.catalog_intensity >= int_tol,
                      abs(getattr(obj, freq_attr) - frequency) <= freq_tol,
                      obj.uncertainty <= max_uncertainty,
                  ]
              )
          ]
          # If there are candidates, calculate the weights associated with each transition
          if len(transitions) != 0:
              transition_frequencies = np.array(
                  [getattr(obj, "freq_attr", np.nan) for obj in transitions]
              )
              transition_intensities = np.array(
                  [getattr(obj, "catalog_intensity", np.nan) for obj in transitions]
              )
              # If there are actually no catalog intensities, it should sum up to zero in which case we won't
              # use the intensities in the weight factors
              if np.nansum(transition_intensities) == 0.0:
                  transition_intensities = None
              weighting = analysis.line_weighting(
                  frequency, transition_frequencies, transition_intensities
              )
              # Only normalize if there's more than one
              if len(weighting) > 1:
                  weighting /= weighting.max()
              return transitions, weighting
          else:
              return None
code_tokens: def find_candidates ( self , frequency : float , lstate_threshold = 4.0 , freq_tol = 1e-1 , int_tol = - 10.0 , max_uncertainty = 0.2 , ) : if self . source == "Peaks" : freq_attr = "frequency" else : freq_attr = "catalog_frequency" transitions = [ obj for obj in self . transitions if all ( [ obj . lstate_energy <= lstate_threshold , obj . catalog_intensity >= int_tol , abs ( getattr ( obj , freq_attr ) - frequency ) <= freq_tol , obj . uncertainty <= max_uncertainty , ] ) ] if len ( transitions ) != 0 : transition_frequencies = np . array ( [ getattr ( obj , "freq_attr" , np . nan ) for obj in transitions ] ) transition_intensities = np . array ( [ getattr ( obj , "catalog_intensity" , np . nan ) for obj in transitions ] ) if np . nansum ( transition_intensities ) == 0.0 : transition_intensities = None weighting = analysis . line_weighting ( frequency , transition_frequencies , transition_intensities ) if len ( weighting ) > 1 : weighting /= weighting . max ( ) return transitions , weighting else : return None
short_docstring: Function for searching the LineList for candidates.
short_docstring_tokens: Function for searching the LineList for candidates .
comment: """
          Function for searching the LineList for candidates. The first step uses pure Python to isolate transitions
          that meet three criteria: the lower state energy, the catalog intensity, and the frequency distance.
  
          If no candidates are found, the function will return None. Otherwise, it will return the list of transitions
          and a list of associated normalized weights.
  
          Parameters
          ----------
          frequency: float
              Frequency in MHz to try and match.
          lstate_threshold: float, optional
              Lower state energy threshold in Kelvin
          freq_tol: float, optional
              Frequency tolerance in MHz for matching two frequencies
          int_tol: float, optional
              log Intensity threshold
  
          Returns
          -------
          transitions, weighting or None
              If candidates are found, lists of the transitions and the associated weights are returned.
              Otherwise, returns None
          """$SEP$# Filter out all transition objects quickly with a list comprehension$SEP$# and if statement$SEP$# If there are candidates, calculate the weights associated with each transition$SEP$# If there are actually no catalog intensities, it should sum up to zero in which case we won't$SEP$# use the intensities in the weight factors$SEP$# Only normalize if there's more than one