Skip to main content

Running the bris model in Forecast-in-a-Box and anemoi-inference

Project description

Bris in Forecast-in-a-Box

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

Getting started

In order to get started, you need access to a bris checkpoint, such as Cloudy Skies.

Setting up

uv sync

Running inference

uv run main.py

This works around bugs related to running on a mac, at the cost of a little flexibility.

In the future

uv run anemoi-inference run config.yaml

Checkpoint

In order to run, you need a bris checkpoint, and optionally a geotiff file containing orograpghy data for your target area.

Preparing

The variable definition in the metadata for the original bris checkpoint needs to be update to run on anemoi-inference. Updateing the checkpoint owerwrite the checkpoint so it's a good idea to make a copy of the original checkpoint before running the update command.

ex.

cp cloudy-skies.ckpt  anemoi-cloudy-skies.ckpt
uv run update_metadata.py --checkpoint anemoi-cloudy-skies.ckpt

update_metadata.py find the variable dataset.variables_metadata, and replace with this yaml.

Setting area

You need to modify your checkpoint's graph in order to run for a specific area.

Getting detailed orography information

If you want to do adiabatic correction of the forecast data, you need to add real elevation information to the checkpoint. One way to get that is by adapting data from opentopography.

Note At the moment, you need to download data for an area that is larger than your target area!

To help with downloading the orography you can use this:

uv run download_orography.py --area-latlon -7 29 -23 44 --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"
}

The downloaded high-resolution topography can then be used as input when updating the checkpoint.

Updating checkpoint

Run the following command to generate a new checkpoint:

uv run update_checkpoint.py \
    --area-latlon -8 30 -22 43 0.025 \
    --topography-file hires_topography.tif \
    --original-checkpoint bris-checkpoint.ckpt \
    --create-checkpoint new-checkpoint.ckpt

You can skip the --topography-file option if you will not do orographic corrections of the data.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bris_fiab-0.1.0.tar.gz (156.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bris_fiab-0.1.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file bris_fiab-0.1.0.tar.gz.

File metadata

  • Download URL: bris_fiab-0.1.0.tar.gz
  • Upload date:
  • Size: 156.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for bris_fiab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f639c60ee00bf950631c232548484e2153e164b654a2001e3a09b7ad714aea9f
MD5 57ac14438307284a8207c97b1d6ec5db
BLAKE2b-256 41e4bd99f3ebbd184c1cc52d44a5593c75022755007a6a8a4561b967c0add612

See more details on using hashes here.

File details

Details for the file bris_fiab-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bris_fiab-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for bris_fiab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e12007eb8cb8a041021edfb0e38b4fc79d5dd20dc0f2ab3e2c575295f0d4798
MD5 6ab22016d4ce36a994d7c65b999f0c4a
BLAKE2b-256 2b06b352eaec8d37f32d3c1e16faa228fdef9b14dc45e5f30b1bce08072c5c01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page