Skip to main content

DOI

SURF - Space Weather Utilities for Research and Forecasting

Introduction

This repository provides an implementation of the SURF modelling framework.

This includes the HUXt model (Heliospheric Upwind Extrapolation with time dependence) in Python, as described by Owens et al. (2020). This is a simple 1D reduced hydrodynamic model, which essentially solves Burgers equation using the upwind numerical scheme. For more details on the models background, refer to Owens et al. (2020).

Installation

SURF is written in Python 3.12.11 and has a range of dependencies, which are listed in the environment.yml file.

This simplest way to work with SURF is to use conda, and we recommend using an up-to-date version of miniforge.

SURF can be installed via conda-forge. We recommend installing HUXt into a virtual environment and this can be done as:

>>> conda create --name surf surfs-up
>>> conda activate surf

Development Installation

If you are developing features in SURF, it can be easier to work with an editable installation. To do this, it is easiest to clone this repository, and with the anaconda prompt in the HUXt root directory:

>>> conda env create -f environment.yml
>>> conda activate surf
>>> pip install --no-deps -e .

Numba cache mode

SURF enables Numba's on-disk compilation cache by default, as in general it makes simulations faster. However, for model development work it can be useful to disable this. To disable it for development work, change line 2515 of surf/surf.py:

numba_cache = True

Set it back to True for general use.

Installation also provides the surf-open-examples and surf-make-ephemeris command-line tools.

SURFs_UP web interface

SURFs_UP is included as the surfs_up package. Start its local web interface with either command:

surfs-up

Then open http://127.0.0.1:5000, if it does not open automatically. The local launcher runs the background job worker in the same process. For a WSGI deployment, run surfs-up-worker as a separate persistent process.

Testing

For testing with a development installation, a small test suite is included in 'test_surf.py', which compares a local version of HUXt against a simple analytical solution and some reference simulation data included in this repository. The test suite uses pytest, which is included in the surf environment. Using the anaconda prompt from the root directory of surf, these tests can be performed by calling pytest from within the HUXt root directory:

pytest

The four tests should take around 1 minute to complete on a modest laptop. These tests are not an exhaustive test of all of the features in surf, but they do cover the core functionality and expected common use cases. They are mostly useful for anyone developing SURF, to check it is still working and how it differs from the latest available version. If you have installed SURF via pip or conda-forge, then the tests are completed as part of the conda-build process and not available to run locally.

Usage

Some examples of how to use HUXt can be found in surf_examples.ipynb, which can be opened using the surf-open-examples command after installation.

SURF requires an inner boundary condition for longitudinal solar wind speed profile. This can either be prescribed by the user or derived from other sources. For convenience, surf_inputs.py provides some functions for downloading and generating longitudinal solar wind speed profiles from the HelioMAS, Wang-Sheeley-Arge (WSA), and Potential Field Source Surface (PFSS) models, as well as from Coronal Tomography (CorTom). Examples of each is provided in the examples workbook. Routines for plotting and animating HUXt solutions can be found in surf_analysis.py. Again, examples are provided in the workbook.

Contact

Please contact either Mathew Owens or Luke Barnard.

Citations

If you use SURF in a publication or presentation, please cite the software using the Zenodo reference with DOI:10.5281/zenodo.4889326

To cite this project, including the scientific basis and functionality of SURF, please use:

Owens and Barnard. (2026), Space-weather Utilities for Research and Forecasting (SURF): A tool for investigating hydrodynamic aspects of solar wind and coronal mass ejection expansion and evolution, Solar Physics doi

Barnard and Owens. (2022), HUXt - An open source, computationally efficient reduced-physics solar wind model, written in Python, Frontiers in Physics 10.3389/fphy.2022.1005621

Owens et al. (2020), A Computationally Efficient, Time-Dependent Model of the Solar Wind for Use as a Surrogate to Three-Dimensional Numerical Magnetohydrodynamic Simulations, Sol Phys, DOI:10.1007/s11207-020-01605-3.svg

Metadata

Release files for surfs-up 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for surfs-up 1.0.0
File Size Uploaded
surfs_up-1.0.0.tar.gz 55.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for surfs-up 1.0.0
File Interpreter ABI Platform
surfs_up-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 110.3 MB

Release files / surfs_up-1.0.0.tar.gz

Download URL surfs_up-1.0.0.tar.gz
Size 55.2 MB
Tags Source
SHA-256 checksum
How to use checksums
10b80578692e5c81463c8a8b34705b036db8951fcb5080cd58a032a2317fa9bb
BLAKE2b-256 checksum
How to use checksums
8b5fef7e19d2183fdbfbcc2a5c8326182b0db3667ceed061050f848f6416cbb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / surfs_up-1.0.0-py3-none-any.whl

Download URL surfs_up-1.0.0-py3-none-any.whl
Size 55.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
fefa44563bf0b7d63fba8e2d4cf8ff448292d69f9db069741e6b10632e393846
BLAKE2b-256 checksum
How to use checksums
8e5931e2dbcebd122fc3d0e0ca481ecf0778ded8c7f93eddc62248de2f39f739
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page