# Get the home directory import sys homeDir=os.getenv("HOME") print homeDir # Open the bundle and change the size of the display frame to 640 by 480 loadBundle("/Users/joleenf/mcidas/bundles/2012_02_09.mcvz",None,640,480) pause() #---Get the display and use a preset projection myDisplay=firstDisplay() # get the view managers for the display myDisplay.setProjectionByName("US>States>West>Colorado") # this sets the new Projection #---end of commands which center the image to user chosen location--- #Save the images (Loop through the time sequences and save each image) myAnim=myDisplay.getAnimation() # this gets the animation sequence in the bundle loopTime=myAnim.getTimes() # this returns an array of times in that time sequence steps=myAnim.getNumSteps() # this is the number of frames in the sequence #Loop through the frames, save each to a filename of the form afterScript.jpg #Use writeImage to add colorbar, there is a cheat here. There are two colorbars, since there are two layers, position so that one colorbar is out #side the final image frame. for x in range(steps): fileName=("%s%s%s%s" % (homeDir,"/afterScript",x,".jpg")) print fileName strTime=str(loopTime[x]) writeImage(fileName,"matte background=white top=80; colorbar width=200 height=20 anchor=UM place=UM,0,15 showlines=true tickmarks=4 showunit=true;\ overlay text="+strTime+" anchor=UM place=UM,0,50 color=black fontsize=20 fontface=Arial") myAnim.takeStep()