Changeset 3483
- Timestamp:
- Aug 11, 2006, 12:55:08 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
documentation/user_manual/examples/harbour.py
r3275 r3483 66 66 def topography(x,y): 67 67 from Numeric import zeros, Float 68 z = zeros(len(x),len(y),Float) 68 z = zeros(len(x), Float) 69 70 xcentre = (west+east)/2. 69 71 ycentre = (south+north)/2. 70 72 ycentreup = ycentre+harbour_width/2. 71 73 ycentredown = ycentre-harbour_width/2. 72 74 for i, xi in enumerate(x): 73 for j, yi in enumerate(y): 74 if xi >= centre: z[i,j] = shelf_depth 75 if xi > west and xi <= centre-harbour_length: 76 if yi < ycentredown: z[i,j] = 0.0 77 if yi > ycentreup: z[i,j] = 0.0 78 if yi > ycentredown and yi < ycentreup: z[i,j] = harbour_depth 79 if xi > centre-harbour_length and xi < centre: z[i,j] = harbour_depth 75 yi = y[i] 76 if xi >= xcentre: z[i] = shelf_depth 77 if xi > west and xi <= xcentre-harbour_length: 78 if yi < ycentredown: z[i] = 0.0 79 if yi > ycentreup: z[i] = 0.0 80 if yi > ycentredown and yi < ycentreup: z[i] = harbour_depth 81 if xi > xcentre-harbour_length and xi < xcentre: z[i] = harbour_depth 82 80 83 return z 81 84
Note: See TracChangeset
for help on using the changeset viewer.