from orbit_sim import Orbit_sim
from sys import exit, argv

def main():
    """Main program: Simulates an orbit, writes it into an orbit structure"""

    if len(argv) != 2:
      exit("Give input filename.")

    # Strip off the 
    name = argv[1]
    if "." in name:
      idx = name.index('.')
      name = name[:idx]
    orbit = Orbit_sim(name)
    orbit.read_file(argv[1])
    orbit.write_output(name+"_orbit.nc")

main()

