Changeset 7158
- Timestamp:
- Jun 9, 2009, 11:19:13 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/production/hobart_2009/setup_model.py
r7082 r7158 147 147 # Create list of land polygons with initial conditions 148 148 project.land_initial_conditions = [] 149 for filename, MSL in project.land_initial_conditions_filename: 150 polygon = read_polygon(join(project.polygons_folder, filename)) 151 project.land_initial_conditions.append([polygon, MSL]) 152 149 # if it's a list, then it's a list of land condition filenames 150 # else it's a string - a single file, multiple land conditions 151 if isinstance(project.land_initial_conditions_filename, list): 152 for filename, MSL in project.land_initial_conditions_filename: 153 polygon = read_polygon(join(project.polygons_folder, filename)) 154 project.land_initial_conditions.append([polygon, MSL]) 155 elif isinstance(project.land_initial_conditions_filename, basestring): 156 polygons, MSL = csv2polygons(join(project.polygons_folder, 157 project.land_initial_conditions_filename)) 158 for i, key in enumerate(polygons): 159 if i%100==0: print i 160 poly = polygons[key] 161 land = float(MSL[key]) 162 project.land_initial_conditions.append([poly, land]) 163 else: 164 msg = ('project.land_initial_conditions_filename must be a list or ' 165 'string, got %s' 166 % type(project.land_initial_conditions_filename)) 167 raise Exception, msg 153 168 # Create list of interior polygons with scaling factor 154 169 project.interior_regions = []
Note: See TracChangeset
for help on using the changeset viewer.