IncoherentScat¶
Classes¶
-
class
IncoherentScat.IncoherentScat(dataset)¶ This class provides methods to convert trajectories into experimental-like Quasi-Elastic Neutron Scattering spectra (QENS) or Dynamic Structure Factors (DSF). Mean-Squared Displacements (MSD) can also be computed directly from trajectories.
Some plotting methods are also available to quicly check the results.
Parameters: dataset – a Datasetclass instance containing trajectories data.-
compDSF(qValList, nbrTimeOri=50, resFunc=None, selection='protNonExchH', alignCOM=True, frames=slice(0, None, 1), norm=True, nbrTS=200)¶ This method performs a multiplication of the inverse Fourier transform given resolution function with the computed intermediate function to get the instrumental signal.
Parameters: - qValList – list of q-values to be used
- nbrTimeOri – number of time origins to be averaged over
- resFunc – resolution function to be used (default a standard gaussian)
- selection – atom selection (usually ‘protNonExchH’ or ‘waterH’)
- alignCOM – whether center of mass should be aligned or not
- frames – either None to select all frames, an int, or a slice object
- norm – whether result should be normalized by first point or not
- nbrTS – number of time steps to be used (number of points ni the x-axis output)
- Result is stored in DSF attribute as the following tuple:
- dsf auto-correlation function as a
- (nbr of q-values, nbr of timesteps) shaped array.
- ts timesteps as calculated from selected frames
-
compIntermediateFunc(qValList, nbrTimeOri=50, selection='protNonExchH', alignCOM=True, frames=slice(0, None, 1), nbrTS=200)¶ This method computes intermediate function for all q-value (related to scattering angle)
Parameters: - qValList – list of q-values to be used
- nbrTimeOri – number of time origins to be averaged over
- selection – atom selection (usually ‘protNonExchH’ or ‘waterH’)
- alignCOM – whether center of mass should be aligned or not
- frames – either None to select all frames, an int, or a slice object
- nbrTS – number of time steps to be used (number of points ni the x-axis output)
- Result is stored in interFunc attribute as the following tuple:
- corr auto-correlation function as a
- (nbr of q-values, nbr of timesteps) shaped array.
- ts timesteps as calculated from selected frames
-
compMSD(nbrFrames=20, selection='protNonExchH', frames=slice(0, None, 1), alignCOM=True, nbrSubFrames=10)¶ Computes the Mean-Squared Displacement for the given number of frames, which should correspond to the max time scale probed by the instrument.
Parameters: - nbrFrames – number of frames to be used (time interval)
- selection – atom selection to be used to compute MSD
- frames – either None to select all frames, or a slice object
- alignCOM – whether center of mass should be aligned or not
- nbrSubFrames – number of sub-selection of frames to be averaged on. Basically, the selected frames are sliced to generate the given number of subsets. The MSD is computed for each subset, then the average and the standard deviation are computed.
Result is stored in MSD attribute
-
compScatteringFunc(qValList, nbrTimeOri=50, resFunc=None, selection='protNonExchH', alignCOM=True, frames=slice(0, None, 1), norm=True, nbrTS=200)¶ This method calls the
compDSF()method, performs a Fourier transform on the result and computes the power spectrum of it.Parameters: - qValList – list of q-values to be used
- nbrTimeOri – number of time origins to be averaged over
- selection – atom selection (usually ‘protNonExchH’ or ‘waterH’)
- alignCOM – whether center of mass should be aligned or not
- frames – either None to select all frames, an int, or a slice object
- nbrTS – number of time steps to be used (number of points ni the x-axis output)
- Result is stored in scatFunc attribute as the following tuple:
- scatFunc spectra as a
- (nbr of q-values, nbr of timesteps) shaped array.
- energies energies in ueV obtained from timesteps
-
convertScatFunctoEISF()¶ First finds the index corresponding to the 0 energy transfer on x axis in scatFunc attribute. Then returns an array containing the intensity for each q-value.
-
plotDSF()¶ Plots the DSF for each q-value.
-
plotIntermediateFunc()¶ Plots the intermediate scattering function for each q-value.
-
plotScatteringFunc()¶ Plots the MSD for each q-value.
-