old_contents: ###############################################################################
  # -*- coding: utf-8 -*-
  # Order: A tool to characterize the local structure of liquid water 
  #        by geometric order parameters
  # 
  # Authors: Pu Du
  # 
  # Released under the MIT License
  ###############################################################################
  
  
  """mean square displacement
  ==============================================================
  """
  
  from __future__ import print_function, division
  import os
  import six
  from six.moves import range
  
  import numpy as np
  from progress.bar import ChargingBar
  from . import oto
  
  class meanSquareD(oto.Orientational):
      """mean square displacement"""
      def __init__(self, filename, center, bins=100):
          super(Translational, self).__init__(filename, center, bins)
      
      def mean_square_displacement(self, max_t = 1000, freq = 1):
          """compute mean square displacement"""
          #progress bar
          frames = int(self.traj.n_frames / freq)
          bar = ChargingBar('Processing', max=frames, 
          suffix='%(percent).1f%% - %(eta)ds')
  
          for t in range(max_t):
              ct = 0.0
              mid = 0.0
              for i in range(0, self.traj.n_frames, freq):
                  if i + t < self.traj.n_frames:
                      for j in range(self.traj.n_atoms):
                          mid += np.square(np.substract(self.traj.coords[i][j],
                                                        self.traj.coords[i+t][j]))
                          ct = np.sum(mid)
              ct = ct * 1.0 / (self.traj.n_atoms * (self.traj.n_frames - t))
              self.raw.append(ct)
  
              bar.next()
          bar.finish()
  
     def out_put(self, taskname='MSD'):
          """output raw data of msd"""
          raw_data = self.fprefix + '_' + taskname + '_raw.dat'
          with open(raw_data, 'w') as f:
              f.write('#' + taskname + ' generated by Order: A Python Tool\n')
              f.write('#raw data\n')
  
              for k,i in enumerate(self.raw):
                  f.write('{}\t{}\n'.format(k, i))
  
new_contents: ###############################################################################
  # -*- coding: utf-8 -*-
  # Order: A tool to characterize the local structure of liquid water 
  #        by geometric order parameters
  # 
  # Authors: Pu Du
  # 
  # Released under the MIT License
  ###############################################################################
  
  
  """mean square displacement
  ==============================================================
  """
  
  from __future__ import print_function, division
  import os
  import six
  from six.moves import range
  
  import numpy as np
  from progress.bar import ChargingBar
  from . import oto
  
  class meanSquareD(oto.Orientational):
      """mean square displacement"""
      def __init__(self, filename, center, bins=100):
          super(Translational, self).__init__(filename, center, bins)
      
      def mean_square_displacement(self, max_t = 1000, freq = 1):
          """compute mean square displacement"""
          #progress bar
          frames = int(self.traj.n_frames / freq)
          bar = ChargingBar('Processing', max=frames, 
          suffix='%(percent).1f%% - %(eta)ds')
  
          for t in range(max_t):
              ct = 0.0
              mid = 0.0
              for i in range(0, self.traj.n_frames, freq):
                  if i + t < self.traj.n_frames:
                      for j in range(self.traj.n_atoms):
                          mid += np.square(np.substract(self.traj.coords[i][j],
                                                        self.traj.coords[i+t][j]))
                          ct = np.sum(mid)
              ct = ct * 1.0 / (self.traj.n_atoms * (self.traj.n_frames - t))
              self.raw.append(ct)
  
              bar.next()
          bar.finish()
  
      def out_put(self, taskname='MSD'):
          """output raw data of msd"""
          raw_data = self.fprefix + '_' + taskname + '_raw.dat'
          with open(raw_data, 'w') as f:
              f.write('#' + taskname + ' generated by Order: A Python Tool\n')
              f.write('#raw data\n')
  
              for k,i in enumerate(self.raw):
                  f.write('{}\t{}\n'.format(k, i))
  
subject: fix indentation