Changeset 2626 in lmdz_wrf


Ignore:
Timestamp:
Jun 23, 2019, 8:04:17 PM (5 years ago)
Author:
lfita
Message:

generalizing `dist_points'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/geometry_tools.py

    r2625 r2626  
    279279
    280280    v = np.array(vec, dtype=np.float)
    281     mod = np.sqrt(v[0]*v[0] + v[1]*v[1])
     281    vv = v*v
     282    mod = np.sqrt(np.sum(vv[:]))
    282283
    283284    return mod
     
    15911592        intp = intp-1
    15921593
    1593         # There is a need to sort the cutting points from the perspective of the
    1594         #   below polygon
     1594        # Re-constructing below polygon looking for respective crossings
     1595        linti = list(inti)
     1596        for ip in range(iNpts):
     1597            Nc = linti.count(ip)
     1598            dists = np.zeros((Nc), dtype=np.float)
     1599            if Nc > 0:
     1600                iic = gen.multi_index_vec(inti,ip)
     1601                # Sortering from distance respect the vertex ip
     1602                for ic in range(Nc):
     1603                    dists[ic] = dist_points(ipoly[ip,:], pts[inti[ic],:])
     1604            else:
     1605                newipoly.append(ipoly[ip,:])
     1606
     1607
    15951608
    15961609        Npi=0
Note: See TracChangeset for help on using the changeset viewer.