#!/usr/bin/env python
from optparse import OptionParser
import os
#import string

from ASE.Visualization.VMD import VMD
from Dacapo import Dacapo

parser = OptionParser(usage='%prog [-r R1 R2 R3] trajectory\n\nIf "trajectory" is a unix file pattern including one or more wildcards "*" it *must* be inclosed in "".', version='%prog 0.1')
parser.add_option('-r', '--repeat', type='int', nargs=3,
                  help='Repeat R1, R2, R3 times along the three axes',
                  metavar='R1 R2 R3')

options, args = parser.parse_args()

if len(args) != 1:
    parser.print_help()
    raise SystemExit

pattern=args[-1] 

if options.repeat == None:
    rep =  [1,1,1]
else:
    rep = list(options.repeat)

atoms = Dacapo.ReadAtoms(args[-1])
VMD(atoms.Repeat(rep))
