Package: globalemu
Introductionglobalemu:Robust Global 21-cm Signal EmulationAuthor:Harry Thomas Jones BevinsVersion:1.8.1Homepage:https://github.com/htjb/globalemuDocumentation:https://globalemu.readthedocs.io/InstallationThe software can be pip installed from the PYPI repository via,pipinstallglobalemuor alternatively it can be installed from the git repository via.gitclonehttps://github.com/htjb/globalemu.git# or the equivalent using ssh keyscdglobalemupythonsetup.pyinstall--userEmulating the Global 21-cm Signalglobalemuis 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 102 times faster and 2 times as accurate
as the previous state of the art21cmGEM. 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:fromglobalemu.downloadsimportdownloaddownload().model()# Redshift-Temperature Networkdownload(xHI=True).model()# Redshift-Neutral Fraction Networkwhich 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:fromglobalemu.evalimportevaluate# [fstar, vc, fx, tau, alpha, nu_min, R_mfp]params=[1e-3,46.5,1e-2,0.0775,1.25,1.5,30]predictor=evaluate(base_dir='T_release/')# Redshift-Temperature Networksignal,z=predictor(params)# note the parameter order is different for the neutral fraction emulator# [fstar, vc, fx, nu_min, tau, alpha, R_mfp]params=[1e-3,46.5,1e-2,1.5,0.0775,1.25,30]predictor=evaluate(base_dir='xHI_release/')# Redshift-Neutral Fraction Networksignal,z=predictor(params)The code can also be used to train a network on your own Global 21-cm signal
or neutral fraction simulations using the built inglobalemupre-processing
techniques. There is some flexibility on the required astrophysical input
parameters and the pre-processing steps which is detailed in the documentation.
More details about training your own network can be found in the documentation.globalemuGUIglobalemualso 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 needs a configuration file to
run and this can be generated using a built inglobalemufunction.GUI configuration files can be generated for any trained model.For example,
if we wanted to generate a configuration file for the released Global signal
emulator we would run,fromglobalemu.gui_configimportconfigparamnames=[r'$\log(f_*)$',r'$\log(V_c)$',r'$\log(f_X)$',r'$\tau$',r'$\alpha$',r'$\nu_\mathrm{min}$',r'$R_\mathrm{mfp}$']config('T_release/',paramnames,'data/')where the directory ‘data/’ contains the training and testing data (in this
case that corresponding to21cmGEM).The GUI can then be invoked from the terminal via,globalemu/path/to/base_dir/T_release/etc/An image of the GUI is shown below.The GUI can also be used to investigate the physics of the neutral fraction
history by generating a configuration file for the released trained model.
There is no need to specify that the configuration file is for a neutral
fraction emulator.Configuration files for the released models are provided.DocumentationThe 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,cddocssphinx-buildsourcehtml-buildYou can find a tutorial notebookhere.T_release/ and xHI_release/The currently released global signal trained model,T_release/is trained
on the same training data set as 21cmGEM which is availablehere. The data used to train the
neutral fraction history network,xHI_release/is not publicly available
but comes from the same large scale simulations used to model the global signal.For both models the input parameters and ranges are given below.ParameterDescriptionT_release/xHI_release/MinMaxInput OrderInput Orderf*Star Formation Efficiency110.00010.5VcMinimal Virial Circular Veloity224.2 km/s100 km/sfxX-ray Efficiency3301000tauCMB Optical Depth450.040.17alphaPower of X-ray SED slope561.01.5numinLow Energy Cut Off of X-ray SED640.1 keV3 keVRmfpMean Free Path of Ionizing Photons7710.0 Mpc50.0 MpcLicence and CitationThe 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 theglobalemupaper below.MNRAS pre-print(referred to in the documentation as theglobalemupaper),Bevins, H., W. J. Handley, A. Fialkov, E. D. L. Acedo and K. Javid.
“GLOBALEMU: A novel and robust approach for emulating the sky-averaged 21-cm
signal from the cosmic dawn and epoch of reionisation.” (2021). arXiv:2104.04336Below is the bibtex,@article{Bevins2021,author={{Bevins}, H.~T.~J. and {Handley}, W.~J. and {Fialkov}, A. and {de Lera Acedo}, E. and {Javid}, K.},title="{GLOBALEMU: a novel and robust approach for emulating the sky-averaged 21-cm signal from the cosmic dawn and epoch of reionization}",journal={\mnras},year=2021,month=dec,volume={508},number={2},pages={2923-2936},doi={10.1093/mnras/stab2737},archivePrefix={arXiv},eprint={2104.04336},primaryClass={astro-ph.CO},adsurl={https://ui.adsabs.harvard.edu/abs/2021MNRAS.508.2923B},adsnote={Provided by the SAO/NASA Astrophysics Data System}}RequirementsTo run the code you will need to following additional packages:numpytensorflowpandasmatplotlibPillowWhen 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:sphinxnumpydocTo run the test suit you will need:pytestContributingContributions toglobalemuare 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.