Changeset 2602 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jun 12, 2019, 8:50:50 PM (6 years ago)
Author:
lfita
Message:

Adding coincidence on 'point_georef' in '4invdist'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/generic_tools.py

    r2601 r2602  
    1681316813
    1681416814        distsum = np.sum(dists)
    16815         wghts = dists/distsum
    16816 
    16817         distsum = np.sum(1./dists)
    16818         wghts = 1./dists/distsum
     16815        if np.all(dists >= 1.e-6):
     16816            wghts = dists/distsum
     16817
     16818            distsum = np.sum(1./dists)
     16819            wghts = 1./dists/distsum
     16820        else:
     16821            wghts = np.zeros((4), dtype=np.float)
     16822            mindist = np.min(dists)
     16823            for iv in range(4):
     16824                if dists[iv] == mindist:
     16825                    wghts[iv] = 1.
     16826                    break
    1681916827
    1682016828        plon = np.sum(lons*wghts)
Note: See TracChangeset for help on using the changeset viewer.