示例#1
0
    "--containerformat", type=str, choices=("avi", "mp4"), default="mp4",
    help="Video container format to use")

parser.add_argument(
    "--encoder", type=str, choices=("mencoder", "ffmpeg"), default="ffmpeg",
    help="Video encoding program to use")

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): 
    """
示例#2
0
# Optional brightness arguments
# set defaults
brightmax0 = 1.e7
bandscales = [0.2, 1.0e-6, 1.0e-9]
try: 
    # 7th arg is scalar: use to set brightmax0
    brightmax0 = float(sys.argv[7])
except IndexError:
    pass
except ValueError:
    try:
        # 7th arg is triplet: use to set bandscales
        bandscales = [float(x) for x in sys.argv[7].split()]
    except ValueError:
        # otherwise, just use defaults
        pass

Movie.emtypes = ["neut00", "PAH000", "FF06cm"]
Movie.bandscales = bandscales
movieid = "evo%+3.3i%+3.3i" % (th0, ph0)
movie = Movie(runid=runid, movieid=movieid, 
	      time=it1, dtime=idelta, frame=it1/idelta, 
              nframes=1+(it2-it1)/idelta, verbose=1, force=0)
movie.imageprefix = "rgb-CPF-%s-%s" % (runid, movieid)
movie.brightmaxfunc = brightmax
movie.camera.set_steps(0.0, 0.0)
movie.camera.set_angles(th0, ph0)

movie.makemovie()
from movierot import Movie

def brightmax(i): 
    """
    Smoothly varying brightness with time so that the movie looks good
    """
    return brightmax0*(1.0+(float(i)/30)**2)/(1.0+(float(i)/50)**3)

brightmax0 = 1.e6
itime = 1000

n = 9
dth = 360.0/n

movie = Movie(runid="t50m32-weak-dm0", movieid="tumble%4.4i" % itime, 
	      time=itime, nframes=n, verbose=1, force=1) # only recreate images, not maps
movie.brightmax = brightmax(itime)
movie.camera.set_steps(dth, dth)
movie.makemovie()


movie = Movie(runid="t50m32-weak-zerob-e01", movieid="tumble%4.4i" % itime, 
	      time=itime, nframes=n, verbose=1, force=1) # only recreate images, not maps
movie.brightmax = brightmax(itime)
movie.camera.set_angles(360.0, 360.0)
movie.camera.set_steps(dth, dth)
movie.makemovie()
示例#4
0
from movierot import Movie

def brightmax(i): 
    """
    Smoothly varying brightness with time so that the movie looks good
    """
    return 2.6e7*(1.0+(float(i)/30)**2)/(1.0+(float(i)/50)**3)

it1, it2 = 100, 105
Movie.boxsize = 4.0
for itime in range(it1, it2+1):
    # Abuse the movie class to make one frame at a time
    movie = Movie(runid="t50m32e01", movieid="evo-test", 
		  time=itime, frame=itime, nframes=1, 
		  verbose=1, force=0)
    movie.makeimages()

movie = Movie(runid="t50m32e01", movieid="evo-test", 
	      time=it1, frame=it1, nframes=it2-it1+1, 
	      verbose=1, force=0) 
movie.makemovie()
示例#5
0
    ph0 = float(sys.argv[6])
except (IndexError, ValueError):
    th0, ph0 = 0.0, 0.0

# Optional brightness arguments
# set defaults
brightmax0 = 2.e8
bandscales = Movie.bandscales
try: 
    # 7th arg is scalar: use to set brightmax0
    brightmax0 = float(sys.argv[7])
except IndexError:
    pass
except ValueError:
    try:
        # 7th arg is triplet: use to set bandscales
        bandscales = [float(x) for x in sys.argv[7].split()]
    except ValueError:
        # otherwise, just use defaults
        pass

Movie.bandscales = bandscales
movie = Movie(runid=runid, movieid="evo%+3.3i%+3.3i" % (th0, ph0), 
	      time=it1, dtime=idelta, frame=it1/idelta, 
              nframes=(it2-it1)/idelta + 1, verbose=1, force=0)
movie.brightmaxfunc = brightmax
movie.camera.set_steps(0.0, 0.0)
movie.camera.set_angles(th0, ph0)
movie.boxsize = 4.0
movie.makemovie()
示例#6
0
    Smoothly varying brightness with time so that the movie looks good
    """
    return brightmax0*(1.0+(float(i)/30)**2)/(1.0+(float(i)/50)**3)


