import optparse
import sys

USAGE = '''USAGE:

horizons.py [options] input_file

Given an orbit file in DES format and a list of times in MJD format, connect to 
the HORIZONS telnet server and retrieve the ephemerides for each of the objects 
in the input file covering the times provided.

Print out the values on a per object basis.
'''

def main(args=sys.argv[1:]):
    """
    
    """
    
    parser = optparse.OptionParser(USAGE)
    parser.add_option('--start',
                      action='store',
                      dest='start_mjd',
                      type='float',
                      #default=AGE,
                      help="The start date for ephemerides generation.\n")
    parser.add_option('--end',
                      action='store',
                      dest='end_mjd',
                      type='float',
                      #default=False,
                      help="The end date for ephemerides generation.\n")
    parser.add_option('--delta',
                      action='store',
                      dest='delta',
                      type='float',
                      default=1,
                      help="The time seperating each generated ephemerides.\n")
    # Verbose flag
    parser.add_option('-v',
                      action='store_true',
                      dest='verbose',
                      default=False,
                      help="Prints extra information to log file.\n")                    
    
    # Get the command line options and also whatever is passed on STDIN.
    (options, args) = parser.parse_args()
    
    print args
# <-- end def

    # Verify that an input file was specified
    if (len(args) < 1):
        parser.error('An input file was not specified.')
    # <-- end if
if __name__ == '__main__':
    sys.exit(main())
# <-- end if