Changeset 3483


Ignore:
Timestamp:
Aug 11, 2006, 12:55:08 PM (18 years ago)
Author:
ole
Message:

Fixed topography for harbour example.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentation/user_manual/examples/harbour.py

    r3275 r3483  
    6666def topography(x,y):
    6767    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.
    6971    ycentre = (south+north)/2.
    7072    ycentreup = ycentre+harbour_width/2.
    7173    ycentredown = ycentre-harbour_width/2.
    7274    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       
    8083    return z
    8184
Note: See TracChangeset for help on using the changeset viewer.