-
Notifications
You must be signed in to change notification settings - Fork 16
Downscaling
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.
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'][:]
ivalues = input.variables['air_temperature_2m'][0, :, :]
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)