###############################################################################
# -*- 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
###############################################################################

import argparse
#from order import XYZ, oto, tto, lsi, plot, util

def get_parser():
    parser = argparse.ArgumentParser(description='Order: A tool to characterize the \
                                                  local structure of liquid water \
                                                  by geometric order parameters')
    parser.add_argument('input', type=str, nargs='?',help='XYZ trajectory of system')
    parser.add_argument('-t','--task', default='oto', type=str,
                        help=' type of task: oto,tto,lsi (default: oto)')
    parser.add_argument('-c','--center', default='O', type=str,
                        help=' type of center atom  (default: O)')
    parser.add_argument('-b','--bins', default=100, type=int,
                        help=' number of bins for the parameter (default: 100)')
    parser.add_argument('-p','--plot', default='on', type=str,
                        help='turn on / off of plotting (default: on)')
    return parser

def command_line_runner():
    parser = get_parser()
    args = vars(parser.parse_args())
    if not args['input']:
        parser.print_help()
        return
    if args['task']:
        util.output_welcome()
        
        reader = XYZLoader(args['input'])
        
        util.output_system_info(reader.filename, reader.n_atoms, reader.n_frames)

        if 'oto' in args['task']:
            tasker = (reader, args['center'], args['bins'])
            tasker.orientational_param()
            tasker.out_put()

    if args['plot'] is 'on':
        pass
    
    #util.output_end()
if __name__ == '__main__':
    command_line_runner()
@@ -346,35 +346,80 @@
 ##%0A%0A
-import argparse%0A#from order
+from __future__ import print_function%0Aimport argparse%0Aimport time%0Afrom .
  imp
@@ -1218,24 +1218,198 @@
 ult: 100)')%0A
+    parser.add_argument('-f','--frequency', default=1, type=int,%0A                        help=' compute the parameter every n frame(s) (default: 1)')                        %0A
     parser.a
@@ -1722,32 +1722,63 @@
 f args%5B'task'%5D:%0A
+        t_start = time.clock()%0A
         util.out
@@ -1817,16 +1817,20 @@
 eader = 
+XYZ.
 XYZLoade
@@ -1988,124 +1988,531 @@
     
-tasker = (reader, args%5B'center'%5D, args%5B'bins'%5D)%0A            tasker.orientational_param()%0A            tasker.out_put(
+util.output_task('oto', args%5B'frequency'%5D, args%5B'bins'%5D, args%5B'center'%5D)%0A            tasker = oto.Orientational(reader, args%5B'center'%5D, args%5B'bins'%5D)%0A            tasker.orientational_param()%0A            tasker.out_put(tasker.Q)%0A        %0A        if 'tto' in args%5B'task'%5D:%0A            util.output_task('tto', args%5B'frequency'%5D, args%5B'bins'%5D, args%5B'center'%5D)%0A            tasker = tto.Translational(reader, args%5B'center'%5D, args%5B'bins'%5D)%0A            tasker.translational_param()%0A            tasker.out_put(tasker.sk, 'TTO', 'Sk'
 )%0A%0A 
@@ -2556,18 +2556,38 @@
 ass%0A
+%0A
     
+t_end = time.clock()
 %0A    
-#
 util
@@ -2598,16 +2598,30 @@
 put_end(
+t_start, t_end
 )%0Aif __n

add time function