/[escript]/trunk/modellib/py_src/tsunami.py
ViewVC logotype

Diff of /trunk/modellib/py_src/tsunami.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 323 by gross, Tue Dec 6 06:18:00 2005 UTC revision 326 by cochrane, Wed Dec 7 03:55:19 2005 UTC
# Line 886  class SurfMovie(Model): Line 886  class SurfMovie(Model):
886                                   max_height=1.0,                                   max_height=1.0,
887                                   filename="movie.mpg")                                   filename="movie.mpg")
888    
            self.paramsFileString = "REFERENCE_FRAME DECODED\n"  
            self.paramsFileString += "FRAME_RATE 24\n"  
            self.paramsFileString += "OUTPUT %s\n" % self.filename  
            self.paramsFileString += "PATTERN IBBPBBPBB\n"  
            self.paramsFileString += "FORCE_ENCODE_LAST_FRAME\n"  
            self.paramsFileString += "GOP_SIZE 20\n"  
            self.paramsFileString += "BSEARCH_ALG CROSS2\n"  
            self.paramsFileString += "PSEARCH_ALG TWOLEVEL\n"  
            self.paramsFileString += "IQSCALE 10\n"  
            self.paramsFileString += "PQSCALE 11\n"  
            self.paramsFileString += "BQSCALE 16\n"  
            self.paramsFileString += "RANGE 8\n"  
            self.paramsFileString += "SLICES_PER_FRAME 1\n"  
            self.paramsFileString += "BASE_FILE_FORMAT PNM\n"  
            self.paramsFileString += "INPUT_DIR \n"  
            self.paramsFileString += "INPUT_CONVERT *\n"  
            self.paramsFileString += "INPUT\n"  
   
            self.firstFrame = True  
   
            self.imageFiles = []  
   
889         def doInitialization(self):         def doInitialization(self):
890            """            """
891            Initializes the time integration scheme            Initializes the time integration scheme
# Line 919  class SurfMovie(Model): Line 897  class SurfMovie(Model):
897            # self.bathymetry.getVTK()            # self.bathymetry.getVTK()
898            # wndow(south,west,north,east)            # wndow(south,west,north,east)
899    
900              # set up the movie parameters
901              self.paramsFileString = "REFERENCE_FRAME DECODED\n"
902              self.paramsFileString += "FRAME_RATE 24\n"
903              self.paramsFileString += "OUTPUT %s\n" % self.filename
904              self.paramsFileString += "PATTERN IBBPBBPBB\n"
905              self.paramsFileString += "FORCE_ENCODE_LAST_FRAME\n"
906              self.paramsFileString += "GOP_SIZE 20\n"
907              self.paramsFileString += "BSEARCH_ALG CROSS2\n"
908              self.paramsFileString += "PSEARCH_ALG TWOLEVEL\n"
909              self.paramsFileString += "IQSCALE 10\n"
910              self.paramsFileString += "PQSCALE 11\n"
911              self.paramsFileString += "BQSCALE 16\n"
912              self.paramsFileString += "RANGE 8\n"
913              self.paramsFileString += "SLICES_PER_FRAME 1\n"
914              self.paramsFileString += "BASE_FILE_FORMAT PNM\n"
915              self.paramsFileString += "INPUT_DIR \n"
916              self.paramsFileString += "INPUT_CONVERT *\n"
917              self.paramsFileString += "INPUT\n"
918    
919              self.firstFrame = True
920    
921              self.imageFiles = []
922    
923            # the bathymmetry colourmap            # the bathymmetry colourmap
924            data = []            data = []
925            data.append([-8000, 0,   0,   0])            data.append([-8000, 0,   0,   0])
# Line 1209  class SurfMovie(Model): Line 1210  class SurfMovie(Model):
1210                print "An error occurred in mpeg conversion"                print "An error occurred in mpeg conversion"
1211    
1212            # now clean up the image files            # now clean up the image files
1213            print "Removing temporary image files"            if result == 0:
1214            os.unlink("%s.params" % self.filename)                print "Removing temporary image files"
1215            for fname in self.imageFiles:                os.unlink("%s.params" % self.filename)
1216                os.unlink(fname)                for fname in self.imageFiles:
1217                      os.unlink(fname)
1218    
1219  def main():  def main():
1220     from esys.escript.modelframe import Link,Simulation     from esys.escript.modelframe import Link,Simulation
# Line 1263  def main(): Line 1265  def main():
1265     sm.wave_height=Link(ts,"wave_height")     sm.wave_height=Link(ts,"wave_height")
1266     sm.coastline=Link(oreg,"coastline")     sm.coastline=Link(oreg,"coastline")
1267     sm.t=Link(sq,"t")     sm.t=Link(sq,"t")
1268     sm.filename="movie.mpg"     sm.filename="mymovie.mpg"
1269     sm.north= 8.7     sm.north= 8.7
1270     sm.west= 138.9     sm.west= 138.9
1271     sm.dt= 50.     sm.dt= 50.

Legend:
Removed from v.323  
changed lines
  Added in v.326

  ViewVC Help
Powered by ViewVC 1.1.26