Skip to content
Snippets Groups Projects
Verified Commit 2732818e authored by Lukas Kluft's avatar Lukas Kluft
Browse files

Add readme

parent 05a050a7
No related branches found
No related tags found
No related merge requests found
# 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
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment