Skip to main content

globalemu: Robust and Fast Global 21-cm Signal Emulation

Project description

Introduction

globalemu:

Robust Global 21-cm Signal Emulation

Author:

Harry Thomas Jones Bevins

Version:

1.0.0-alpha

Homepage:

https://github.com/htjb/globalemu

Documentation:

https://globalemu.readthedocs.io/

https://mybinder.org/badge_logo.svg Documentation Status https://codecov.io/gh/htjb/globalemu/branch/master/graph/badge.svg?token=4KLLNT45TQ https://badge.fury.io/py/globalemu.svg github CI MIT License https://zenodo.org/badge/DOI/10.5281/zenodo.4601577.svg

Installation

The software can be pip installed from the PYPI repository via,

pip install globalemu

or alternatively it can be installed from the git repository via.

git clone https://github.com/htjb/globalemu.git # or the equivalent using ssh keys
cd globalemu
python setup.py install --user

Emulating the Global 21-cm Signal

globalemu is a fast and robust approach for emulating the Global or sky averaged 21-cm signal and the associated neutral fraction history. In the cited MNRAS paper below we show that it is a factor of approximately 60 faster and 2 times as accurate as the previous state of the art 21cmGEM. The code is also flexible enough for it to be retrained on detailed simulations containing the most up to date physics. We release two trained networks, one for the Global signal and one for the neutral fraction history, details of which can be found in the MNRAS paper below.

You can download trained networks with the following code after pip installing or installing via the github repository:

from globalemu.downloads import download

download().model() # Redshift-Temperature Network
download(xHI=True).model() # Redshift-Neutral Fraction Network

which will produce two files in your working directory ‘T_release/’ and ‘xHI_release/’. Each file has the respective network model in and related pre and post processing files. You can then go on to evaluate each network for a set of parameters by running:

from globalemu.eval import evaluate

# [fstar, vc, fx, tau, alpha, nu_min, R_mfp]
params = [1e-3, 46.5, 1e-2, 0.0775, 1.25, 1.5, 30]

res = evaluate(params, base_dir='T_release/') # Redshift-Temperature Network
res = evaluate(params, base_dir='xHI_release/', xHI=True) # Redshift-Neutral Fraction Network

Results are accessed via ‘res.z’ and ‘res.signal’.

The code can also be used to train a network on your own Global 21-cm signal or neutral fraction simulations using the built in globalemu pre-processing techniques. There is some flexibility on the required astrophysical input parameters but the models are required to subscribe to the astrophysics free baseline calculation detailed in the globalemu paper (see below for a reference). More details about training your own network can be found in the documentation.

globalemu GUI

globalemu also features a GUI that can be invoked from the command line and used to explore how the structure of the Global 21-cm signal varies with the values of the astrophysical inputs. The GUI currently relies on the released emulator models for the Global signal and neutral fraction history. It can be invoked from the terminal via,

globalemu

An image of the GUI is shown below.

graphical user interface

The GUI can also be used to investigate the physics of the neutral fraction history by adding the flag --xHI to the terminal call,

globalemu --xHI

Documentation

The documentation is available at: https://globalemu.readthedocs.io/

It can be compiled locally after downloading the repo and installing the relevant packages (see below) via,

cd docs
sphinx-build source html-build

You can find a tutorial notebook here.

Licence and Citation

The software is free to use on the MIT open source license. If you use the software for academic puposes then we request that you cite the globalemu papers below.

MNRAS pre-print (referred to in the documentation as the globalemu paper),

In prep.

Below is the bibtex,

In prep.

JOSS paper,

In prep.

and the corresponding bibtex,

In prep.

Requirements

To run the code you will need to following additional packages:

When installing via pip or from source via setup.py the above packages will be installed if absent.

To compile the documentation locally you will need:

To run the test suit you will need:

Contributing

Contributions to globalemu are very much welcome and can be made via,

  • Opening an issue to report a bug/propose a new feature.

  • Making a pull request. Please consider opening an issue first to discuss any proposals and ensure the PR will be accepted.

21cmGEM Data

The 21cmGEM training data is available here.

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

globalemu-1.0.0a2.tar.gz (17.3 kB view hashes)

Uploaded Source

Supported by

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