예제 #1
0
def orbitsAnimate(years=None,
                  root='./',
                  align='align/align_d_rms_1000_abs_t',
                  poly='polyfit_d/fit'):

    ##########
    #
    # START - Modify stuff in here only
    #
    ##########
    # Today's date
    today = 2008.5

    # Load up a starset of just those stars in orbits_movie.dat
    s = getOrbitStars(orbitFile='orbits_movie.dat',
                      root=root,
                      align=align,
                      poly=poly)
    tab = asciidata.open('/u/ghezgroup/data/gc/source_list/orbits_movie.dat')

    ##########
    #
    # STOP - Modify stuff in here only
    #
    ##########

    name = s.getArray('name')
    mag = s.getArray('mag')

    # Get plotting properties from the orbits.dat file
    discovered = tab[9].tonumpy()  # Discovery date
    xshift1 = tab[10].tonumpy()  # Shifts for labels (in first frame)
    yshift1 = tab[11].tonumpy()
    xshift2 = tab[12].tonumpy()  # Shifts for labels (in last frame)
    yshift2 = tab[13].tonumpy()
    colors = [tab[14][ss].strip() for ss in range(tab.nrows)]

    # Determine the mass assuming a distance of 8.0 kpc
    star0orb = s.stars[0].orbit
    dist = 8000.0  # in parsec
    axis = (star0orb.a / 1000.0) * dist  # in au
    mass = (axis)**3 / star0orb.p**2

    # Set the duration of the animation from the years keyword
    if (years == None):
        idx = name.index('S0-2')

        # Use S0-2's orbital period, rounded up to the nearest year
        years = math.ceil(s.stars[idx].orbit.p)

    # Array of time steps (0.1 yr steps)
    t = na.arange(1995.5, 1995.5 + years, 0.2, type=na.Float)

    # Do a flux scaling so that all the stars look good in our image.
    flux = 10.0**(mag / -3.0)
    flux /= flux.max()

    # Loop through all the stars and make an array of the X and Y positions
    # as a function of time. Store this on the star object as
    #   star.xanim -- array of X positions at each time step in t
    #   star.yanim -- array of Y positions at each time step in t
    for star in s.stars:
        (r, v, a) = star.orbit.kep2xyz(t, mass=mass, dist=dist)

        star.xanim = r[:, 0].copy()
        star.yanim = r[:, 1].copy()

    ## Make an image 500x500 pixels (1" x 1")
    #imgSize = 500 # pixels
    #scale = 1.0 / imgSize
    #xaxis = (na.arange(imgSize, type=na.Float) - (imgSize/2.0)) # xextent
    #xaxis *= -scale
    #yaxis = (na.arange(imgSize, type=na.Float) - (imgSize/2.0)) # yextent
    #yaxis *= scale

    # Make an image 1920x1080 pixels (1.7" x 1")
    ximgSize = 1920  # pixels
    yimgSize = 1080  # pixels
    xscale = (16.0 /
              9.) / ximgSize  # arcsec per pixel (16/9" from left to right)
    yscale = 1.0 / yimgSize  # arcsec per pixel (1" from top to bottom)
    xaxis = (na.arange(ximgSize, type=na.Float) - (ximgSize / 2.0))  # xextent
    xaxis *= -xscale
    yaxis = (na.arange(yimgSize, type=na.Float) - (yimgSize / 2.0))  # yextent
    yaxis *= yscale

    # Make grids of X/Y value at each pixel
    xx, yy = pylab.meshgrid(xaxis, yaxis)

    ##########
    #
    # Create image with gaussian PSF for each star
    #
    ##########
    fwhm = 0.020  # Make 20 mas instead of 55 mas

    for tt in range(1):
        #for tt in range(len(t)):
        time = t[tt]
        img = na.zeros((ximgSize, yimgSize), type=na.Float)
        xorb = []
        yorb = []

        for ss in range(1):
            #for ss in range(len(s.stars)):
            star = s.stars[ss]

            xpos = star.xanim[tt]
            ypos = star.yanim[tt]

            # Make a 2D gaussian for this star
            psf = na.exp(-((xx - xpos)**2 + (yy - ypos)**2) / fwhm**2)

            pdb.set_trace()
            img += flux[ss] * psf

        pylab.close(2)
        #pylab.figure(2, figsize=(5,5))
        pylab.figure(2, figsize=(16, 9))
        pylab.clf()
        pylab.axes([0.0, 0.0, 1.0, 1.0])
        pylab.axis('off')
        cmap = gccolors.idl_rainbow()
        pylab.imshow(sqrt(img),
                     origin='lowerleft',
                     cmap=cmap,
                     extent=[xaxis[0], xaxis[-1], yaxis[0], yaxis[-1]],
                     vmin=sqrt(0.01),
                     vmax=sqrt(1.0))

        # Plot the trails for each star
        for ss in range(len(s.stars)):
            star = s.stars[ss]

            before = where((t < time) & (t < discovered[ss]))[0]
            during = where((t < time) & (t >= discovered[ss])
                           & (t <= today))[0]
            future = where((t < time) & (t > today))[0]

            # Dashed before discovery and in the future
            if (len(before) > 0):
                pylab.plot(star.xanim[before],
                           star.yanim[before],
                           '--',
                           color=colors[ss],
                           linewidth=2)
            if (len(during) > 0):
                pylab.plot(star.xanim[during],
                           star.yanim[during],
                           '-',
                           color=colors[ss],
                           linewidth=2)
            if (len(future) > 0):
                pylab.plot(star.xanim[future],
                           star.yanim[future],
                           '--',
                           color=colors[ss],
                           linewidth=2)
            # Label the stars in the first and last image
            if (tt == 0):
                pylab.text(star.xanim[tt] + xshift1[ss],
                           star.yanim[tt] + yshift1[ss],
                           name[ss],
                           color='y',
                           fontsize=10)
            if (tt == (len(t) - 1)):
                pylab.text(star.xanim[tt] + xshift2[ss],
                           star.yanim[tt] + yshift2[ss],
                           name[ss],
                           color='y',
                           fontsize=10)
            # Label the first LGSAO image
            #diff = (abs(2005.5 - t).argsort())[0]
            #if (tt == diff):
            #    pylab.text(star.xanim[tt]+0.05,star.yanim[tt]+0.05,name[ss],color='y')

        ## Draw an outline box
        #bx = 0.49
        #pylab.plot([bx, -bx, -bx, bx, bx], [-bx, -bx, bx, bx, -bx],
        #           color='white', linewidth=2)

        #pylab.text(0.45, 0.4, t[tt], color='white',
        #           fontsize=16, fontweight='bold',
        #           horizontalalignment='left', verticalalignment='bottom')
        #pylab.text(-0.3, -0.4, 'Keck/UCLA Galactic',
        #           color='white', fontsize=10, fontweight='bold',
        #           horizontalalignment='center', verticalalignment='top')
        #pylab.text(-0.3, -0.44, 'Center Group',
        #           color='white', fontsize=10, fontweight='bold',
        #           horizontalalignment='center', verticalalignment='top')

        # Plot a scale (make it slightly larger than 0.1", otherwise overlapping
        # arrows look funny
        pylab.quiver2([0.45], [-0.1], [0], [0.105],
                      color='w',
                      width=0.005,
                      scale=1)
        pylab.quiver2([0.45], [0.0], [0], [-0.105],
                      color='w',
                      width=0.005,
                      scale=1)
        pylab.text(0.4,
                   -0.045,
                   '0.1\"',
                   color='white',
                   fontsize=14,
                   fontweight='bold',
                   horizontalalignment='center',
                   verticalalignment='top')

        # Draw a star at the position of Sgr A* (large at first, then smaller)
        sgraColor = 'white'
        if (tt == 0):
            star = gccolors.Star(0, 0, 0.08)
            pylab.fill(star[0],
                       star[1],
                       fill=True,
                       edgecolor=sgraColor,
                       linewidth=1.5,
                       facecolor=sgraColor)
        if (tt == 1):
            star = gccolors.Star(0, 0, 0.07)
            pylab.fill(star[0],
                       star[1],
                       fill=True,
                       edgecolor=sgraColor,
                       linewidth=1.5,
                       facecolor=sgraColor)
        if (tt == 2):
            star = gccolors.Star(0, 0, 0.06)
            pylab.fill(star[0],
                       star[1],
                       fill=True,
                       edgecolor=sgraColor,
                       linewidth=1.5,
                       facecolor=sgraColor)
        if (tt == 3):
            star = gccolors.Star(0, 0, 0.05)
            pylab.fill(star[0],
                       star[1],
                       fill=True,
                       edgecolor=sgraColor,
                       linewidth=1.5,
                       facecolor=sgraColor)
        if (tt == 4):
            star = gccolors.Star(0, 0, 0.04)
            pylab.fill(star[0],
                       star[1],
                       fill=True,
                       edgecolor=sgraColor,
                       linewidth=1.5,
                       facecolor=sgraColor)
        if (tt == 5):
            star = gccolors.Star(0, 0, 0.04)
            pylab.fill(star[0],
                       star[1],
                       fill=True,
                       edgecolor=sgraColor,
                       linewidth=1.5,
                       facecolor=sgraColor)
        if (tt > 5):
            star = gccolors.Star(0, 0, 0.03)
            pylab.fill(star[0],
                       star[1],
                       fill=False,
                       edgecolor=sgraColor,
                       linewidth=1.5)
        pylab.axis([0.5, -0.5, -0.5, 0.5])
        # Save as png for the best animation image quality and smallest animation!!!!
        pylab.savefig(
            '/u/ghezgroup/public_html/gc/images/media/orbits_anim_HD/img_%s.png'
            % str(t[tt]),
            dpi=100)
