...
Code Block | ||
---|---|---|
| ||
fields = precip[1,4] |
So the following piece of code will do what we want:
Code Block | ||
---|---|---|
| ||
precip = read("precip.grib")
n = count(precip)
precip_3h = precip[2, n] - precip[1, n-1]
return precip_3h |
Visualise the macro. Your plot may be blank! There is one more trick: we have created a derived field, and this changes the scaling algorithm. Precipitation is stored in metres, but we want to display it in mm. Modify the precip_shade icon and set:
Grib Scaling of Derived Fields | On |
Visualise you macro result again and confirm that you now have precipitation only for the 3-hour periods, which does not accumulate with each frame.