This icon takes data from a GRIB source and performs a variety of operations on it, including spectral to grid conversion, regridding using a large variety of powerful and flexible interpolation techniques, nabla operators and special consideration of wind fields.
This module is designed with re-use in mind. The first time a particular interpolation is performed, it might take some time to compute, but it will create cache files that can be re-used, meaning that the same interpolation will be much faster on subsequent runs.
The macro/python language equivalent is regrid()
. The listed parameters can all be supplied as named parameters with the spaces replaced by underscores, e.g. nearest_method='sorted_sample'.
The Regrid Editor
Data input parameters
Input data may be specified either by giving a path in the Source parameter or by giving a GRIB-based data object in the Data parameter. Note that you should specify either Source or Data, not both.
Source
Specifies the GRIB file path.
Data
Drop a MARS Retrieval or a GRIB file icon inside this icon field. In Python or Macro, supply a Fieldset object.
Output grid definition parameters
Grid Definition Mode
Select a method for specifying the output grid.
- Grid: supply a valid string or list of numbers in the Grid parameter (see below)
- Template: supply a template GRIB file, whose grid structure will be used to generate the output GRIB; use either Template Source or Template Data to specify the template. Note that only GRIB fields on regular lat/lon or regular/reduced Gaussian grids may currently be used as templates.
- Lambert Conformal: supply details of the output grid in the set of Lambert grid definition parameters
- Lambert Azimuthal Equal Area: supply details of the output grid in the set of Lambert grid definition parameters
- Filter: in this mode, the output grid will be the same as the input grid
Template Source
If Grid Definition Mode is set to Template, supply the path to a template GRIB file; the output GRIB will use the same grid as the template.
Template Data
If Grid Definition Mode is set to Template, supply a GRIB-based data object in the Data parameter; the output GRIB will use the same grid as the template.
Grid
Supply a grid definition as described here: grid - keyword in MARS/Dissemination request.
Examples of valid grid definitions:
GUI | Python / Macro | Result |
---|---|---|
1/1 | [1, 1] | A regular lat/lon grid with 1x1 degree point spacing |
0.25/0.25 | [0.25, 0.25] | A regular lat/lon grid with 0.25x0.25 degree point spacing |
O1280 | "O1280" | An octahedral reduced Gaussian grid, octahedral with 1280 latitude lines between the pole and equator |
N640 | "N640" | An 'original' reduced Gaussian grid, with 640 latitude lines between the pole and equator |
F400 | "F400" | A regular Gaussian grid, with 400 latitude lines between the pole and equator |
Area
Specifies the geographical area that the output fields will cover, the default being for the whole globe. Enter lat/lon bounds of an area separated by a "/" (North/West/South/East), or in Macro or Python provide a list, e.g. [south, west, north, east]; alternatively, use the assist button to define the area graphically.
For example, this set of parameters generates the following output data:
t01 = mv.regrid( grid = [0.1,0.1], area = [31,-17,64,38], data = t_2m ) mv.plot(t01) |
Rotation
Needs to be checked!
Rotation is specified by selecting a new coordinate for the South pole. In Python or Macro, enter [lat, lon]
; in the GUI, enter lat/lon
or use the coordinate assist button to graphically select the point.
Output Lambert grid definition parameters
These parameters are available if Grid Definition Mode is set to Lambert Conformal or Lambert Azimuthal Equal Area. The names follow the naming convention in the descriptions of these projections here:
- Lambert Conformal - https://apps.ecmwf.int/codes/grib/format/grib2/templates/3/30
- Lambert Azimuthal Equal Area - https://apps.ecmwf.int/codes/grib/format/grib2/templates/3/140
Most of these parameters are required and do not have default values, meaning that they must be filled in.
The parameters are: First Point, Dx In Metres, Dy In Metres, Lad In Degrees, Lov In Degrees, Standard Parallel In Degrees, Central Longitude In Degrees, Latin 1 In Degrees, Latin 2 In Degrees, Nx, Ny.
Here are examples of generating Lambert grids.
regrid_lambert_conformal = mv.regrid( grid_definition_mode = "lambert_conformal", first_point = [50.88,-1.66], dx_in_metres = 2500, dy_in_metres = 2500, nx = 739, ny = 949, lad_in_degrees = 63, lov_in_degrees = 15, data = t_2d_rgg ) |
regrid_lambert_azimuthal = mv.regrid( grid_definition_mode = "lambert_azimuthal_equal_area", first_point = [50.88,-1.66], dx_in_metres = 2500, dy_in_metres = 2500, nx = 739, ny = 949, standard_parallel_in_degrees = 0, central_longitude_in_degrees = 0, data = t_2m_rgg ) |
Spectral to grid definition parameters
If the input files are spectral, the following parameters are used to fine-tune the conversion to grid points.
Truncation
Describes how to treat the incoming spherical harmonics before the transformation to grid points. For more details, see truncation - keyword in MARS/Dissemination request. Possible values are Automatic, None or a number describing the spectral truncation to be applied.
Intgrid
Describes the intermediate grid to which the transform is performed. For more details, see intgrid - keyword in MARS/Dissemination request. Possible values are Automatic , None , Source or the name of the desired intermediate grid.
Extra processing parameters
Frame
Specifies the width of a frame within a given sub-area. The width of the frame is specified as an integer number of grid points inwards from a given area. See also frame - keyword in MARS/Dissemination request.
The following plots show a sub-area with Frame=10.
Wind Processing
Activates processing that is particular to wind fields. Possible options are:
- UV To UV: assumes that the input files come in pairs of U/V. This option is required if regridding wind fields on/to a rotated grid.
- VOD To UV: converts pairs of vorticity and divergence fields into U/V fields. Assumes that the input files come in pairs of vorticity and divergence. The resulting values will be scaled by the cosine of their latitudes.
- Off: no special processing is performed
By default, this module will assume there are no wind fields in the input, and it will not automatically scan for pairs of U/V fields - it is up to the user to know that their input consists of wind fields and to use this setting in order to perform the correct processing.
Nabla
Activates a nabla (differential) operator processing on the fields. Possible functions are:
- Scalar Gradient: QQQ
- Scalar Laplacian: QQQ
- UV Divergence: QQQ
- UV Gradient: QQQ
- UV Vorticity: QQQ
- Off: do not perform any nabla operation
Nabla Poles Missing Values
QQQ. Possible values are On and Off.
Interpolation methods and parameters
Interpolation
Specifies the type of interpolation to be used on the fields. The default is Automatic, which selects either Linear or Nearest Neighbour based on an internal table of known parameters. If the parameter is unknown, the default will be Linear. The possible interpolation methods are:
- Linear: QQQ
- Bilinear: QQQ
- Grid Box Average: QQQ
- Grid Box Maximum: QQQ
- K Nearest Neighbours: QQQ
- Nearest LSM: QQQ
- Nearest Neighbour: QQQ
- Structured Bicubic: QQQ Note that this method does not cache its transformation matrices, and therefore will not benefit from speedups on subsequent runs.
- Structured Bilinear: QQQ Note that this method does not cache its transformation matrices, and therefore will not benefit from speedups on subsequent runs.
- Structured Biquasicubic: QQQ Note that this method does not cache its transformation matrices, and therefore will not benefit from speedups on subsequent runs.
- Automatic: see description above.
Nearest Method
Available for any of the 'nearest' interpolation methods. Possible values are:
- Distance: QQQ
- Distance and nclosest: QQQ
- Distance or nclosest: QQQ
- Nclosest: QQQ
- Nclosest or nearest: QQQ
- Nearest neighbour with lowest index: QQQ
- Sample: QQQ
- Sorted sample: QQQ
Distance Weighting
Only available if Interpolation is K Nearest Neighbours. QQQ (description)
Possible values are:
- Climate Filter: QQQ
- Gaussian: QQQ
- Inverse Distance Weighting: QQQ
- Inverse Distance Weighting Squared: QQQ
- Nearest Neighbour: QQQ
- No: QQQ
- Shepard: QQQ
- Off: QQQ
Nclosest
Only available if Interpolation is K Nearest Neighbours and Distance Weighting is one of the 'NClosest' methods. This parameter specifies the number of closest points to be considered. Default=4.
Distance
Only available if Interpolation is K Nearest Neighbours. QQQ
Distance Weighting Gaussian Stddev
Only available if Interpolation is K Nearest Neighbours. QQQ
Distance Weighting Shepard Power
Only available if Interpolation is K Nearest Neighbours. QQQ
Distance Tolerance
Only available if Interpolation is K Nearest Neighbours. QQQ
Conservative Finite Element Method Input
Only available if Interpolation is Conservative Finite Element. QQQ
Conservative Finite Element Method Output
Only available if Interpolation is Conservative Finite Element. QQQ
Non Linear
QQQ. Possible values are:
- Missing If All Missing: QQQ
- Missing If Any Missing: QQQ
- Missing If Heaviest Missing: QQQ
- Simulated Missing Value: QQQ
- Heaviest: QQQ
- No: QQQ
Simulated Missing Value
Only available if Non Linear is Simulated Missing Value. QQQ (description)
Simulated Missing Value Epsilon
Only available if Non Linear is Simulated Missing Value. QQQ (description)
Land-sea mask parameters
Distance Weighting With LSM
Only available if Interpolation is Nearest LSM. Possible values are On and Off.
LSM Weight Adjustment
Only available if Distance Weighting With Lsm is not Off. QQQ.
LSM Interpolation Input
QQQ.
LSM
Selection Input
Specifies whether the input LSM file will come from LSM Named Input (Named) or LSM File Input (File).
LSM Named Input
Provide one a of a set of predefined names of LSM inputs from the following list:
- 1km
- 10min
- O1280
- O640
- O320
- N320
- N256
- N128
LSM File Input
Provide the path to an LSM GRIB file.
LSM Value Threshold Input
QQQ.
LSM Interpolation Output
QQQ
LSM Selection Output
Specifies whether the input LSM file will come from LSM Named Output (Named) or LSM File Output (File).
LSM Named Output
Provide one a of a set of predefined names of LSM outputs from the following list:
- 1km
- 10min
- O1280
- O640
- O320
- N320
- N256
- N128
LSM File Output
Provide the path to an LSM GRIB file.
LSM Value Threshold Output
QQQ.
Output GRIB parameters
Accuracy
Provide the desired number of bits per value for the output fields. If left empty, this will take the value from the input fields. This option can also be used to simply change the number of bits per value in a Fieldset if no other processing options are given. Note that if Packing is set to ieee, then the only valid values for this parameter are 32 and 64.
Packing
Specifies the GRIB packing method for the output values. Possible values are:
- archived_value
- complex
- jpeg
- second_order
- simple
- ieee
- As Input
Edition
Specifies the edition of GRIB format for the output files. Possible values are:
- 1
- 2
- As Input