-
Notifications
You must be signed in to change notification settings - Fork 16
Downscaling
The downscaling methods in gridpp interpolates data on one grid to another (usually higher resolution) grid.
Downscaling methods require Grid
objects that describe the metadata of the gridpoints.
This downscaler uses the closest neighbour for each point in the fine grid. The approach will give box like fields if the output field is much higher resolution than the input field. The advantage of the method is that if the values in the input field are physically realistic, then the values in the output field are also realistic.
ovalues = gridpp.nearest(igrid, ogrid, temp_analysis[:, :, 0])
Uses the four nearest neighbours and interpolates bilinearly between those.
ovalues = gridpp.bilinear(igrid, ogrid, temp_analysis[:, :, 0])
Some meteorological variables, such as temperature, change predictably with elevation. When a high resolution topography is available, coarse resolution models can be downscaled by fitting the variable to the new topography. A simple method for downscaling is to use a constant elevation gradient:
gradient = -0.0065 # C/m
ovalues = gridpp.simple_gradient(igrid, ogrid, temp_analysis[:, :, 0], gradient)
Griddpp also supports downscaling using an elevation gradient that varies from gridpoint to gridpoint. An elevation gradient can be computed by looking at how temepature varies with elevation in a neighbourhood surrounding a given point. You can use the calc_gradient
function to compute the local gradient:
gradient_type = gridpp.LinearRegression
half_width = 5
min_num = 10
min_range = 100 # m
default_gradient = -0.0065 # C/m
gradient = gridpp.calc_gradient(igrid.get_elevs(), temp_analysis[:, :, 0],
gradient_type, half_width, min_num, min_range,
default_gradient)
This creates a vertical gradient for each gridpoint. This can then be applied to the downscaled grid:
ovalues = gridpp.full_gradient(igrid, ogrid, temp_analysis[:, :, 0], gradient)
The full_gradient
function also supports downscaling using gradients with respect to the land_area_fraction.