예제 #2
0
def orbitsAnimate(years=None, root="./", align="align/align_d_rms_1000_abs_t", poly="polyfit_d/fit"):

    ##########
    #
    # START - Modify stuff in here only
    #
    ##########
    # Today's date
    today = 2008.5

    # Load up a starset of just those stars in orbits_movie.dat
    s = getOrbitStars(orbitFile="orbits_movie.dat", root=root, align=align, poly=poly)
    tab = asciidata.open("/u/ghezgroup/data/gc/source_list/orbits_movie.dat")

    ##########
    #
    # STOP - Modify stuff in here only
    #
    ##########

    name = s.getArray("name")
    mag = s.getArray("mag")

    # Get plotting properties from the orbits.dat file
    discovered = tab[9].tonumpy()  # Discovery date
    xshift1 = tab[10].tonumpy()  # Shifts for labels (in first frame)
    yshift1 = tab[11].tonumpy()
    xshift2 = tab[12].tonumpy()  # Shifts for labels (in last frame)
    yshift2 = tab[13].tonumpy()
    colors = [tab[14][ss].strip() for ss in range(tab.nrows)]

    # Determine the mass assuming a distance of 8.0 kpc
    star0orb = s.stars[0].orbit
    dist = 8000.0  # in parsec
    axis = (star0orb.a / 1000.0) * dist  # in au
    mass = (axis) ** 3 / star0orb.p ** 2

    # Set the duration of the animation from the years keyword
    if years == None:
        idx = name.index("S0-2")

        # Use S0-2's orbital period, rounded up to the nearest year
        years = math.ceil(s.stars[idx].orbit.p)

    # Array of time steps (0.1 yr steps)
    t = na.arange(1995.5, 1995.5 + years, 0.2, type=na.Float)

    # Do a flux scaling so that all the stars look good in our image.
    flux = 10.0 ** (mag / -3.0)
    flux /= flux.max()

    # Loop through all the stars and make an array of the X and Y positions
    # as a function of time. Store this on the star object as
    #   star.xanim -- array of X positions at each time step in t
    #   star.yanim -- array of Y positions at each time step in t
    for star in s.stars:
        (r, v, a) = star.orbit.kep2xyz(t, mass=mass, dist=dist)

        star.xanim = r[:, 0].copy()
        star.yanim = r[:, 1].copy()

    ## Make an image 500x500 pixels (1" x 1")
    # imgSize = 500 # pixels
    # scale = 1.0 / imgSize
    # xaxis = (na.arange(imgSize, type=na.Float) - (imgSize/2.0)) # xextent
    # xaxis *= -scale
    # yaxis = (na.arange(imgSize, type=na.Float) - (imgSize/2.0)) # yextent
    # yaxis *= scale

    # Make an image 1920x1080 pixels (1.7" x 1")
    ximgSize = 1920  # pixels
    yimgSize = 1080  # pixels
    xscale = (16.0 / 9.0) / ximgSize  # arcsec per pixel (16/9" from left to right)
    yscale = 1.0 / yimgSize  # arcsec per pixel (1" from top to bottom)
    xaxis = na.arange(ximgSize, type=na.Float) - (ximgSize / 2.0)  # xextent
    xaxis *= -xscale
    yaxis = na.arange(yimgSize, type=na.Float) - (yimgSize / 2.0)  # yextent
    yaxis *= yscale

    # Make grids of X/Y value at each pixel
    xx, yy = pylab.meshgrid(xaxis, yaxis)

    ##########
    #
    # Create image with gaussian PSF for each star
    #
    ##########
    fwhm = 0.020  # Make 20 mas instead of 55 mas

    for tt in range(1):
        # for tt in range(len(t)):
        time = t[tt]
        img = na.zeros((ximgSize, yimgSize), type=na.Float)
        xorb = []
        yorb = []

        for ss in range(1):
            # for ss in range(len(s.stars)):
            star = s.stars[ss]

            xpos = star.xanim[tt]
            ypos = star.yanim[tt]

            # Make a 2D gaussian for this star
            psf = na.exp(-((xx - xpos) ** 2 + (yy - ypos) ** 2) / fwhm ** 2)

            pdb.set_trace()
            img += flux[ss] * psf

        pylab.close(2)
        # pylab.figure(2, figsize=(5,5))
        pylab.figure(2, figsize=(16, 9))
        pylab.clf()
        pylab.axes([0.0, 0.0, 1.0, 1.0])
        pylab.axis("off")
        cmap = gccolors.idl_rainbow()
        pylab.imshow(
            sqrt(img),
            origin="lowerleft",
            cmap=cmap,
            extent=[xaxis[0], xaxis[-1], yaxis[0], yaxis[-1]],
            vmin=sqrt(0.01),
            vmax=sqrt(1.0),
        )

        # Plot the trails for each star
        for ss in range(len(s.stars)):
            star = s.stars[ss]

            before = where((t < time) & (t < discovered[ss]))[0]
            during = where((t < time) & (t >= discovered[ss]) & (t <= today))[0]
            future = where((t < time) & (t > today))[0]

            # Dashed before discovery and in the future
            if len(before) > 0:
                pylab.plot(star.xanim[before], star.yanim[before], "--", color=colors[ss], linewidth=2)
            if len(during) > 0:
                pylab.plot(star.xanim[during], star.yanim[during], "-", color=colors[ss], linewidth=2)
            if len(future) > 0:
                pylab.plot(star.xanim[future], star.yanim[future], "--", color=colors[ss], linewidth=2)
            # Label the stars in the first and last image
            if tt == 0:
                pylab.text(star.xanim[tt] + xshift1[ss], star.yanim[tt] + yshift1[ss], name[ss], color="y", fontsize=10)
            if tt == (len(t) - 1):
                pylab.text(star.xanim[tt] + xshift2[ss], star.yanim[tt] + yshift2[ss], name[ss], color="y", fontsize=10)
            # Label the first LGSAO image
            # diff = (abs(2005.5 - t).argsort())[0]
            # if (tt == diff):
            #    pylab.text(star.xanim[tt]+0.05,star.yanim[tt]+0.05,name[ss],color='y')

        ## Draw an outline box
        # bx = 0.49
        # pylab.plot([bx, -bx, -bx, bx, bx], [-bx, -bx, bx, bx, -bx],
        #           color='white', linewidth=2)

        # pylab.text(0.45, 0.4, t[tt], color='white',
        #           fontsize=16, fontweight='bold',
        #           horizontalalignment='left', verticalalignment='bottom')
        # pylab.text(-0.3, -0.4, 'Keck/UCLA Galactic',
        #           color='white', fontsize=10, fontweight='bold',
        #           horizontalalignment='center', verticalalignment='top')
        # pylab.text(-0.3, -0.44, 'Center Group',
        #           color='white', fontsize=10, fontweight='bold',
        #           horizontalalignment='center', verticalalignment='top')

        # Plot a scale (make it slightly larger than 0.1", otherwise overlapping
        # arrows look funny
        pylab.quiver2([0.45], [-0.1], [0], [0.105], color="w", width=0.005, scale=1)
        pylab.quiver2([0.45], [0.0], [0], [-0.105], color="w", width=0.005, scale=1)
        pylab.text(
            0.4,
            -0.045,
            '0.1"',
            color="white",
            fontsize=14,
            fontweight="bold",
            horizontalalignment="center",
            verticalalignment="top",
        )

        # Draw a star at the position of Sgr A* (large at first, then smaller)
        sgraColor = "white"
        if tt == 0:
            star = gccolors.Star(0, 0, 0.08)
            pylab.fill(star[0], star[1], fill=True, edgecolor=sgraColor, linewidth=1.5, facecolor=sgraColor)
        if tt == 1:
            star = gccolors.Star(0, 0, 0.07)
            pylab.fill(star[0], star[1], fill=True, edgecolor=sgraColor, linewidth=1.5, facecolor=sgraColor)
        if tt == 2:
            star = gccolors.Star(0, 0, 0.06)
            pylab.fill(star[0], star[1], fill=True, edgecolor=sgraColor, linewidth=1.5, facecolor=sgraColor)
        if tt == 3:
            star = gccolors.Star(0, 0, 0.05)
            pylab.fill(star[0], star[1], fill=True, edgecolor=sgraColor, linewidth=1.5, facecolor=sgraColor)
        if tt == 4:
            star = gccolors.Star(0, 0, 0.04)
            pylab.fill(star[0], star[1], fill=True, edgecolor=sgraColor, linewidth=1.5, facecolor=sgraColor)
        if tt == 5:
            star = gccolors.Star(0, 0, 0.04)
            pylab.fill(star[0], star[1], fill=True, edgecolor=sgraColor, linewidth=1.5, facecolor=sgraColor)
        if tt > 5:
            star = gccolors.Star(0, 0, 0.03)
            pylab.fill(star[0], star[1], fill=False, edgecolor=sgraColor, linewidth=1.5)
        pylab.axis([0.5, -0.5, -0.5, 0.5])
        # Save as png for the best animation image quality and smallest animation!!!!
        pylab.savefig("/u/ghezgroup/public_html/gc/images/media/orbits_anim_HD/img_%s.png" % str(t[tt]), dpi=100)
