Changeset 1171


Ignore:
Timestamp:
Mar 31, 2005, 11:51:37 AM (20 years ago)
Author:
ole
Message:

Added keyword 'depth' to sww2domain, changed output filenames and modified test

Location:
inundation/ga/storm_surge/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/data_manager.py

    r1155 r1171  
    10871087
    10881088    if basename_out is None:
    1089         basename_out = basename_in
     1089        basename_out = basename_in + '_%s' %quantity
    10901090       
    10911091    swwfile = basename_in + '.sww'
     
    11201120
    11211121    #Get quantity and reduce if applicable
    1122     if verbose: print 'Reading quantity %s' %quantity   
    1123     q = fid.variables[quantity][:]
     1122    if verbose: print 'Reading quantity %s' %quantity
     1123
     1124    if quantity.lower() == 'depth':
     1125        q = fid.variables['stage'][:] - fid.variables['elevation'][:]
     1126    else: 
     1127        q = fid.variables[quantity][:]
    11241128
    11251129   
     
    12141218   
    12151219    for i in range(nrows):
    1216         if verbose and i%((nrows+1)/10)==0:
     1220        if verbose and i%((nrows+10)/10)==0:
    12171221            print 'Doing row %d of %d' %(i, nrows)
    12181222           
  • inundation/ga/storm_surge/pyvolution/test_data_manager.py

    r1170 r1171  
    595595        self.domain.filename = 'datatest'
    596596       
    597         prjfile = self.domain.filename + '.prj'
    598         ascfile = self.domain.filename + '.asc'       
     597        prjfile = self.domain.filename + '_elevation.prj'
     598        ascfile = self.domain.filename + '_elevation.asc'       
    599599        swwfile = self.domain.filename + '.sww'
    600600       
     
    633633        sww2asc(self.domain.filename,
    634634                quantity = 'elevation',                         
    635                 cellsize = cellsize)
     635                cellsize = cellsize,
     636                verbose = False)
    636637
    637638
    638639        #Check prj (meta data)
    639640        prjid = open(prjfile)
    640 
    641641        lines = prjid.readlines()
    642642        prjid.close()
     
    737737        self.domain.filename = 'datatest'
    738738       
    739         prjfile = self.domain.filename + '.prj'
    740         ascfile = self.domain.filename + '.asc'       
     739        prjfile = self.domain.filename + '_stage.prj'
     740        ascfile = self.domain.filename + '_stage.asc'               
    741741        swwfile = self.domain.filename + '.sww'
    742742       
     
    889889        domain.filename = 'datatest'
    890890       
    891         prjfile = domain.filename + '.prj'
    892         ascfile = domain.filename + '.asc'       
     891        prjfile = domain.filename + '_elevation.prj'
     892        ascfile = domain.filename + '_elevation.asc'               
    893893        swwfile = domain.filename + '.sww'
    894894       
     
    922922        sww2asc(domain.filename,
    923923                quantity = 'elevation',                         
    924                 cellsize = cellsize)
     924                cellsize = cellsize,
     925                verbose = False)
    925926
    926927
Note: See TracChangeset for help on using the changeset viewer.