Commit a3ab5dcd authored by eric pellegrini's avatar eric pellegrini
Browse files

Updated the analysis related to the introduction of AtomsList

configurator
parent 0c817605
......@@ -72,8 +72,9 @@ class AngularCorrelation(IJob):
settings = collections.OrderedDict()
settings['trajectory'] = ('mmtk_trajectory',{})
settings['frames'] = ('frames', {"dependencies":{'trajectory':'trajectory'}})
settings['axis_selection'] = ('axis_selection',{"dependencies":{'trajectory':'trajectory'},
'default' : {'molecule':'Water', 'endpoint1':('OW',), 'endpoint2':('HW',)}})
settings['axis_selection'] = ('atoms_list',{"nAtoms" : 2,
"dependencies":{'trajectory':'trajectory'},
'default' : ('Water',('OW','HW'))})
settings['per_axis'] = ('boolean', {"label":"output contribution per axis", "default":False})
settings['output_files'] = ('output_files', {"formats":["netcdf","ascii"]})
settings['running_mode'] = ('running_mode',{})
......@@ -83,16 +84,16 @@ class AngularCorrelation(IJob):
Initialize the input parameters and analysis self variables
"""
self.numberOfSteps = self.configuration['axis_selection']['n_axis']
self.numberOfSteps = self.configuration['axis_selection']['n_values']
self._outputData.add("times","line", self.configuration['frames']['time'],units='ps')
self._outputData.add("axis_index","line", numpy.arange(self.configuration['axis_selection']['n_axis']), units='au')
self._outputData.add("axis_index","line", numpy.arange(self.configuration['axis_selection']['n_values']), units='au')
self._outputData.add('ac',"line", (self.configuration['frames']['number'],), axis="times", units="au")
if self.configuration['per_axis']['value']:
self._outputData.add('ac_per_axis',"surface", (self.configuration['axis_selection']['n_axis'],self.configuration['frames']['number'],), axis='axis_index|times', units="au")
self._outputData.add('ac_per_axis',"surface", (self.configuration['axis_selection']['n_values'],self.configuration['frames']['number'],), axis='axis_index|times', units="au")
def run_step(self, index):
"""
......@@ -105,7 +106,7 @@ class AngularCorrelation(IJob):
#. vectors (numpy.array): The calculated vectors
"""
e1, e2 = self.configuration['axis_selection']['endpoints'][index]
e1, e2 = self.configuration['axis_selection']['atoms'][index]
e1 = read_atoms_trajectory(self.configuration["trajectory"]["instance"],
e1,
......@@ -147,7 +148,7 @@ class AngularCorrelation(IJob):
Finalizes the calculations (e.g. averaging the total term, output files creations ...).
"""
self._outputData['ac'] /= self.configuration['axis_selection']['n_axis']
self._outputData['ac'] /= self.configuration['axis_selection']['n_values']
self._outputData.write(self.configuration['output_files']['root'], self.configuration['output_files']['formats'], self._info)
......
......@@ -82,8 +82,9 @@ class OrderParameter(IJob):
settings = collections.OrderedDict()
settings['trajectory'] = ('mmtk_trajectory', {'default':os.path.join('..','..','..','Data','Trajectories', 'MMTK', 'protein_in_periodic_universe.nc')})
settings['frames'] = ('frames', {'dependencies':{'trajectory':'trajectory'}})
settings['axis_selection'] = ('axis_selection', {'dependencies':{'trajectory':'trajectory'},
'default':{'molecule':'C284H438N84O79S7', 'endpoint1':('C',), 'endpoint2':('C_beta',)}})
settings['axis_selection'] = ('atoms_list', {'dependencies':{'trajectory':'trajectory'},
'nAtoms':2,
'default':('C284H438N84O79S7',('C','C_beta'))})
settings['reference_direction'] = ('vector', {'default':[0,0,1], 'notNull':True, 'normalize':True})
settings['per_axis'] = ('boolean', {'label':"output contribution per axis", 'default':False})
settings['output_files'] = ('output_files', {'formats':["netcdf","ascii"]})
......@@ -95,13 +96,13 @@ class OrderParameter(IJob):
"""
self._nFrames = self.configuration['frames']['number']
self._nAxis = self.configuration['axis_selection']['n_axis']
self._nAxis = self.configuration['axis_selection']['n_values']
self.numberOfSteps = self._nAxis
self._outputData.add("times","line", self.configuration['frames']['time'], units='ps')
self._outputData.add("axis_index","line", numpy.arange(self.configuration['axis_selection']['n_axis']), units='au')
self._outputData.add("axis_index","line", numpy.arange(self.configuration['axis_selection']['n_values']), units='au')
self._zAxis = Vector([0,0,1])
refAxis = self.configuration['reference_direction']['value']
......@@ -134,7 +135,7 @@ class OrderParameter(IJob):
:rtype: 2-tuple
"""
e1, e2 = self.configuration['axis_selection']['endpoints'][index]
e1, e2 = self.configuration['axis_selection']['atoms'][index]
e1 = read_atoms_trajectory(self.configuration["trajectory"]["instance"],
e1,
......
......@@ -67,7 +67,8 @@ class SpatialDensity(IJob):
settings['frames'] = ('frames', {'dependencies':{'trajectory':'trajectory'}})
settings['spatial_resolution'] = ('float', {'mini':0.01, 'default':0.1})
settings['reference_basis'] = ('basis_selection', {'dependencies':{'trajectory':'trajectory'},
'default':{'molecule':'C284H438N84O79S7','origin':('O',),'x_axis':('C_beta',),'y_axis':('C_delta',)}})
'nAtoms':3,
'default':('C284H438N84O79S7',('O','C_beta','C_delta'))})
settings['target_molecule'] = ('atom_selection', {'dependencies':{'trajectory':'trajectory'},
'default':'atom_index 151'})
settings['output_files'] = ('output_files', {'formats':["netcdf","ascii"]})
......@@ -139,12 +140,12 @@ class SpatialDensity(IJob):
conf = self.configuration['trajectory']['instance'].universe.contiguousObjectConfiguration()
origins = numpy.zeros((self.configuration['reference_basis']['n_basis'],3), dtype = numpy.float64)
bases = numpy.zeros((self.configuration['reference_basis']['n_basis'],3,3), dtype = numpy.float64)
origins = numpy.zeros((self.configuration['reference_basis']['n_values'],3), dtype = numpy.float64)
bases = numpy.zeros((self.configuration['reference_basis']['n_values'],3,3), dtype = numpy.float64)
indexes = numpy.array(self.configuration['target_molecule']['indexes']).astype(numpy.int32)
for i, basis in enumerate(self.configuration['reference_basis']['basis']):
for i, basis in enumerate(self.configuration['reference_basis']['atoms']):
originIndexes, xIndexes, yIndexes = basis
origins[i,:] = center_of_mass(conf.array[originIndexes], None)
......
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