Changeset 4824
- Timestamp:
- Nov 16, 2007, 5:21:36 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/shallow_water/data_manager.py
r4780 r4824 2509 2509 ncols = int(lines[0].split()[1].strip()) 2510 2510 nrows = int(lines[1].split()[1].strip()) 2511 xllcorner = float(lines[2].split()[1].strip()) 2512 yllcorner = float(lines[3].split()[1].strip()) 2513 cellsize = float(lines[4].split()[1].strip()) 2511 2512 # Do cellsize (line 4) before line 2 and 3 2513 cellsize = float(lines[4].split()[1].strip()) 2514 2515 # Checks suggested by Joaquim Luis 2516 # Our internal representation of xllcorner 2517 # and yllcorner is non-standard. 2518 xref = lines[2].split() 2519 if xref[0].strip() == 'xllcorner': 2520 xllcorner = float(xref[1].strip()) # + 0.5*cellsize # Correct offset 2521 elif xref[0].strip() == 'xllcenter': 2522 xllcorner = float(xref[1].strip()) 2523 else: 2524 msg = 'Unknown keyword: %s' %xref[0].strip() 2525 raise Exception, msg 2526 2527 yref = lines[3].split() 2528 if yref[0].strip() == 'yllcorner': 2529 yllcorner = float(yref[1].strip()) # + 0.5*cellsize # Correct offset 2530 elif yref[0].strip() == 'yllcenter': 2531 yllcorner = float(yref[1].strip()) 2532 else: 2533 msg = 'Unknown keyword: %s' %yref[0].strip() 2534 raise Exception, msg 2535 2536 2514 2537 NODATA_value = int(lines[5].split()[1].strip()) 2515 2538
Note: See TracChangeset
for help on using the changeset viewer.