WIP - this is not yet ready to be used for anything.
This contains the neccessary components to run the bris model in anemoi inference and Forecast-in-a-Box. It consists of several parts:
- Plugins for anemoi-inference
- A tool to adapt a checkpoint so it can run in anemoi-inference
- Later, docs for how to add this to Forecast-in-a-Box will be added
In order to get started, you need access to a bris checkpoint, such as Cloudy Skies.
uv syncuv run main.pyThis works around bugs related to running on a mac, at the cost of a little flexibility.
uv run anemoi-inference run config.yamlIn order to run, you need a bris checkpoint, and a geotiff file containing orograpghy data for your target area.
The original bris checkpoint needs a little manual massaging before it can run with anemoi inference:
uv run anemoi-inference metadata --edit bris-checkpoint.ckpt --editor vimFind dataset.variables_metadata, and replace with this yaml.
Note that there are lots of keys called variables_metadata around the document.
Make sure to change the correct one.
Note This will change (not copy) your checkpoint file.
You need to modify your checkpoint's graph in order to run for a specific area. For this to work, you need to have a file with orography data for that area.
One way to get orography data is by adapting data from opentopography. Make sure you download for your exact area.
To help with downloading the orography use:
uv run download_orography.py --area-latlon -8 30 -22 43 --dest-path <hires_topography.tif>For this to work you need an api-key to access the rest api on opentopography
To create an account on opentopography.org go to https://portal.opentopography.org/login. You will find the API key by pressing menu item MyOpenTopo. Save the key in $HOME/..opentopographyrc. This is a json file with format:
{
"api_key": "THE API KEY"
}After having downloaded data from there, you can run a command like this to generate an orography file with the resolution:
gdalwarp -tr 0.05 0.05 -r average <hires_topography.tif> orography.tifRun the following command to generate a new checkpoint:
uv run update_checkpoint.py \
--topography-file orography.tif \
--original-checkpoint bris-checkpoint.ckpt \
--create-checkpoint new-checkpoint.ckpt