Changeset 2713 in lmdz_wrf


Ignore:
Timestamp:
Sep 27, 2019, 5:05:48 PM (6 years ago)
Author:
lfita
Message:

Adding topographycal topographyc fixed values are color bar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing_tools.py

    r2710 r2713  
    135135linewidthsauto = [1.]
    136136pointsizesauto = [7.]
     137
     138
     139# Getting colormap for fixed topobnds
     140fixtopobnds=[-140., 0., 100., 200., 300., 400., 500., 600., 700., 800., 900., 1000., \
     141  1500., 2000., 3000., 4000., 7000.]
     142RGBfixtopocolors = [[119,152,93], [149,181,112], [189,209,137], [233,238,154],       \
     143  [248,242,168], [251,231,163], [252,225,144], [248,213,133], [251,189,141],         \
     144  [231,175,139], [202,149,132], [206,156,149], [228,182,192], [250,214,231],         \
     145  [224,224,224], [255,255,255], [255,255,255]]
     146
     147# Topography
     148fixtopobndsS = []
     149for t in fixtopobnds: fixtopobndsS.append(str(t))
     150
     151HEXfixtopocolors = []
     152Nfixtopocolors = len(RGBfixtopocolors)
     153for ic in range(Nfixtopocolors):
     154    rgbv = np.array(RGBfixtopocolors[ic], dtype=np.float)/255.
     155    rgbv = np.where(rgbv > 0.1, rgbv - 0.1, 0.)
     156    if np.all(rgbv == 0.9): rgbv = rgbv/0.9
     157
     158    hexcol = gen.coldec_hex(rgbv)
     159    HEXfixtopocolors.append(hexcol)
     160
     161fixtopocmap = mpl.colors.ListedColormap(HEXfixtopocolors)
     162fixtoponormc = mpl.colors.BoundaryNorm(fixtopobnds, fixtopocmap.N)
    137163
    138164####### Functions
Note: See TracChangeset for help on using the changeset viewer.