Changeset 844
- Timestamp:
- Feb 8, 2005, 1:00:02 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/config.py
r566 r844 44 44 rho_w = 1023 #Fluid density [kg/m^3] (rho_w = 1023 for salt water) 45 45 46 47 48 49 46 50 47 … … 59 56 60 57 if sys.platform == 'win32': 61 d ata_dir = 'C:\grohm_output'58 default_datadir = 'C:\grohm_output' 62 59 else: 63 d ata_dir = os.path.expanduser('~'+os.sep+'grohm_output')60 default_datadir = os.path.expanduser('~'+os.sep+'grohm_output') 64 61 65 62 -
inundation/ga/storm_surge/pyvolution/data_manager.py
r839 r844 123 123 124 124 125 def create_filename( filename, format, size, time=None):125 def create_filename(datadir, filename, format, size=None, time=None): 126 126 127 127 import os 128 from config import data_dir 129 128 #from config import data_dir 130 129 131 FN = check_dir(data_dir) + filename + '_size%d' %size 130 FN = check_dir(datadir) + filename 131 132 if size is not None: 133 FN += '_size%d' %size 132 134 133 135 if time is not None: … … 138 140 139 141 140 def get_files( filename, format, size):142 def get_files(datadir, filename, format, size): 141 143 """Get all file (names) with gven name, size and format 142 144 """ … … 145 147 146 148 import os 147 from config import data_dir 148 149 #from config import data_dir 149 150 150 dir = check_dir(data _dir)151 dir = check_dir(datadir) 151 152 152 153 pattern = dir + os.sep + filename + '_size=%d*.%s' %(size, format) … … 168 169 169 170 #Create filename 170 self.filename = create_filename(domain.get_name(), extension, len(domain)) 171 #self.filename = create_filename(domain.get_datadir(), 172 # domain.get_name(), extension, len(domain)) 173 174 self.filename = create_filename(domain.get_datadir(), 175 domain.get_name(), extension) 176 171 177 self.timestep = 0 172 178 self.number_of_volumes = len(domain) … … 629 635 630 636 #Get NetCDF 631 FN = create_filename( basefilename, 'sww', size)637 FN = create_filename('.', basefilename, 'sww', size) 632 638 print 'Reading from ', FN 633 639 fid = NetCDFFile(FN, 'r') #Open existing file for read … … 653 659 654 660 #Write obj for bathymetry 655 FN = create_filename( basefilename, 'obj', size)661 FN = create_filename('.', basefilename, 'obj', size) 656 662 write_obj(FN,xx,yy,zz) 657 663 … … 671 677 #Write obj for variable data 672 678 #FN = create_filename(basefilename, 'obj', size, time=t) 673 FN = create_filename( basefilename[:5], 'obj', size, time=t)679 FN = create_filename('.', basefilename[:5], 'obj', size, time=t) 674 680 write_obj(FN,xx,yy,zz) 675 681 … … 677 683 def dat2obj(basefilename): 678 684 """Convert line based data output to obj 685 FIXME: Obsolete? 679 686 """ 680 687 -
inundation/ga/storm_surge/pyvolution/domain.py
r819 r844 68 68 self.starttime = None 69 69 70 #Checkpointing 70 #Checkpointing and storage 71 from config import default_datadir 72 self.datadir = default_datadir 71 73 self.filename = 'domain' 72 74 self.checkpoint = False … … 311 313 self.filename = name 312 314 315 def get_datadir(self): 316 return self.datadir 317 318 def set_datadir(self, name): 319 self.datadir = name 320 321 322 313 323 #def set_defaults(self): 314 324 # """Set default values for uninitialised quantities. … … 336 346 """ 337 347 338 #import data_manager339 348 from config import min_timestep, max_timestep, epsilon 340 349 -
inundation/ga/storm_surge/pyvolution/generic_boundary_conditions.py
r835 r844 123 123 124 124 No spatial info assumed. 125 FIXME: Soon to be Obsolete126 125 """ 127 126 -
inundation/ga/storm_surge/pyvolution/test_generic_boundary_conditions.py
r843 r844 179 179 180 180 181 def test_fileboundary_time_and_space(self):182 """Test that boundary values can be read from file and interpolated183 Include both time and space184 """185 186 from domain import Domain187 from quantity import Quantity188 189 190 #Create sww file of simple propagation from left to right191 #through rectangular domain: domain1192 193 #Create an oblique domain,194 #rectangular with left side at an angle but fully contained within195 #previous rectangular domain and called it domain2196 197 #Use output from domain1 as spatio-temporal boundary for domain2198 #and verify that results at right hand side are close.199 200 201 202 203 #print 'File boundary_time_and_space not yet implemented'204 205 181 def test_fileboundary_exception(self): 206 182 """Test that boundary object complians if number of -
inundation/ga/storm_surge/pyvolution/util.py
r842 r844 110 110 time only, i.e no spatial dependency!!!!! 111 111 When that is needed we can use the least_squares interpolation. 112 113 #FIXME: This should work with netcdf (e.g. sww) and thus render the 114 #spatio-temporal boundary condition in shallow water fully general 112 115 """ 113 116
Note: See TracChangeset
for help on using the changeset viewer.