parameters: (psf)
return_statement: return title, pointers, data
docstring: This method parses a section of the PSF file
  
          Parameters
          ----------
           psf : CharmmFile
               Open file that is pointing to the first line of the section
               that is to be parsed
  
          Returns
          --------
          str
              The label of the PSF section we are parsing
          int/tuple of ints
              If one pointer is set, pointers is simply the integer that is
              value of that pointer. Otherwise it is a tuple with every pointer
              value defined in the first line
          list
              A list of all data in the parsed section converted to `dtype'
docstring_summary: This method parses a section of the PSF file
docstring_tokens: This method parses a section of the PSF file
function: def _parse_psf_section(psf):
          """This method parses a section of the PSF file
  
          Parameters
          ----------
           psf : CharmmFile
               Open file that is pointing to the first line of the section
               that is to be parsed
  
          Returns
          --------
          str
              The label of the PSF section we are parsing
          int/tuple of ints
              If one pointer is set, pointers is simply the integer that is
              value of that pointer. Otherwise it is a tuple with every pointer
              value defined in the first line
          list
              A list of all data in the parsed section converted to `dtype'
          """
          conv = CharmmPsfFile._convert
          line = psf.readline()
          while not line.strip():
              if not line:
                  raise CharmmPsfEOF('Unexpected EOF in PSF file')
              else:
                  line = psf.readline()
          if '!' in line:
              words = line[:line.index('!')].split()
              title = line[line.index('!')+1:].strip().upper()
              # Strip out description
              if ':' in title:
                  title = title[:title.index(':')]
          else:
              raise CharmmPSFError('Could not determine section title')
          if len(words) == 1:
              pointers = conv(words[0], int, 'pointer')
          else:
              pointers = tuple([conv(w, int, 'pointer') for w in words])
          line = psf.readline().strip()
          if title == 'NATOM': line = line.upper()
          if not line and title.startswith('NNB'):
              # This will correctly handle the NNB section (which has a spurious
              # blank line) as well as any sections that have 0 members.
              line = psf.readline().strip()
          data = []
          if title == 'NATOM' or title == 'NTITLE' or title == 'NUMLP NUMLPH' or title == 'NUMANISO':
              # Store these four sections as strings (ATOM section we will parse
              # later). The rest of the sections are integer pointers
              while line:
                  data.append(line)
                  line = psf.readline().strip()
                  if title == 'NATOM': line = line.upper()
          else:
              while line:
                  words = line.split()
                  data.extend([conv(w, int, 'PSF data') for w in words])
                  line = psf.readline().strip()
          return title, pointers, data
function_tokens: def _parse_psf_section ( psf ) : conv = CharmmPsfFile . _convert line = psf . readline ( ) while not line . strip ( ) : if not line : raise CharmmPsfEOF ( 'Unexpected EOF in PSF file' ) else : line = psf . readline ( ) if '!' in line : words = line [ : line . index ( '!' ) ] . split ( ) title = line [ line . index ( '!' ) + 1 : ] . strip ( ) . upper ( ) # Strip out description if ':' in title : title = title [ : title . index ( ':' ) ] else : raise CharmmPSFError ( 'Could not determine section title' ) if len ( words ) == 1 : pointers = conv ( words [ 0 ] , int , 'pointer' ) else : pointers = tuple ( [ conv ( w , int , 'pointer' ) for w in words ] ) line = psf . readline ( ) . strip ( ) if title == 'NATOM' : line = line . upper ( ) if not line and title . startswith ( 'NNB' ) : # This will correctly handle the NNB section (which has a spurious # blank line) as well as any sections that have 0 members. line = psf . readline ( ) . strip ( ) data = [ ] if title == 'NATOM' or title == 'NTITLE' or title == 'NUMLP NUMLPH' or title == 'NUMANISO' : # Store these four sections as strings (ATOM section we will parse # later). The rest of the sections are integer pointers while line : data . append ( line ) line = psf . readline ( ) . strip ( ) if title == 'NATOM' : line = line . upper ( ) else : while line : words = line . split ( ) data . extend ( [ conv ( w , int , 'PSF data' ) for w in words ] ) line = psf . readline ( ) . strip ( ) return title , pointers , data