parameters: (self, *, atom_index: int, k_index: int, angle: float,
                                       sdata: SData, bins: np.ndarray,
                                       min_order: int = 1)
docstring: :param atom_index: number of atom
          :param k_index: Index of k-point in phonon data
          :param angle: Scattering angle determining energy-q relationship
          :sdata: Data container to which results will be summed in-place
          :bins: Frequency bins consistent with sdata
          :min_order: Lowest quantum order to evaluate. (The max is determined by self._quantum_order_num.)
docstring_summary: :param atom_index: number of atom
          :param k_index: Index of k-point in phonon data
          :param angle: Scattering angle determining energy-q relationship
          :sdata: Data container to which results will be summed in-place
          :bins: Frequency bins consistent with sdata
          :min_order: Lowest quantum order to evaluate. (The max is determined by self._quantum_order_num.)
docstring_tokens: : param atom_index : number of atom : param k_index : Index of k - point in phonon data : param angle : Scattering angle determining energy - q relationship : sdata : Data container to which results will be summed in - place : bins : Frequency bins consistent with sdata : min_order : Lowest quantum order to evaluate . ( The max is determined by self . _quantum_order_num . )
function: def _calculate_s_powder_one_atom(self, *, atom_index: int, k_index: int, angle: float,
                                       sdata: SData, bins: np.ndarray,
                                       min_order: int = 1) -> None:
          """
          :param atom_index: number of atom
          :param k_index: Index of k-point in phonon data
          :param angle: Scattering angle determining energy-q relationship
          :sdata: Data container to which results will be summed in-place
          :bins: Frequency bins consistent with sdata
          :min_order: Lowest quantum order to evaluate. (The max is determined by self._quantum_order_num.)
  
          """
          kpoint_weight = self._abins_data.get_kpoints_data()[k_index].weight
  
          fundamentals = self._powder_data.get_frequencies()[k_index]
          fund_coeff = np.arange(fundamentals.size, dtype=INT_TYPE)
  
          # Initialise with fundamentals regardless of whether starting with order 1 or 2
          frequencies = np.copy(fundamentals)
          coefficients = np.copy(fund_coeff)
  
          a_tensor = self._powder_data.get_a_tensors()[k_index][atom_index]
          a_trace = self._powder_data.get_a_traces(k_index)[atom_index]
          b_tensor = self._powder_data.get_b_tensors()[k_index][atom_index]
          b_trace = self._powder_data.get_b_traces(k_index)[atom_index]
  
          calculate_order = {1: self._calculate_order_one,
                             2: self._calculate_order_two,
                             3: self._calculate_order_three,
                             4: self._calculate_order_four}
  
          # Chunking to save memory has been removed pending closer examination
          for order in range(min_order, self._quantum_order_num + 1):
              frequencies, coefficients = FrequencyPowderGenerator.construct_freq_combinations(
                  previous_array=frequencies,
                  previous_coefficients=coefficients,
                  fundamentals_array=fundamentals,
                  fundamentals_coefficients=fund_coeff,
                  quantum_order=order)
              q2 = self._instrument.calculate_q_powder(input_data=frequencies, angle=angle)
  
              scattering_intensities = calculate_order[order](
                  q2=q2, frequencies=frequencies, indices=coefficients,
                  a_tensor=a_tensor, a_trace=a_trace, b_tensor=b_tensor, b_trace=b_trace)
              rebinned_spectrum, _ = np.histogram(frequencies, bins=bins,
                                                  weights=(scattering_intensities * kpoint_weight),
                                                  density=False)
              sdata.add_dict({f'atom_{atom_index}':
                              {'s': {f'order_{order}': rebinned_spectrum}}})
  
              # Prune modes with low intensity; these are assumed not to contribute to higher orders
              frequencies, coefficients = self._calculate_s_over_threshold(scattering_intensities,
                                                                           freq=frequencies,
                                                                           coeff=coefficients)
function_tokens: def _calculate_s_powder_one_atom ( self , * , atom_index : int , k_index : int , angle : float , sdata : SData , bins : np . ndarray , min_order : int = 1 ) -> None : kpoint_weight = self . _abins_data . get_kpoints_data ( ) [ k_index ] . weight fundamentals = self . _powder_data . get_frequencies ( ) [ k_index ] fund_coeff = np . arange ( fundamentals . size , dtype = INT_TYPE ) # Initialise with fundamentals regardless of whether starting with order 1 or 2 frequencies = np . copy ( fundamentals ) coefficients = np . copy ( fund_coeff ) a_tensor = self . _powder_data . get_a_tensors ( ) [ k_index ] [ atom_index ] a_trace = self . _powder_data . get_a_traces ( k_index ) [ atom_index ] b_tensor = self . _powder_data . get_b_tensors ( ) [ k_index ] [ atom_index ] b_trace = self . _powder_data . get_b_traces ( k_index ) [ atom_index ] calculate_order = { 1 : self . _calculate_order_one , 2 : self . _calculate_order_two , 3 : self . _calculate_order_three , 4 : self . _calculate_order_four } # Chunking to save memory has been removed pending closer examination for order in range ( min_order , self . _quantum_order_num + 1 ) : frequencies , coefficients = FrequencyPowderGenerator . construct_freq_combinations ( previous_array = frequencies , previous_coefficients = coefficients , fundamentals_array = fundamentals , fundamentals_coefficients = fund_coeff , quantum_order = order ) q2 = self . _instrument . calculate_q_powder ( input_data = frequencies , angle = angle ) scattering_intensities = calculate_order [ order ] ( q2 = q2 , frequencies = frequencies , indices = coefficients , a_tensor = a_tensor , a_trace = a_trace , b_tensor = b_tensor , b_trace = b_trace ) rebinned_spectrum , _ = np . histogram ( frequencies , bins = bins , weights = ( scattering_intensities * kpoint_weight ) , density = False ) sdata . add_dict ( { f'atom_{atom_index}' : { 's' : { f'order_{order}' : rebinned_spectrum } } } ) # Prune modes with low intensity; these are assumed not to contribute to higher orders frequencies , coefficients = self . _calculate_s_over_threshold ( scattering_intensities , freq = frequencies , coeff = coefficients )