예제 #3
0
def orbitsAnimate(years=None, rad=0.5,
                      root='./',
                      align='align/align_d_rms_1000_abs_t',
                      poly='polyfit_d/fit',
                      orbitFile='orbits_movie.dat'):
    """
    Set rad to indicate the radial extent of orbits animation.
    Default is rad=0.5, which will show the central arcsecond orbits.
    """

    ##########
    #
    # START - Modify stuff in here only
    #
    ##########
    # Today's date
    today = 2011.7
    
    # Load up a starset of just those stars in orbits_movie.dat
    s = getOrbitStars(orbitFile=orbitFile,
                      root=root, align=align, poly=poly)
    tab = asciidata.open('/u/ghezgroup/data/gc/source_list/orbits_movie.dat')
    #tab = asciidata.open('/u/ghezgroup/data/gc/source_list/new_orbits_movie_keck_foundation_v2.dat')
    #tab = asciidata.open('/u/syelda/research/gc/aligndir/09_09_20/efit/new_orbits_movie.dat')

    ##########
    #
    # STOP - Modify stuff in here only
    #
    ##########

    name = s.getArray('name')
    mag = s.getArray('mag')

    # Get plotting properties from the orbits.dat file
    discovered = tab[9].tonumpy()  # Discovery date
    xshift1 = tab[10].tonumpy()    # Shifts for labels (in first frame)
    yshift1 = tab[11].tonumpy()
    xshift2 = tab[12].tonumpy()    # Shifts for labels (in last frame)
    yshift2 = tab[13].tonumpy()
    colors = [tab[14][ss].strip() for ss in range(tab.nrows)]

    # Determine the mass assuming a distance of 8.0 kpc
    star0orb = s.stars[0].orbit
    dist = 8000.0 # in parsec
    axis = (star0orb.a / 1000.0) * dist # in au
    mass = (axis)**3 / star0orb.p**2

    # Set the duration of the animation from the years keyword
    if (years == None):
        idx = name.index('S0-2')

        # Use S0-2's orbital period, rounded up to the nearest year
        years = math.ceil(s.stars[idx].orbit.p)

    # Array of time steps (0.1 yr steps)
    t = na.arange(1995.5, 1995.5+years, 0.2, type=na.Float)

    # For keck foundation presentation, make two versions:
    # Keck foundation version 1 -- extend to 2010.7
    #t = na.arange(1995.5, 2010.8, 0.2, type=na.Float)
    # Keck foundation version 2 -- extend to 2019.7
    #t = na.arange(1995.5, 2019.8, 0.2, type=na.Float)

    # Do a flux scaling so that all the stars look good in our image.
    #flux = 10.0**(mag/-3.0)
    #flux /= flux.max()
    flux = 10.0**(mag/-4.0) # Had to change to get 19th mag star to show up!
    flux /= flux.max()

    # Loop through all the stars and make an array of the X and Y positions
    # as a function of time. Store this on the star object as
    #   star.xanim -- array of X positions at each time step in t
    #   star.yanim -- array of Y positions at each time step in t
    for star in s.stars:
        (r, v, a) = star.orbit.kep2xyz(t, mass=mass, dist=dist)

        star.xanim = r[:,0].copy()
        star.yanim = r[:,1].copy()

    # Make an image 500x500 pixels (1" x 1")
    imgSize = 500 # pixels
    scale = (2.0*rad) / imgSize
    xaxis = (na.arange(imgSize, type=na.Float) - (imgSize/2.0)) # xextent
    xaxis *= -scale
    yaxis = (na.arange(imgSize, type=na.Float) - (imgSize/2.0)) # yextent
    yaxis *= scale

    # Make grids of X/Y value at each pixel
    xx, yy = pylab.meshgrid(xaxis, yaxis)

    ##########
    #
    # Create image with gaussian PSF for each star
    #
    ##########
    fwhm = 0.020   # Make 20 mas instead of 55 mas

    #for tt in range(1):
    #for tt in [len(t)-1]:
    for tt in range(len(t)):
        time = t[tt]
        img = na.zeros((imgSize, imgSize), type=na.Float)
        xorb = []
        yorb = []
        
        #for ss in range(1):
        for ss in range(len(s.stars)):
            star = s.stars[ss]

            xpos = star.xanim[tt]
            ypos = star.yanim[tt]

            # Make a 2D gaussian for this star
            psf = na.exp(-((xx - xpos)**2 + (yy - ypos)**2) / fwhm**2)

            img += flux[ss] * psf

        pylab.close(2)
        # For higher resolution, just increase figsize slightly
        pylab.figure(2, figsize=(5,5))
        pylab.clf()
        pylab.axes([0.0, 0.0, 1.0, 1.0])
        pylab.axis('off')
        cmap = gccolors.idl_rainbow()
        pylab.imshow(sqrt(img), origin='lowerleft', cmap=cmap,
                     extent=[xaxis[0], xaxis[-1], yaxis[0], yaxis[-1]],
                     vmin=sqrt(0.01), vmax=sqrt(1.0))

        # Plot the trails for each star 
        for ss in range(len(s.stars)):
            star = s.stars[ss]

            before = where((t < time) & (t < discovered[ss]))[0]
            during = where((t < time) & (t >= discovered[ss]) & (t <= today))[0]
            future = where((t < time) & (t > today))[0]

            # Dashed before discovery and in the future
            if (len(before) > 0):    
                pylab.plot(star.xanim[before], star.yanim[before], '--',
                           color=colors[ss], linewidth=2)
            if (len(during) > 0):    
                pylab.plot(star.xanim[during], star.yanim[during], '-',
                           color=colors[ss], linewidth=2)
            if (len(future) > 0):    
                pylab.plot(star.xanim[future], star.yanim[future], '--',
                           color=colors[ss], linewidth=2)
            # Label the stars in the first and last image
            if (tt == 0):
                pylab.text(star.xanim[tt]+xshift1[ss],
                           star.yanim[tt]+yshift1[ss],
                           name[ss],color='y', fontsize=10)
            if (tt == (len(t)-1)):
                pylab.text(star.xanim[tt]+xshift2[ss],
                           star.yanim[tt]+yshift2[ss],
                           name[ss],color='y', fontsize=10)
            # Label the first LGSAO image
            #diff = (abs(2005.5 - t).argsort())[0]
            #if (tt == diff):
            #    pylab.text(star.xanim[tt]+0.05,star.yanim[tt]+0.05,name[ss],color='y')

        # Draw an outline box
        #bx = 0.49
        bx = rad-(0.02*rad)
        pylab.plot([bx, -bx, -bx, bx, bx], [-bx, -bx, bx, bx, -bx],
                   color='white', linewidth=2)

        pylab.text(rad-(0.1*rad), rad-(0.2*rad), t[tt], color='white',
                   fontsize=16, fontweight='bold',
                   horizontalalignment='left', verticalalignment='bottom')
        pylab.text(rad-(0.4*rad), -rad+(0.2*rad), 'Keck/UCLA Galactic',
                   color='white', fontsize=10, fontweight='bold',
                   horizontalalignment='center', verticalalignment='top')
        pylab.text(rad-(0.4*rad), -rad+(0.12*rad), 'Center Group',
                   color='white', fontsize=10, fontweight='bold',
                   horizontalalignment='center', verticalalignment='top')

        # Plot a scale (make it slightly larger than 0.1", otherwise overlapping
        # arrows look funny
        arrowSize = rad/5.
        pylab.quiver([-rad+(0.1*rad)],[-rad+(0.3*rad)],[0],[arrowSize+0.005],
                       color='w',width=0.005,scale=1,units='x')
        pylab.quiver([-rad+(0.1*rad)],[-rad+(0.3*rad)-arrowSize+0.003],[0],
                       [-arrowSize-0.005], color='w',width=0.005,scale=1,units='x')
        pylab.text(-rad+(0.22*rad), -rad+(0.25*rad), str(arrowSize)+'\"',
                   color='white', fontsize=14, fontweight='bold',
                   horizontalalignment='center', verticalalignment='top')

        # Draw a star at the position of Sgr A* (large at first, then smaller)
        sgraColor = 'white'
        if (tt == 0):
            star = gccolors.Star(0,0,0.08)
            pylab.fill(star[0], star[1], fill=True,edgecolor=sgraColor,
                       linewidth=1.5,facecolor=sgraColor)
        if (tt == 1):
            star = gccolors.Star(0,0,0.07)
            pylab.fill(star[0], star[1], fill=True,edgecolor=sgraColor,
                       linewidth=1.5,facecolor=sgraColor)
        if (tt == 2):
            star = gccolors.Star(0,0,0.06)
            pylab.fill(star[0], star[1], fill=True,edgecolor=sgraColor,
                       linewidth=1.5,facecolor=sgraColor)
        if (tt == 3):
            star = gccolors.Star(0,0,0.05)
            pylab.fill(star[0], star[1], fill=True,edgecolor=sgraColor,
                       linewidth=1.5,facecolor=sgraColor)
        if (tt == 4):
            star = gccolors.Star(0,0,0.04)
            pylab.fill(star[0], star[1], fill=True,edgecolor=sgraColor,
                       linewidth=1.5,facecolor=sgraColor)
        if (tt == 5):
            star = gccolors.Star(0,0,0.04)
            pylab.fill(star[0], star[1], fill=True,edgecolor=sgraColor,
                       linewidth=1.5,facecolor=sgraColor)
        if (tt > 5):
            star = gccolors.Star(0,0,0.03)
            pylab.fill(star[0], star[1], fill=False,edgecolor=sgraColor,
                       linewidth=1.5)
        #pylab.axis([0.5, -0.5, -0.5, 0.5])
        pylab.axis([rad, -1.*rad, -1*rad, rad])
        # Save as png for the best animation image quality and smallest animation!!!!
        #pylab.savefig('/u/ghezgroup/public_html/gc/images/media/orbits_anim_2008/img_%s.png'
        pylab.savefig('/u/syelda/research/gc/anim/orbits/2011/img_%s.png'
                      % str(t[tt]), dpi=100)