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.1.tar.gz (167.0 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.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bris_fiab-0.1.1.tar.gz
  • Upload date:
  • Size: 167.0 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.1.tar.gz
Algorithm Hash digest
SHA256 b053a27ee60d6bbdf9cee7c791f5ae5a013f90a90dfd1b0ddc815e069a83cb51
MD5 2df6ae8699707477deb58c0f12be8331
BLAKE2b-256 abe297c06acb5cb252894076e54ff565aced7067d5f3fba2137af1c052538c8d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bris_fiab-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dbc68acb6d348e563a0b976457e300da7f41699c9b5776f8337667cf3fd27078
MD5 2bfe62b8c02edc414f2acf042247fd4a
BLAKE2b-256 37e7a024b87860574920ebd300240c708c430eb4935d461e22b55b48e7a9a657

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