Summary:

Author: Utkarsh Mital, umital@lbl.gov

Note: Since PRISM data at 800 m resolution is a proprietary dataset which cannot be publicly distributed, we provide a downscaled data file (DOWNSCALED_PRISM_PPT_20191205.tif) which is upscaled to the 800 m resolution. We then downscale this newly generated upscaled file to 400 m resolution.

Package imports

Package versions

The script was tested using the following package versions.

Some helpful functions

Specify file paths

Upscale sample_PRISM_400_file to generate a PRISM_800 file

Read in data needed for calculating nearest neighbors ($w_1$ to $w_{10}$)

Static Input Features for training: Elevation and coordinates

Static Input Features for downscaling: Elevation and coordinates

Gradient smoothing parameters (for precipitation only; skip for temperature)

This follows the description in Daly et al. (2008)

Get the complete feature space and labels for training

Train the random forest (RF) model

Get downscaling features and predict the downscaled precipitation

Gradient smoothing of downscaled precipitation (skip for temperature)

Visualize the downscaled data