|
| 1 | +# (C) British Crown Copyright 2017, Met Office |
| 2 | +# |
| 3 | +# This file is part of Iris. |
| 4 | +# |
| 5 | +# Iris is free software: you can redistribute it and/or modify it under |
| 6 | +# the terms of the GNU Lesser General Public License as published by the |
| 7 | +# Free Software Foundation, either version 3 of the License, or |
| 8 | +# (at your option) any later version. |
| 9 | +# |
| 10 | +# Iris is distributed in the hope that it will be useful, |
| 11 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +# GNU Lesser General Public License for more details. |
| 14 | +# |
| 15 | +# You should have received a copy of the GNU Lesser General Public License |
| 16 | +# along with Iris. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + |
| 18 | +from __future__ import (absolute_import, division, print_function) |
| 19 | +from six.moves import (filter, input, map, range, zip) # noqa |
| 20 | +import six |
| 21 | + |
| 22 | +import itertools |
| 23 | + |
| 24 | + |
| 25 | +# LBPROC codes and their English equivalents |
| 26 | +LBPROC_PAIRS = ((1, "Difference from another experiment"), |
| 27 | + (2, "Difference from zonal (or other spatial) mean"), |
| 28 | + (4, "Difference from time mean"), |
| 29 | + (8, "X-derivative (d/dx)"), |
| 30 | + (16, "Y-derivative (d/dy)"), |
| 31 | + (32, "Time derivative (d/dt)"), |
| 32 | + (64, "Zonal mean field"), |
| 33 | + (128, "Time mean field"), |
| 34 | + (256, "Product of two fields"), |
| 35 | + (512, "Square root of a field"), |
| 36 | + (1024, "Difference between fields at levels BLEV and BRLEV"), |
| 37 | + (2048, "Mean over layer between levels BLEV and BRLEV"), |
| 38 | + (4096, "Minimum value of field during time period"), |
| 39 | + (8192, "Maximum value of field during time period"), |
| 40 | + (16384, "Magnitude of a vector, not specifically wind speed"), |
| 41 | + (32768, "Log10 of a field"), |
| 42 | + (65536, "Variance of a field"), |
| 43 | + (131072, "Mean over an ensemble of parallel runs")) |
| 44 | + |
| 45 | +# lbproc_map is dict mapping lbproc->English and English->lbproc |
| 46 | +# essentially a one to one mapping |
| 47 | +LBPROC_MAP = {x: y for x, y in |
| 48 | + itertools.chain(LBPROC_PAIRS, ((y, x) for x, y in LBPROC_PAIRS))} |
0 commit comments