diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..506efc0794b5ebc7b118a4446262d29b21415f4e --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# Generate HEALPix weights to use with CDO + +## Generation of high-res nearest-neighbor weights + +As a starting point for our hierarchy of weights, we compute the nearest neighbour weights to a very fine-scale HEALPix grid, i.e. zoom level 13 or 600m. + +This can be done by running the `gen_weights.sh` script. +The script is a convenient wrapper around `cdo` that handles atmosphere and ocean grids properly. +The source grid can be defined by setting various grid-related variables in the script itself. + + +```sh +./gen_weights.sh +``` + +## Coarsening the computed weights + +The hierarchical construction of the HEALPix grids allows a coarser version of a grid to be computed by taking the average of four contiguous values in its parent grid. +This can be used to coarsen existing remapping weights to any other HEALPix zoom level. +Internally, the individual remapping weights are grouped by source and (new) destination addresses and combined where possible. +This allows us to compute a conservative but lightweight mapping from our source grid to an arbitrary HEALPix grid. + +```sh +./coarsen_weights.py --nbisections 7 weights_r02b08_hpz13.nc weights_r02b08_hpz6.nc +```