Commit 0bb0410e authored by eric pellegrini's avatar eric pellegrini Committed by Remi Perenon

Implemented the dynamic total structure factor

parent 3c7e2cc1
......@@ -138,9 +138,10 @@ class DynamicCoherentStructureFactor(IJob):
#. x (any): The returned result(s) of run_step
"""
for pair in self._elementsPairs:
corr = correlation(x[pair[0]],x[pair[1]], average=1)
self._outputData["f(q,t)_%s%s" % pair][index,:] += corr
if x is not None:
for pair in self._elementsPairs:
corr = correlation(x[pair[0]],x[pair[1]], average=1)
self._outputData["f(q,t)_%s%s" % pair][index,:] += corr
def finalize(self):
"""
......
......@@ -132,9 +132,10 @@ class DynamicIncoherentStructureFactor(IJob):
#. index (int): The index of the step.\n
#. x (any): The returned result(s) of run_step
"""
for k,v in x.items():
self._outputData["f(q,t)_%s" % k][index,:] += v
if x is not None:
for k,v in x.items():
self._outputData["f(q,t)_%s" % k][index,:] += v
def finalize(self):
"""
......
This diff is collapsed.
#!/usr/bin/python
########################################################
# This is an automatically generated MDANSE run script #
########################################################
from MDANSE import REGISTRY
################################################################
# Job parameters #
################################################################
parameters = {}
parameters['atom_selection'] = 'all'
parameters['atom_transmutation'] = None
parameters['frames'] = (0, 10, 1)
parameters['instrument_resolution'] = ('gaussian', {'mu': 0.0, 'sigma': 10.0})
parameters['output_files'] = ('output', ['netcdf'])
parameters['q_vectors'] = ('spherical_lattice', {'width': 0.1, 'n_vectors': 50, 'shells': (0.1, 5, 0.1)})
parameters['running_mode'] = ('monoprocessor', 1)
parameters['trajectory'] = '/home/pellegrini/git/mdanse/Data/Trajectories/MMTK/waterbox_in_periodic_universe.nc'
parameters['weights'] = 'b_coherent'
################################################################
# Setup and run the analysis #
################################################################
dtsf = REGISTRY['job']['dtsf']()
dtsf.run(parameters,status=True)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment