Changeset 2658 in lmdz_wrf


Ignore:
Timestamp:
Jul 3, 2019, 3:55:27 AM (5 years ago)
Author:
lfita
Message:

Managing better rotation of missing values

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/geometry_tools.py

    r2656 r2658  
    180180    rotvecs = np.zeros(vectors.shape, dtype=np.float)
    181181
     182    mavec = False
     183    if type(vectors) == type(gen.mamat):
     184        mavec = True
     185        vectors = ma.filled(vectors,gen.fillValueF)
     186
    182187    Nvecs = vectors.shape[0]
    183188    for iv in range(Nvecs):
    184189        rotvecs[iv,:] = rotate_2D(vectors[iv,:], angle)
     190
     191    if mavec:
     192        rotvecs = ma.masked_equal(rotvecs, gen.fillValueF)
    185193
    186194    return rotvecs
Note: See TracChangeset for help on using the changeset viewer.