Changeset 2437 in lmdz_wrf


Ignore:
Timestamp:
Apr 14, 2019, 10:40:55 PM (6 years ago)
Author:
lfita
Message:

Adding:

  • maximum absolute value (x/y) for `max_coords_poly'

Changing:

  • Shape of the sailing boat
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/geometry_tools.py

    r2436 r2437  
    228228    >>> square[3,:] = [-0.5,0.5]
    229229    >>> max_coords_poly(square)
    230     [-0.5, 0.5], [-0.5, 0.5], [0.5, 0.5]
     230    [-0.5, 0.5], [-0.5, 0.5], [0.5, 0.5], 0.5
    231231    """
    232232    fname = 'max_coords_poly'
    233233
     234    # x-coordinate min/max
    234235    nx = np.min(polygon[:,1])
    235236    xx = np.max(polygon[:,1])
     237
     238    # y-coordinate min/max
    236239    ny = np.min(polygon[:,0])
    237240    xy = np.max(polygon[:,0])
    238241
     242    # x/y-coordinate maximum of absolute values
    239243    axx = np.max(np.abs(polygon[:,1]))
    240244    ayx = np.max(np.abs(polygon[:,0]))
    241245
    242     return [nx, xx], [ny, xy], [ayx, axx]
     246    # absolute maximum
     247    xyx = np.max([axx, ayx])
     248
     249    return [nx, xx], [ny, xy], [ayx, axx], xyx
    243250
    244251####### ###### ##### #### ### ## #
     
    376383
    377384# FROM: http://www.photographers1.com/Sailing/NauticalTerms&Nomenclature.html
    378 def zsailing_boat(length=10., beam=1., lbeam=0.5, sternbp=0.5):
     385def zsailing_boat(length=10., beam=1., lbeam=0.4, sternbp=0.5):
    379386    """ Function to define an schematic boat from the z-plane
    380387      length: length of the boat (without stern, default 10)
    381388      beam: beam of the boat (default 1)
    382       lbeam: length at beam (as percentage of length, default 0.5)
     389      lbeam: length at beam (as percentage of length, default 0.4)
    383390      sternbp: beam at stern (as percentage of beam, default 0.5)
    384391    """
Note: See TracChangeset for help on using the changeset viewer.