Shaving: cut values over a threshold down to this thresholdΒΆ

(resp. below a threshold up to)

[1]:
%matplotlib inline
# for figures in notebook

# import & initialize epygram
import epygram
epygram.init_env()

import os
INPUTS_DIR = os.path.join('..', 'inputs')
[2]:
r = epygram.formats.resource(os.path.join(INPUTS_DIR, 'ICMSHAROM+0022'), 'r')
f = r.readfield('SURFACCPLUIE')
[3]:
fig, ax = f.cartoplot(subzone='CI', colormap='rr1h')
../../_images/gallery_C-data_07.shave_3_0.png
[4]:
# shave at 5mm threshold: all values above are set to 5.
f.shave(maxval=5.)
fig, ax = f.cartoplot(subzone='CI', colormap='rr1h')
../../_images/gallery_C-data_07.shave_4_0.png
[ ]: