# =========================================================================== ''' Program makeMovies_*.py to go with carboCell_4_2.py Written by CJ Jenkins INSTAAR 2 Dec 2010 ''' # =========================================================================== import os, time #Uses the PNG of the CA and CAfft to make two GIF movies #Note: Assumes that imagemagic is installed on the machine #From... Python scripting for computational science # by Hans Petter Langtangen #Banner ------------------------------------------------------------------ print "*"*70;print print "\t"*3,"MovieMaker for Program carboCell_*.py"; print print "\t","which is a Python program after the Matlab carboCAT"; print print "\t","Peter Burgess RHUL, Chris Jenkins INSTAAR, Donald Potts UCSC" print "\t","Questions to: chris.jenkins@colorado.edu" print "\t"*4,"Dec 2010" print print "\t","This program requires that Imagemagick is installed" print "\t\t","(http://www.imagemagick.org/)" print;print "*"*70;print loudQ=False print ">>makeMovies:";print #Set a project name and directory ----------------- moviProjS="" while moviProjS=="": kyS=raw_input("Which project ? (eg '_CJJ') ") if kyS[0]=="_": moviProjS=kyS.lower() print "Project accepted: moviProjS=",moviProjS,moviProjS+"/_movies" print moviDIRs=moviProjS+"/_movies/" try: os.mkdir(moviDIRs) except: print "Problem making movie folder ! (?exists) ",moviDIRs makeMoviBatF=open(moviDIRs+"carboCell_MakeMovi.bat","w") print #Start the real proceedings ----------------------------------- outputCApngA=[] #Initializing makeMoviBatF.write("\n\nrem "+":".join(map(str,time.localtime()[:5]))+"\n\n") #makeMoviBatF.write("\ndel mapsCAmovi.gif"+"\n") makeMoviBatF.write("\nREM Please wait ...\n\n") outputCAcmdS="convert -loop 1 -crop 0x0 "+\ "-delay 200 ../../carboCellMapsTitle.png "+\ "-delay 150 ../../carboCellOrgsKey.jpg "+\ "-delay 25 ../outputCA_*.png "+ \ "-delay 100 ../../carboCellOrgsKey.jpg "+\ "mapsCAmovi.gif" print "Mapping Output:", outputCAcmdS makeMoviBatF.write(outputCAcmdS) # ------------------------------------------- correlCApngA=[] #Initialize makeMoviBatF.write("\n\nrem "+":".join(map(str,time.localtime()[:5]))+"\n\n") #makeMoviBatF.write("\ndel corrCAmovi.gif"+"\n") makeMoviBatF.write("\nREM Please wait ...\n\n") correlCAcmdS="convert -loop 1 -crop 0x0 "+\ "-delay 250 ../../carboCellStatsTitle.png "+\ "-delay 25 ../correlCA_*.png "+ \ "corrCAmovi.gif" print "Correlation Output:", correlCAcmdS makeMoviBatF.write(correlCAcmdS) makeMoviBatF.write("\n\nREM ( to close)"+"\n") makeMoviBatF.write("pause"+"\n") makeMoviBatF.close() # ------------------------------------------- #Execute... print;print "Please wait ..." os.system(moviDIRs+"carboCellMakeMovi.bat") print; print "Finished the movie making !"