parameters: (self, Basename)
docstring: Read the Amber coordinate/restart (.crd) file
docstring_summary: Read the Amber coordinate/restart (.crd) file
docstring_tokens: Read the Amber coordinate / restart ( . crd ) file
function: def Read_CRD(self, Basename):
          'Read the Amber coordinate/restart (.crd) file'
  
          # The optional velocities and periodic box size are not yet parsed.
  
          Item_list = self.Read_data(Basename + '.crd')
  
          if Item_list == None:
              return
          elif len(Item_list) < 2:
              print '(error: File too short!)'
              return
  
          # Parse the data
          if self.__dict__.has_key('ITITL'):
              if Pop(Item_list,0) != self.ITITL:
  	        print '(warning: ITITL differs!)',
          else:
              self.ITITL = Pop(Item_list,0)
          print self.ITITL #Vikas Modification : Priting the Title
  
          if self.__dict__.has_key('NATOM'):
              if eval(Pop(Item_list,0)) != self.NATOM:
  		print '(error: NATOM differs!)'
                  return
          else:
              self.NATOM = eval(Pop(Item_list,0))
  	print self.NATOM # Vikas' Modification: Printing number of atoms just to make sure that the program is reading the correct value. 
  
          #if len(Item_list) == 1 + 3 * self.NATOM:
          # Vikas' Modification: I changed the condition.
  	if (len(Item_list)%3) != 0:
  	    self.TIME = eval(Pop(Item_list,0))
          else:
              self.TIME = 0
  	print self.TIME # Vikas' Modification : Printing simulation time, just to make sure that the program is readint the correct value.
          if len(Item_list) < 3 * self.NATOM:
              print '(error: File too short!)'
              return
  
          self.X = []
          self.Y = []
          self.Z = []
          for i in range(self.NATOM):
              self.X.append(eval(Pop(Item_list,0)))
              self.Y.append(eval(Pop(Item_list,0)))
              self.Z.append(eval(Pop(Item_list,0)))
  
          if (self.NATOM == 1) and len(Item_list):
              print '(warning: Ambiguity!)',
  
          if len(Item_list) >= 3 * self.NATOM:
                  self.VX = []
                  self.VY = []
                  self.VZ = []
                  for i in range(self.NATOM):
                      self.VX.append(eval(Pop(Item_list,0)))
                      self.VY.append(eval(Pop(Item_list,0)))
                      self.VZ.append(eval(Pop(Item_list,0)))
  
          if len(Item_list) >= 3:
              self.BOX = []
              for i in range(3):
                  self.BOX.append(eval(Pop(Item_list,0)))
  
          if len(Item_list):
              print '(warning: File too large!)',
          
          print 'done.'
          self.CRD_is_read = 1
function_tokens: def Read_CRD ( self , Basename ) : # The optional velocities and periodic box size are not yet parsed. Item_list = self . Read_data ( Basename + '.crd' ) if Item_list == None : return elif len ( Item_list ) < 2 : print '(error: File too short!)' return # Parse the data if self . __dict__ . has_key ( 'ITITL' ) : if Pop ( Item_list , 0 ) != self . ITITL : print '(warning: ITITL differs!)' , else : self . ITITL = Pop ( Item_list , 0 ) print self . ITITL #Vikas Modification : Priting the Title if self . __dict__ . has_key ( 'NATOM' ) : if eval ( Pop ( Item_list , 0 ) ) != self . NATOM : print '(error: NATOM differs!)' return else : self . NATOM = eval ( Pop ( Item_list , 0 ) ) print self . NATOM # Vikas' Modification: Printing number of atoms just to make sure that the program is reading the correct value.  #if len(Item_list) == 1 + 3 * self.NATOM: # Vikas' Modification: I changed the condition. if ( len ( Item_list ) % 3 ) != 0 : self . TIME = eval ( Pop ( Item_list , 0 ) ) else : self . TIME = 0 print self . TIME # Vikas' Modification : Printing simulation time, just to make sure that the program is readint the correct value. if len ( Item_list ) < 3 * self . NATOM : print '(error: File too short!)' return self . X = [ ] self . Y = [ ] self . Z = [ ] for i in range ( self . NATOM ) : self . X . append ( eval ( Pop ( Item_list , 0 ) ) ) self . Y . append ( eval ( Pop ( Item_list , 0 ) ) ) self . Z . append ( eval ( Pop ( Item_list , 0 ) ) ) if ( self . NATOM == 1 ) and len ( Item_list ) : print '(warning: Ambiguity!)' , if len ( Item_list ) >= 3 * self . NATOM : self . VX = [ ] self . VY = [ ] self . VZ = [ ] for i in range ( self . NATOM ) : self . VX . append ( eval ( Pop ( Item_list , 0 ) ) ) self . VY . append ( eval ( Pop ( Item_list , 0 ) ) ) self . VZ . append ( eval ( Pop ( Item_list , 0 ) ) ) if len ( Item_list ) >= 3 : self . BOX = [ ] for i in range ( 3 ) : self . BOX . append ( eval ( Pop ( Item_list , 0 ) ) ) if len ( Item_list ) : print '(warning: File too large!)' , print 'done.' self . CRD_is_read = 1