Closed stevehadd closed 2 years ago
possibly use IMPROVER threshold variables. @arh89 to supply thresholds.
Here are the improver thresholds, taken from https://github.com/metoppv/improver/blob/master/improver/cli/threshold.py
improver_thresholds = {
"0.0": [0.0, 0.0],
"0.03": [0.027, 0.033],
"0.09": [0.081, 0.099],
"0.1": [0.09, 0.11],
"0.25": [0.225, 0.275],
"0.3": [0.27, 0.33],
"0.5": [0.45, 0.55],
"1.0": [0.9, 1.1],
"2.0": [1.8, 2.2],
"3.0": [2.7, 3.3],
"4.0": [3.6, 4.4],
"8.0": [7.2, 8.8],
"12.0": [10.8, 13.2],
"16.0": [14.4, 17.6],
"20.0": [18.0, 22.0],
"25.0": [22.5, 27.5],
"30.0": [27.0, 33.0],
"40.0": [36.0, 44.0],
"50.0": [45.0, 55.0],
"75.0": [67.5, 82.5],
"100.0": [90.0, 110.0],
"150.0": [135.0, 165.0],
"200.0": [180.0, 220.0]
}
Looking at how to do this in iris today, there doesn't seem to be an easy way to do this. Proposed steps (which I'm writing here to remind myself) are:
rain_bands_cube = iris.cube.copy.deepcopy(radar_agg)
rain_bands_cube.add_dim_coord( iris.coords.DimCoord( points=[float(v1) for v1 in improver_thresholds.keys()], bounds=list(improver_thresholds.values())))
((radar_agg.data.data > improver_thresholds['1.0'][0]) & (radar_agg.data.data < improver_thresholds['1.0'][1]))[10,:,:]
, and assigning each one to the relevant spot along the rainband dimension((radar_agg.data.data > improver_thresholds['1.0'][0]) & (radar_agg.data.data < improver_thresholds['1.0'][1]))[10,:,:].sum()
@stevehadd I wonder if it might be possible to use some of the IMPROVER code to do this?
e.g: Could use the improver threshold code and then maybe some of the neighbourhood processing code might do what you want?
(There are a lot of options there, so there might be something that does what you want)
The improver levels have proved to be a bit difficult to work with, so we're going to instead have a go with fewer rain bands. We're going to use level suggested by Steve Ramsdale from the Forecasters hand book.
instantaneous and 3hr accumulation, then spatially aggregated. by taking fraction greater than various thresholds.