abinslib.util ============= .. py:module:: abinslib.util .. autoapi-nested-parse:: Utility functions, not specific to one calculation type. Functions --------- .. autoapisummary:: abinslib.util.calculate_indirect_q2 Module Contents --------------- .. py:function:: calculate_indirect_q2(energy_transfer: euphonic.Quantity, angle: float, final_energy: euphonic.Quantity) -> euphonic.Quantity Calculate Q^2 value for given energy transfer in indirect geometry. By the cosine law Q^2 = k_f^2 + k_i^2 - 2 k_f k_i cos(theta) :param energy_transfer: neutron energy change. (Positive values correspond to transfer to sample.) :param angle: scattering angle in radians :param final_energy: energy of detected neutrons (i.e. after monochromator) :returns: array of scalar Q^2 corresponding to input energy_transfer