-
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 objects that describe the metadata of the gridpoints. The Grid
object defines this and can be initialized with 2D arrays of latitude and longitudes:
grid = gridpp.Grid(lats, lons)
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.
import gridpp
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. Gridpp supports several ways to do this. The constant lapse rate method prescribes a fixed elevation gradient that is used across the whole field. A more advanced approach is to let gridpp compute a local elevation gradient by looking in a neighbourhood surounding a given gridpoint.
Temperature (and possibly other variables) can in many cases be strongly affected by the presence of land and ocean.
In v0.3.0, a combined coastal and elevation gradient approach is implemented. The method first computes an elevation gradient based on land points only, and then computes a land-sea gradient after correcting points in a neighbourhood with the elevation gradient.
The two gradients are then added.
Currently, only a fixed elevation gradient is supported in the library:
import gridpp
ovalues = gridpp.simple_gradient(igrid, ogrid, temp_analysis[:, :, 0], -0.0065)