cmd_args = parser.parse_args() movieid = "{}-t{:04}-th{}-ph{}-n{}".format(cmd_args.mode, cmd_args.time, cmd_args.orient[0], cmd_args.orient[1], cmd_args.frames) movie = Movie( runid=cmd_args.runid, movieid=movieid, time=cmd_args.time, nframes=cmd_args.frames, verbose=1, force=0, ) movie.imageprefix = "rgb-{}-{}-{}".format(cmd_args.emshort, movie.runid, movie.movieid) movie.emtypes = cmd_args.emtypes movie.brightmax = cmd_args.brightscale movie.bandscales = cmd_args.bandscales movie.vcodec = cmd_args.vcodec movie.containerformat = cmd_args.containerformat movie.encoder = cmd_args.encoder movie.boxsize = 4.0 movie.camera.set_angles(*cmd_args.orient) def bmaxNHO(i): """ Smoothly varying brightness with time so that the movie looks good """ return cmd_args.brightscale/(1.0+(float(i)/10)**2) def bmaxCPF(i): """ Smoothly varying brightness with time so that the movie looks good
return brightmax0/(1.0+(float(i)/100)) # Parse command line arguments execname = os.path.split(sys.argv[0])[-1] try: runid = sys.argv[1] it1 = int(sys.argv[2]) it2 = int(sys.argv[3]) except IndexError, ValueError: print "Usage: %s RUNID ITIME1 ITIME2" % execname exit if runid.find('krumx') >= 0: Movie.boxsize = 40.0 brightmax0 = 5.e2 else: Movie.boxsize = 20.0 brightmax0 = 4.e3 for itime in range(it1, it2+1): # Abuse the movie class to make one frame at a time movie = Movie(runid=runid, movieid="evo", time=itime, frame=itime, nframes=1, verbose=1, force=1) movie.brightmax = brightmax(itime) movie.camera.set_steps(0.0, 0.0) # don't move the camera! movie.bandscales = [0.4, 1.0, 0.05] movie.makeimages()