Skip to content
Thomas Nipen edited this page Apr 7, 2020 · 26 revisions

The downscaling component of gridpp interpolates data on one grid to another (usually higher-resolution) grid.

If no downscaler is selected, a nearest neighbour approach is used. Also, if the input grid is equal to the output grid, then no downscaling is needed.

Python

Run the following code to create variables that are needed by the downscaling methods.

import gridpp
import netCDF4

with netCDF4('input.nc', 'r) as input:
    ilats = input.variables['latitude'][:]
    ilons = input.variables['longitude'][:]
with netCDF4('output.nc', 'r) as output:
    olats = output.variables['latitude'][:]
    olons = output.variables['longitude'][:]

igrid = gridpp.Grid(ilats, ilons)
ogrid = gridpp.Grid(olats, olons)
Clone this wiki locally