parameters: (exp_number, scan_number, spice_ub_matrix)
return_statement: return up_cart, us_cart
docstring: Second approach to calculate absorption correction factor without calculating B matrix
  
      :param exp_number:
      :param scan_number:
      :param spice_ub_matrix:
      :return:
docstring_summary: Second approach to calculate absorption correction factor without calculating B matrix
docstring_tokens: Second approach to calculate absorption correction factor without calculating B matrix
function: def calculate_absorption_correction_2(exp_number, scan_number, spice_ub_matrix):
      """Second approach to calculate absorption correction factor without calculating B matrix
  
      :param exp_number:
      :param scan_number:
      :param spice_ub_matrix:
      :return:
      """
      # process angles from SPICE table
      theta2ave = get_average_spice_table(exp_number, scan_number, '2theta')  # sum(theta2(:))/length(theta2);
      chiave = get_average_spice_table(exp_number, scan_number, 'chi')  # sum(chi(:))/length(chi);
      phiave = get_average_spice_table(exp_number, scan_number, 'phi')  # sum(phi(:))/length(phi);
      avg_omega = get_average_omega(exp_number, scan_number)
  
      up_phi = calculate_upphi(avg_omega, theta2ave, chiave, phiave)
      us_phi = calculate_usphi(avg_omega, theta2ave, chiave, phiave)
  
      vec_q = numpy.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
      matrix_q = numpy.dot(spice_ub_matrix, vec_q)
      h1c = matrix_q[:, 0]
      h2c = matrix_q[:, 1]
      h3c = matrix_q[:, 2]
  
      t1c = h1c/(math.sqrt(h1c[1]**2+h1c[2]**2+h1c[0]**2))
      t2c = h2c/(math.sqrt(h2c[1]**2+h2c[2]**2+h2c[0]**2))
      t3c = h3c/(math.sqrt(h3c[1]**2+h3c[2]**2+h3c[0]**2))
  
      up_cart = numpy.ndarray(shape=(3,))
      up_cart[0] = numpy.dot(up_phi, t1c)
      up_cart[1] = numpy.dot(up_phi, t2c)
      up_cart[2] = numpy.dot(up_phi, t3c)
  
      us_cart = numpy.ndarray(shape=(3,))
      us_cart[0] = numpy.dot(us_phi, t1c)
      us_cart[1] = numpy.dot(us_phi, t2c)
      us_cart[2] = numpy.dot(us_phi, t3c)
  
      return up_cart, us_cart
function_tokens: def calculate_absorption_correction_2 ( exp_number , scan_number , spice_ub_matrix ) : # process angles from SPICE table theta2ave = get_average_spice_table ( exp_number , scan_number , '2theta' ) # sum(theta2(:))/length(theta2); chiave = get_average_spice_table ( exp_number , scan_number , 'chi' ) # sum(chi(:))/length(chi); phiave = get_average_spice_table ( exp_number , scan_number , 'phi' ) # sum(phi(:))/length(phi); avg_omega = get_average_omega ( exp_number , scan_number ) up_phi = calculate_upphi ( avg_omega , theta2ave , chiave , phiave ) us_phi = calculate_usphi ( avg_omega , theta2ave , chiave , phiave ) vec_q = numpy . array ( [ [ 1 , 0 , 0 ] , [ 0 , 1 , 0 ] , [ 0 , 0 , 1 ] ] ) matrix_q = numpy . dot ( spice_ub_matrix , vec_q ) h1c = matrix_q [ : , 0 ] h2c = matrix_q [ : , 1 ] h3c = matrix_q [ : , 2 ] t1c = h1c / ( math . sqrt ( h1c [ 1 ] ** 2 + h1c [ 2 ] ** 2 + h1c [ 0 ] ** 2 ) ) t2c = h2c / ( math . sqrt ( h2c [ 1 ] ** 2 + h2c [ 2 ] ** 2 + h2c [ 0 ] ** 2 ) ) t3c = h3c / ( math . sqrt ( h3c [ 1 ] ** 2 + h3c [ 2 ] ** 2 + h3c [ 0 ] ** 2 ) ) up_cart = numpy . ndarray ( shape = ( 3 , ) ) up_cart [ 0 ] = numpy . dot ( up_phi , t1c ) up_cart [ 1 ] = numpy . dot ( up_phi , t2c ) up_cart [ 2 ] = numpy . dot ( up_phi , t3c ) us_cart = numpy . ndarray ( shape = ( 3 , ) ) us_cart [ 0 ] = numpy . dot ( us_phi , t1c ) us_cart [ 1 ] = numpy . dot ( us_phi , t2c ) us_cart [ 2 ] = numpy . dot ( us_phi , t3c ) return up_cart , us_cart