Skip to main content

Implementation of the Aurora model

Project description

Aurora logo

Aurora: A Foundation Model for the Earth System

CI Documentation Paper

Implementation of the Aurora model for Earth system forecasting.

The package currently includes the pretrained model and the fine-tuned version for high-resolution weather forecasting. We are working on the fine-tuned versions for air pollution and ocean wave forecasting, which will be included in due time.

Link to the paper on arXiv.

Please see the documentation for detailed instructions and more examples. You can also directly go to a full-fledged example that runs the model on ERA5.

Cite us as follows:

@misc{bodnar2024aurora,
    title = {Aurora: A Foundation Model for the Earth System},
    author = {Cristian Bodnar and Wessel P. Bruinsma and Ana Lucic and Megan Stanley and Anna Vaughan and Johannes Brandstetter and Patrick Garvan and Maik Riechert and Jonathan A. Weyn and Haiyu Dong and Jayesh K. Gupta and Kit Thambiratnam and Alexander T. Archibald and Chun-Chieh Wu and Elizabeth Heider and Max Welling and Richard E. Turner and Paris Perdikaris},
    year = {2024},
    url = {https://arxiv.org/abs/2405.13063},
    eprint = {2405.13063},
    archivePrefix = {arXiv},
    primaryClass = {physics.ao-ph},
}

Contents:

What is Aurora?

Aurora is a machine learning model that can predict atmospheric variables, such as temperature. It is a foundation model, which means that it was first generally trained on a lot of data, and then can be adapted to specialised atmospheric forecasting tasks with relatively little data. We provide four such specialised versions: one for medium-resolution weather prediction, one for high-resolution weather prediction, one for air pollution prediction, and one for ocean wave prediction.

Getting Started

Install with pip:

pip install microsoft-aurora

Or with conda / mamba:

mamba install microsoft-aurora -c conda-forge

Run the pretrained small model on random data:

from datetime import datetime

import torch

from aurora import AuroraSmall, Batch, Metadata

model = AuroraSmall()

model.load_checkpoint("microsoft/aurora", "aurora-0.25-small-pretrained.ckpt")

batch = Batch(
    surf_vars={k: torch.randn(1, 2, 17, 32) for k in ("2t", "10u", "10v", "msl")},
    static_vars={k: torch.randn(17, 32) for k in ("lsm", "z", "slt")},
    atmos_vars={k: torch.randn(1, 2, 4, 17, 32) for k in ("z", "u", "v", "t", "q")},
    metadata=Metadata(
        lat=torch.linspace(90, -90, 17),
        lon=torch.linspace(0, 360, 32 + 1)[:-1],
        time=(datetime(2020, 6, 1, 12, 0),),
        atmos_levels=(100, 250, 500, 850),
    ),
)

prediction = model.forward(batch)

print(prediction.surf_vars["2t"])

Note that this will incur a 500 MB download.

Please read the documentation for more detailed instructions and for which models are available.

Contributing

See CONTRIBUTING.md.

License

See LICENSE.txt.

Security

See SECURITY.md.

Responsible AI Transparency Documentation

An AI system includes not only the technology, but also the people who will use it, the people who will be affected by it, and the environment in which it is deployed. Creating a system that is fit for its intended purpose requires an understanding of how the technology works, its capabilities and limitations, and how to achieve the best performance. Microsoft has a broad effort to put our AI principles into practice. To find out more, see Responsible AI principles from Microsoft.

Use of this code

Our goal in publishing this code is (1) to facilitate reproducibility of our paper and (2) to support and accelerate further research into foundation model for atmospheric forecasting. This code has not been developed nor tested for non-academic purposes and hence should not be used as such.

Limitations

Although Aurora was trained to accurately predict future weather, air pollution, and ocean waves, Aurora is based on neural networks, which means that there are no strict guarantees that predictions will always be accurate. Altering the inputs, providing a sample that was not in the training set, or even providing a sample that was in the training set but is simply unlucky may result in arbitrarily poor predictions. In addition, even though Aurora was trained on a wide variety of data sets, it is possible that Aurora inherits biases present in any one of those data sets. A forecasting system like Aurora is only one piece of the puzzle in a weather prediction pipeline, and its outputs are not meant to be directly used by people or businesses to plan their operations. A series of additional verification tests are needed before it can become operationally useful.

Data

The models included in the code have been trained on a variety of publicly available data. A description of all data, including download links, can be found in Supplementary C of the paper. The checkpoints include data from ERA5, CMCC, IFS-HR, HRES T0, GFS T0 analysis, and GFS forecasts.

Evaluations

All versions of Aurora were extensively evaluated by evaluating predictions on data not seen during training. These evaluations not only compare measures of accuracy, such as the root mean square error and anomaly correlation coefficient, but also look at the behaviour in extreme situations, like extreme heat and cold, and rare events, like Storm Ciarán in 2023. These evaluations are the main topic of the paper.

Note: The documentation included in this file is for informational purposes only and is not intended to supersede the applicable license terms.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

FAQ

How do I setup the repo for local development?

First, install the repository in editable mode and setup pre-commit:

make install

To run the tests and print coverage, run

make test

You can then explore the coverage in the browser by opening htmlcov/index.html.

To locally build the documentation, run

make docs

To locally view the documentation, open docs/_build/index.html in your browser.

Why are the fine-tuned versions of Aurora for air quality and ocean wave forecasting missing?

The package currently includes the pretrained model and the fine-tuned version for high-resolution weather forecasting. We are working on the fine-tuned versions for air pollution and ocean wave forecasting, which will be included in due time.

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

microsoft_aurora-1.4.1.tar.gz (178.7 kB view details)

Uploaded Source

Built Distribution

microsoft_aurora-1.4.1-py3-none-any.whl (187.1 kB view details)

Uploaded Python 3

File details

Details for the file microsoft_aurora-1.4.1.tar.gz.

File metadata

  • Download URL: microsoft_aurora-1.4.1.tar.gz
  • Upload date:
  • Size: 178.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for microsoft_aurora-1.4.1.tar.gz
Algorithm Hash digest
SHA256 cb6f16ee7f20b5b4b9c5c1835f722d875e9fb9c8e24ff83cd25a8e09fb2ccd67
MD5 b3c9c814b50b8206ac0f26797b5101b0
BLAKE2b-256 9961ba1afb4fd7aa49fd0070463b58ed18b34414a6fa93951ccd0e5464f5f7ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for microsoft_aurora-1.4.1.tar.gz:

Publisher: publish.yaml on microsoft/aurora

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file microsoft_aurora-1.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for microsoft_aurora-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dbe5d112dade7e7c504dc349db14d2f9901f9727fae29467de2e0a58f645a80b
MD5 97df73ef1131b2f916f3787361935c1e
BLAKE2b-256 ec963af1013d72655c0a99f74c5ee7d4d9e5ab3cd6d57cd9f27baf232df45a99

See more details on using hashes here.

Provenance

The following attestation bundles were made for microsoft_aurora-1.4.1-py3-none-any.whl:

Publisher: publish.yaml on microsoft/aurora

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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