# 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

Movie.boxsize = 4.0
if runid.find('weak') >= 0:
    brightmax0 = 5.e5
else:
    brightmax0 = 1.7e7

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.makeimages()

示例#7
0
    ph0 = float(sys.argv[4])
except (IndexError, ValueError):
    th0, ph0 = 0.0, 0.0

# Optional brightness arguments
# set defaults
brightmax0 = 2.e8
bandscales = Movie.bandscales
try: 
    # 5th arg is scalar: use to set brightmax0
    brightmax0 = float(sys.argv[5])
except IndexError:
    pass
except ValueError:
    try:
        # 5th arg is triplet: use to set bandscales
        bandscales = [float(x) for x in sys.argv[5].split()]
    except ValueError:
        # otherwise, just use defaults
        pass

Movie.bandscales = bandscales
movieid="tumble-%4.4i" % itime
movie = Movie(runid=runid, movieid=movieid, 
	      time=itime, nframes=72, verbose=1, force=0)
movie.imageprefix = "rgb-NHO-%s-%s" % (runid, movieid)
movie.brightmaxfunc = brightmax
movie.boxsize = 4.0
movie.camera.set_steps(5.0, 5.0)
movie.makemovie()
from movierot import Movie

movie = Movie(runid="s80-127", movieid="tumble0060", 
	      time=60, nframes=72, verbose=1, force=0)
movie.brightmax = 1.5e8
movie.camera.set_steps(5.0, 5.0)
movie.makemovie()
示例#9
0
    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()

示例#10
0
    """
    return brightmax0/(1.0+(float(i)/50)**2)

brightmax0 = 2.e8

# 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 [THETA PHI]" % execname
    exit

# Optional orientation arguments
try: 
    th0 = float(sys.argv[4])
    ph0 = float(sys.argv[5])
except IndexError, ValueError:
    th0, ph0 = 0.0, 0.0

movie = Movie(runid=runid, movieid="evo%+3.3i%+3.3i" % (th0, ph0), 
	      time=it1, frame=it1, nframes=it2-it1+1, verbose=1, force=0)
movie.brightmaxfunc = brightmax
movie.camera.set_steps(0.0, 0.0)
movie.camera.set_angles(th0, ph0)
movie.dtime = 1

movie.makemovie()
import sys, os


def brightmax(i):
    """
    Smoothly varying brightness with time so that the movie looks good

    Changed 21 Jan 2008 - normalized to give 1.e7 @ 234,000 yrs
    for consistency with the tumble video

    TODO 21 Jan 2008 - Needs to be changed for the weak star 
    """
    return 1.7e7 * (1.0 + (float(i) / 30) ** 2) / (1.0 + (float(i) / 50) ** 3)


# 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

Movie.boxsize = 4.0
movie = Movie(
    runid=runid, movieid="evo", time=it2, frame=1, nframes=it2 - it1 + 1, verbose=1, force=-1
)  # force=-1 means don't make anything but movie
movie.makemovie()
示例#12
0
import sys, os
from movierot import Movie

brightmax0 = 2.e8

# Parse command line arguments
execname = os.path.split(sys.argv[0])[-1]
try: 
    runid = sys.argv[1]
    itime = int(sys.argv[2])
    brightmax0 = float(sys.argv[3])
except IndexError, ValueError:
    print "Usage: %s RUNID ITIME" % execname
    exit

movie = Movie(runid=runid, movieid="tumble-%4.4i" % itime, 
	      time=itime, nframes=72, verbose=1, force=0)
movie.brightmax = brightmax0
movie.boxsize = 4.0
movie.camera.set_steps(5.0, 5.0)
movie.makemovie()