if not options.outfile.endswith(".dat"):
    print "Outfile doesn't end with .dat: %s" % (options.outfile)
    sys.exit(1)