ascl_id
stringclasses
752 values
repo_url
stringclasses
737 values
file_path
stringlengths
4
194
content
large_stringlengths
1
1M
language
stringclasses
29 values
license_type
stringclasses
24 values
size
int64
1
1M
[ascl:1604.006]
https://github.com/sundarjhu/2-DUST/
2dust/extrap.f90
!!$--------------------------------------------------------------------- SUBROUTINE EXTRAP(FX,FY,X,Y,NWAV,NRAD,NQ2) !!$--------------------------------------------------------------------- !!$ This subroutine uses linear interpolation (extrapolation) to !!$ estimate the temperature and mean intensity at the bound...
Fortran
Unknown
2,308
[ascl:1604.006]
https://github.com/sundarjhu/2-DUST/
2dust/temp.f90
!!$--------------------------------------------------------------------- SUBROUTINE TEMP(TTABLE,BTABLE,KB,T) !!$--------------------------------------------------------------------- !!$ This subroutine uses simple linear interpolation to determine !!$ the local temperature from the K*B(T) table, BTABLE. !!$ !!...
Fortran
Unknown
1,583
[ascl:1604.006]
https://github.com/sundarjhu/2-DUST/
2dust/revisionnotes.txt
* 2dust.210223.tgz geom.f90, gridgen.f90, and mindens.f90 were updated in 2014 for automated MXSTEP/VSPACE calculation. Additional minor changes to the following files: const.f90 L52 increased TTOP to 2002.7 to account for dust species with higher Tcond readsed.f90 L73 output format...
Text
Unknown
5,559
[ascl:1604.006]
https://github.com/sundarjhu/2-DUST/
2dust/mapgrid.f90
!!$--------------------------------------------------------------------- program mapgrid !!$--------------------------------------------------------------------- !!$ Reads output (user specified) from mapspec and transform polar !!$ grid format of mapspec output into cartesian grid format of !!$ user specified size...
Fortran
Unknown
26,869
[ascl:2103.001]
https://github.com/PabloVD/21cmDeepLearning
HI2DM.py
#------------------------------------------------------------- # CNN to predict the matter density field from a 21 cm field # Main script for training and testing the network # Author: Pablo Villanueva Domingo # Last update: 25/6/20 #------------------------------------------------------------- import time, datetime, ...
Python
null
2,726
[ascl:2103.001]
https://github.com/PabloVD/21cmDeepLearning
Saliency_astro.py
#------------------------------------------------------------------------------------- # Compute the saliency maps for the AstroNet using Vainilla Gradient (arXiv:1312.6034) # Author: Pablo Villanueva Domingo # Last update: 25/6/20 #------------------------------------------------------------------------------------- ...
Python
null
4,016
[ascl:2103.001]
https://github.com/PabloVD/21cmDeepLearning
HI2Astro.py
#---------------------------------------------------------------- # CNN to predict the astrophysical parameters from a 21 cm field # It can employ the encoder of the pre-trained U-Net # Author: Pablo Villanueva Domingo # Last update: 25/6/20 #---------------------------------------------------------------- import time...
Python
null
3,932
[ascl:2103.001]
https://github.com/PabloVD/21cmDeepLearning
README.md
# 21cmDeepLearning [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.4569964.svg)](https://zenodo.org/record/4569964) [![ASCL](https://img.shields.io/badge/ascl-2103.001-blue.svg?colorB=262255)](https://ascl.net/2103.001) [![arXiv](https://img.shields.io/badge/arXiv-2006.14305-B31B1B.svg)](http://arxiv.org/abs/2006...
Markdown
null
3,437
[ascl:2103.001]
https://github.com/PabloVD/21cmDeepLearning
Plotter.py
#------------------------------------------------------------- # Driver for plotting several statistics # Author: Pablo Villanueva Domingo # Last update: 25/6/20 #------------------------------------------------------------- import time, datetime import glob from Source.plot_routines import * time_ini = time.time() ...
Python
null
1,727
[ascl:2103.001]
https://github.com/PabloVD/21cmDeepLearning
Dataloader.py
#-------------------------------------------------------------------------- # Preprocess data code # Transform from binary files to numpy arrays and store them in npy format # Author: Pablo Villanueva Domingo # Last update: 24/6/20 #-------------------------------------------------------------------------- import nump...
Python
null
5,133
[ascl:2103.001]
https://github.com/PabloVD/21cmDeepLearning
Source/plot_routines.py
#----------------------------------------------------- # Some routines for plotting and computing statistics # Author: Pablo Villanueva Domingo # Last update 25/6/20 #----------------------------------------------------- import numpy as np import matplotlib.pyplot as plt from Source.params import * import powerbox as ...
Python
null
10,118
[ascl:2103.001]
https://github.com/PabloVD/21cmDeepLearning
Source/nets.py
#-------------------------------------------- # Convolutional networks (U-Net and AstroNet) # Author: Pablo Villanueva Domingo # Last update: 23/6/20 #-------------------------------------------- import torch from torch import nn import torch.nn.functional as F import torch.optim as optim # Channel sizes chn1 = 64 ch...
Python
null
7,339
[ascl:2103.001]
https://github.com/PabloVD/21cmDeepLearning
Source/params.py
#---------------------------------- # Parameters file # Author: Pablo Villanueva Domingo # Last update 25/6/20 #---------------------------------- import os #--- GLOBAL PARAMETERS ---# # Number of simulations employed n_sims = 1000 # Number of epochs for training n_epochs = 20 # Redshifts taken into account. Use ...
Python
null
1,634
[ascl:2103.001]
https://github.com/PabloVD/21cmDeepLearning
Source/functions.py
#---------------------------------- # Useful functions and routines # Author: Pablo Villanueva Domingo # Last update: 25/6/20 #---------------------------------- import random, glob import numpy as np import torch import torch.utils.data as utils from torch.optim import Adam, lr_scheduler from torch.utils.data.sampler...
Python
null
8,070
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.readthedocs.yml
version: 2 build: os: ubuntu-22.04 tools: python: "3.11" python: install: - requirements: docs/requirements.txt - method: pip path: . extra_requirements: - docs sphinx: configuration: docs/conf.py formats: - pdf - epub
YAML
MIT
279
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.pre-commit-config.yaml
exclude: "^docs/conf.py|^src/py21cmemu/emulator_constants.npz" repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: - id: trailing-whitespace - id: check-ast - id: check-json - id: check-merge-conflict - id: check-xml - id: check-yaml - id...
YAML
MIT
1,357
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
README.rst
======= 21cmEMU ======= |PyPI| |Status| |Python| |License| |RTD| |Tests| |Codecov| |pre-commit| |Black| .. |PyPI| image:: https://img.shields.io/pypi/v/py21cmemu.svg :target: https://pypi.org/project/py21cmemu/ .. |Status| image:: https://img.shields.io/pypi/status/py21cmemu.svg :target: https://pypi.org/proje...
reStructuredText
MIT
2,481
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
AUTHORS.rst
======= Authors ======= Daniela Breitman - github.com/DanielaBreitman
reStructuredText
MIT
71
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
pyproject.toml
[tool.poetry] name = "py21cmEMU" version = "1.1.3" description = "Emulator of 21cmFAST summaries." authors = ["Daniela Breitman <daniela.breitman@sns.it>"] license = "MIT" readme = ["README.rst"] homepage = "https://github.com/21cmFAST/21cmEMU" repository = "https://github.com/21cmFAST/21cmEMU" documentation = "https:/...
TOML
MIT
2,417
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
CHANGELOG.rst
Changelog ========= v1 --------- - Emulates 21-cm power spectrum, global 21-cm brightness temperature, IGM spin temperature, and neutral fraction - Thomson scattering CMB optical depth $\tau_e$ and UV luminosity functions are calculated analytically using 21cmFAST
reStructuredText
MIT
266
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
CODE_OF_CONDUCT.md
# Contributor Covenant Code of Conduct ## Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of...
Markdown
MIT
5,522
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
codecov.yml
comment: false coverage: status: project: default: target: "100" patch: default: target: "100"
YAML
MIT
133
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.cookiecutter.json
{ "_template": "gh:cjolowicz/cookiecutter-hypermodern-python", "author": "Daniela Breitman", "copyright_year": "2023", "development_status": "Development Status :: 5 - Production/Stable", "email": "daniela.breitman@sns.it", "friendly_name": "21cmEMU", "github_user": "DanielaBreitman", "license": "MIT", ...
JSON
MIT
403
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
ENV.yml
name: 21cmEMU channels: - defaults dependencies: - pyrsistent==0.18.0=py39heee7806_0 - libdeflate==1.17=h5eee18b_0 - python-dateutil==2.8.2=pyhd8ed1ab_0 - tk==8.6.12=h1ccaba5_0 - gettext==0.21.0=hf68c758_0 - qtpy==2.3.1=pyhd8ed1ab_0 - libevent==2.1.12=h8f2d780_0 - libffi==3.4.4=h6a678d5_0 - libxkbco...
YAML
MIT
5,241
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
noxfile.py
"""Nox sessions.""" import os import shlex import shutil import sys from pathlib import Path from textwrap import dedent import nox try: from nox_poetry import Session from nox_poetry import session except ImportError: message = f"""\ Nox failed to import the 'nox-poetry' package. Please instal...
Python
MIT
6,736
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
CONTRIBUTING.rst
Contributor Guide ================= Thank you for your interest in improving this project. This project is open-source under the `MIT license <https://opensource.org/licenses/MIT>`_ and welcomes contributions in the form of bug reports, feature requests, and pull requests. Here is a list of important resources for co...
reStructuredText
MIT
2,971
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.github/release-drafter.yml
categories: - title: ":boom: Breaking Changes" label: "breaking" - title: ":rocket: Features" label: "enhancement" - title: ":fire: Removals and Deprecations" label: "removal" - title: ":beetle: Fixes" label: "bug" - title: ":racehorse: Performance" label: "performance" - title: ":rotati...
YAML
MIT
728
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.github/dependabot.yml
version: 2 updates: - package-ecosystem: github-actions directory: "/" schedule: interval: monthly - package-ecosystem: pip directory: "/.github/workflows" schedule: interval: monthly - package-ecosystem: pip directory: "/docs" schedule: interval: monthly - package-ecos...
YAML
MIT
469
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.github/labels.yml
--- # Labels names are important as they are used by Release Drafter to decide # regarding where to record them in changelog or if to skip them. # # The repository labels will be automatically configured using this file and # the GitHub Action https://github.com/marketplace/actions/github-labeler. - name: breaking de...
YAML
MIT
1,799
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.github/workflows/labeler.yml
name: Labeler on: push: branches: - main - master jobs: labeler: runs-on: ubuntu-latest steps: - name: Check out the repository uses: actions/checkout@v4 - name: Run Labeler uses: crazy-max/ghaction-github-labeler@v5.3.0 with: skip-delete: tru...
YAML
MIT
322
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.github/workflows/constraints.txt
nox==2025.2.9 nox-poetry==1.2.0 pip==24.2 poetry==2.1.2 virtualenv==20.28.0
Text
MIT
76
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.github/workflows/release.yml
name: Release on: push: branches: - main - master jobs: release: name: Release runs-on: ubuntu-latest steps: - name: Check out the repository uses: actions/checkout@v4 with: fetch-depth: 2 - name: Set up Python uses: actions/setup-python@v...
YAML
MIT
2,166
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.github/workflows/auto_merge.yml
name: auto-merge on: pull_request: jobs: auto-merge: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: ahmadnassri/action-dependabot-auto-merge@v2 with: target: minor github-token: ${{ secrets.AUTO_MERGE }}
YAML
MIT
277
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
.github/workflows/tests.yml
name: Tests on: - push - pull_request jobs: tests: name: ${{ matrix.session }} ${{ matrix.python }} / ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: # - { python: "3.10", os: "ubuntu-latest", session: "safety" } # - { pyth...
YAML
MIT
4,651
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/contributing.rst
.. include:: ../CONTRIBUTING.rst
reStructuredText
MIT
33
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/README.rst
.. include:: ../README.rst
reStructuredText
MIT
27
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/authors.rst
.. include:: ../AUTHORS.rst
reStructuredText
MIT
28
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/conf.py
"""Sphinx configuration.""" import sys from pathlib import Path import subprocess import py21cmemu sys.path.insert(0, str(Path(__file__).absolute().parent.parent / "src")) master_doc = 'index' source_suffix = ".rst" project = "21cmEMU" author = "Daniela Breitman" copyright = "2023, Daniela Breitman" extensions = [ ...
Python
MIT
843
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/tutorials.rst
Tutorials ================== The following introductory tutorials will help you get started with ``21cmEMU``. .. toctree:: :maxdepth: 2 tutorials/basic_usage tutorials/21cmFAST_tau_UVLFs tutorials/21cmFAST_lightcone tutorials/radio_emulator
reStructuredText
MIT
259
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/usage.rst
Quickstart ========== Installation ------------ Make sure you have ``git-lfs`` installed on your system. Otherwise, ``21cmEMU`` will not be installed properly. For users ^^^^^^^^^ To use ``21cmEMU``, install it with pip: .. code-block:: console $ pip install py21cmemu For developers ^^^^^^^^^^^^^^ Start by ...
reStructuredText
MIT
2,103
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/license.md
# License ```{literalinclude} ../LICENSE --- language: none --- ```
Markdown
MIT
69
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/requirements.txt
appdirs==1.4.4 furo==2024.8.6 ipython>=7.0.0 myst_parser==4.0.1 nbsphinx==0.9.6 numpy>=1.20.0 py21cmemu>=1.0.5.dev0 scipy>=1.7.0 sphinx>=5.2.0 sphinx-click>=4.4.0 tensorflow>=2.6.0 toml==0.10.2 torch>=1.9.0
Text
MIT
207
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/codeofconduct.md
```{include} ../CODE_OF_CONDUCT.md ```
Markdown
MIT
40
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/index.rst
.. include:: README.rst Contents ======== .. toctree:: :maxdepth: 2 usage tutorials reference/index contributing authors codeofconduct license Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`
reStructuredText
MIT
261
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/tutorials/21cmFAST_lightcone.ipynb
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Comparing 21cmFAST with 21cmEMU directly\n", "\n", "In this tutorial, we will use 21cmFAST to simulate a lightcone and compare it with the output from 21cmEMU. \n", "We will compare the EoR history and global signal." ...
Jupyter Notebook
MIT
126,164
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/tutorials/basic_usage.ipynb
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Basic Usage" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "\n", "from py21cmemu import Emulator\n", "\n", "import ma...
Jupyter Notebook
MIT
696,265
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/reference/py21cmemu.rst
API Summary ----------- .. testsetup:: from py21cmemu import * .. autosummary:: :toctree: _autosummary :template: module.rst py21cmemu.inputs py21cmemu.outputs py21cmemu.emulator py21cmemu.properties
reStructuredText
MIT
232
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/reference/index.rst
API Reference ============= .. toctree:: :glob: :maxdepth: 3 py21cmemu*
reStructuredText
MIT
86
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/reference/_autosummary/py21cmemu.outputs.rst
py21cmemu.outputs ================= .. currentmodule:: py21cmemu .. automodule:: outputs
reStructuredText
MIT
94
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/reference/_autosummary/py21cmemu.properties.rst
py21cmemu.properties ==================== .. currentmodule:: py21cmemu .. automodule:: properties
reStructuredText
MIT
103
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/reference/_autosummary/py21cmemu.inputs.rst
py21cmemu.inputs ================ .. currentmodule:: py21cmemu .. automodule:: inputs
reStructuredText
MIT
91
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
docs/reference/_autosummary/py21cmemu.emulator.rst
py21cmemu.emulator ================== .. currentmodule:: py21cmemu .. automodule:: emulator
reStructuredText
MIT
97
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
src/py21cmemu/__init__.py
"""21cmEMU: An emulator of 21cmFAST summaries.""" __version__ = "1.0.8" from .emulator import Emulator from .get_emulator import get_emu_data from .inputs import DefaultEmulatorInput from .inputs import RadioEmulatorInput from .outputs import EmulatorOutput from .outputs import RawEmulatorOutput from .properties impor...
Python
MIT
385
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
src/py21cmemu/emulator.py
"""Module that interacts with the Emulator Tensorflow model.""" from __future__ import annotations import logging from pathlib import Path from typing import Any import numpy as np from .config import CONFIG from .get_emulator import get_emu_data from .inputs import DefaultEmulatorInput from .inputs import ParamVec...
Python
MIT
6,257
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
src/py21cmemu/get_emulator.py
"""Download and install the emulator data.""" from __future__ import annotations import logging from warnings import warn import git from .config import CONFIG log = logging.getLogger(__name__) def get_emu_data(version: str = "latest"): """Download a version of the 21cmEMU emulator. Parameters ----...
Python
MIT
2,445
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
src/py21cmemu/outputs.py
"""Module whose functionality is to organise the emulator output.""" from __future__ import annotations import dataclasses as dc from dataclasses import dataclass from pathlib import Path from typing import Generator import numpy as np from .properties import emulator_properties @dataclass(frozen=True) class Emul...
Python
MIT
11,539
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
src/py21cmemu/inputs.py
"""Module containing functionality for handling emulator inputs.""" from __future__ import annotations from typing import Dict from typing import Sequence from typing import Union import numpy as np from .properties import emulator_properties SingleParamVecType = Union[Dict[str, float], np.ndarray, Sequence[float...
Python
MIT
7,369
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
src/py21cmemu/properties.py
"""A module definining the static properties of the Emulator.""" from __future__ import annotations from pathlib import Path import numpy as np class EmulatorProperties: """A class that contains the properties of the emulator.""" @property def normalized_quantities(self) -> list[str]: """Retur...
Python
MIT
6,634
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
src/py21cmemu/config.py
"""User-facing configuration for py21cmEMU.""" from __future__ import annotations import logging from contextlib import contextmanager from pathlib import Path from typing import Any from typing import Generator import toml from appdirs import AppDirs log = logging.getLogger(__name__) APPDIR = AppDirs("py21cmEMU"...
Python
MIT
3,312
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
src/py21cmemu/models/radio_background/model.py
"""Radio backgrdound emulator model.""" import torch from torch import nn def modulelist2sequential(module: nn.ModuleList) -> nn.Sequential: """Convert a nn.ModuleList to a nn.Sequential. Parameters ---------- module : nn.ModuleList The module to convert. Returns ------- nn.Sequ...
Python
MIT
9,443
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
tests/test_main.py
"""Test cases for the __main__ module.""" import shutil import numpy as np import pytest from typeguard import suppress_type_checks from py21cmemu import DefaultEmulatorInput from py21cmemu import Emulator from py21cmemu import RadioEmulatorInput from py21cmemu.config import CONFIG from py21cmemu.outputs import Defa...
Python
MIT
9,877
[ascl:2312.013]
https://github.com/21cmfast/21cmEMU
tests/__init__.py
"""Test suite for the py21cmemu package."""
Python
MIT
44
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
README.md
# 21cmFAST This is the public C-only version of the semi-numerical, cosmological simulation code 21cmFAST (Mesinger & Furlanetto 2007; Mesinger et al. 2011). NOTE: since v3, active development has moved to the Python-wrapped version here: https://github.com/21cmfast/21cmFAST
Markdown
null
278
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/update_halo_pos.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" /******************************************************************** USAGE: update_halo_pos <REDSHIFT> Program UPDATE_HALO_POS reads in the linear velocity field, and uses it to update halo locations with a corresponding displac...
C
null
12,406
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/find_HII_bubbles.c
#include "bubble_helper_progs.c" #include "heating_helper_progs.c" /* USAGE: find_HII_bubbles [-p <num of processors>] <redshift> [<previous redshift>] [<stellar fraction for 10^10 Msun halos> <power law index for stellar fraction halo mass scaling> <escape fraction for 10^10 Msun halos> <power law index for e...
C
null
48,057
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/delta_T.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" #include "../Parameter_files/HEAT_PARAMS.H" /* USAGE: delta_T [-p <NUM THREADS>] <redshift> <xH filename> [<Ts filename>] generates the 21-cm temperature offset from the CMB field and power spectrum the spin temperature fi...
C
null
35,305
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/filter_den_hist.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" #include "bubble_helper_progs.c" #define bin_factor (float) 1.2 #define bin_first_bin_ceil (float) 0.001 #define bin_max (float) 1000 /* Function FILTER_DEN_HIST prints out a histogram of the overdensities in the USAGE:...
C
null
7,354
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/elec_interp.c
/* Written by Steven Furlanetto */ #include "stdio.h" #include "stdlib.h" #include "math.h" // Below gives grid sizes for the interpolation arrays #ifndef _x_int_VARIABLES_DEFINED #define x_int_NXHII 14 #define x_int_NENERGY 258 #define _x_int_VARIABLES_DEFINED #endif // Initialization; must be called once to void ...
C
null
17,709
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/find_halos.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" #include "filter.c" FILE *LOG; /* USAGE: find_halos <redshift> Program FIND_HALOS takes in a k_space box of the linear overdensity field and filters it on decreasing scales in order to find virialized halos. Virialized ...
C
null
17,772
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/delta_ps.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" /* USAGE: delta_ps <deltax filename> <output filename> box is assumed to be of the HII dimension defined in ANAL_PARAM.H */ #define FORMAT (int) 0 /* 0= unpadded binary box; 1= FFT padded binary box (outdated) */ #define CONV...
C
null
5,760
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/extract_delTps.pl
#!/usr/bin/perl ##### USAGE: extract_delTps.pl k_mode <delta_T file 1> <delta_T file 2> > outfile my $pivot_k = shift(@ARGV); sub log10 { my $n = shift; return log($n)/log(10); } my $lpivot_k = log10($pivot_k); my $ct=0; my @lines; foreach $file (@ARGV){ $file =~ /\_nf(\d{1})\.(\d{6})\_/; $nf = "$1.$2...
Perl
null
1,080
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/drive_zscroll_noTs.c
#include <math.h> #include <unistd.h> #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include "../Parameter_files/INIT_PARAMS.H" /* Program DRIVE_ZSCROLL_NOTS.C scrolls through the redshifts defined below, creating halo, evolved density, velocity, 21cm fields. NOTE: this driver assumes that the IGM h...
C
null
8,383
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/init.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" #include "filter.c" /* Generates the initial conditions: gaussian random density field (DIM^3) as well as the equal or lower resolution velocity fields, and smoothed density field (HII_DIM^3). See INIT_PARAMS.H and ANAL_P...
C
null
33,744
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/drive_xHIscroll.c
#include <math.h> #include <unistd.h> #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" /* Program DRIVE_xHIscroll.C scrolls through various values of ionizing efficiencies defined below, creating halo, evolved density...
C
null
11,627
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/filter.c
#ifndef _FILTER_ #define _FILTER_ #include "../Parameter_files/INIT_PARAMS.H" /* Function FILTER filters the k-space box, <box>, using filter type <filter_type> on a characteristic comoving scale <R> (in Mpc), where: 0 = top-hat real space filter 1 = top-hat k-space filter 2 = gaussian Relavant box param...
C
null
1,805
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/redshift_interpolate_boxes.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" #include "filter.c" #define FLIP_BOX (int) (0) /***************************************************************************************** USAGE: redshift_interpolate_boxes <BOX TYPE> <filename containing list of box...
C
null
13,457
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/fftCMB.c
/************************************************************************ Run of the mill FFT functions. Written by: Matt McQuinn Probably not so important to look in here ***********************************************************************/ #include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/...
C
null
3,255
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/boxcar_smooth_field.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" /* USAGE: boxcar_smooth_field <0=no fft padding; 1=fft padding> <input highres filename> <output lowres filename> Date 31.12.2009 Author: Andrei Mesinger */ int main(int argc, char ** argv){ fftwf_complex *box, *smoothed...
C
null
3,411
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/drive_logZscroll_Ts.c
#include <math.h> #include <unistd.h> #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <sys/wait.h> #include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" #include "../Parameter_files/HEAT_PARAMS.H" /* Program DRIVE_ZSCROLL.C scrolls through the redshifts defined i...
C
null
8,868
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/perturb_field.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" #include "bubble_helper_progs.c" /* USAGE: perturb_field <REDSHIFT> PROGRAM PERTURB_FIELD uses the first-order Langragian displacement field to move the masses in the cells of the density field. The high-res density field ...
C
null
19,510
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/print_power_spec_ICs.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" /* USAGE: print_power_spec <kbox_file_name> <output filename> [<k_max> <k_first_bin_ceil> <k_factor>] Function PRINT_POWER_SPEC reads in a delta_k box from <kbox_file_name>, and outputs: k-magnitude <power_spectrum> ...
C
null
5,490
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/gen_size_distr.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" #define NUM_TRIALS (unsigned long long) 1e7 // num of times we will perform the test #define dr (float)(1.0/(HII_DIM*5.0)) #define SIZE_BINSTEP (float) 2*BOX_LEN/(HII_DIM+0.0) // single step in histogram construction #define MAX_MA...
C
null
7,993
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/ps.c
#ifndef _PS_ #define _PS_ #include <stdio.h> #include <stddef.h> #include <stdlib.h> #include <ctype.h> #include <math.h> #include <unistd.h> #include "../Parameter_files/COSMOLOGY.H" #include "../Parameter_files/INIT_PARAMS.H" #include <gsl/gsl_interp.h> #include <gsl/gsl_spline.h> #include "cosmo_progs.c" #include "...
C
null
61,567
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/kSZ_power.c
/************************************************************************************* Written mostly by Matt McQuinn. This program calculates the kSZ from reionization boxes. The script that executes this program should have the format: FORMAT: kSZ_power <list of density boxes> <list of xH boxes> <list of velocity ...
C
null
18,546
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/heating_helper_progs.c
#include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" #include "../Parameter_files/HEAT_PARAMS.H" #include "bubble_helper_progs.c" #include "elec_interp.c" #define NSPEC_MAX (int) 23 #define RECFAST_NPTS (int) 501 #define KAPPA_10_NPTS (int) 27 #define KAPPA_10_elec_NPTS (int) 20 #def...
C
null
37,320
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/bubble_helper_progs.c
#ifndef _BUBBLE_HELPERS_ #define _BUBBLE_HELPERS_ #include "../Parameter_files/INIT_PARAMS.H" #include "../Parameter_files/ANAL_PARAMS.H" void HII_filter(fftwf_complex *box, int filter_type, float R){ int n_x, n_z, n_y; float k_x, k_y, k_z, k_mag, kR; #pragma omp parallel shared(box, filter_type, R) private(k_x...
C
null
15,131
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Programs/Ts.c
#include "heating_helper_progs.c" /* This is completed version. */ /* Program Ts calculates the spin temperature field, according to the perscription outlined in Mesinger, Furlanetto, Cen (2010). The fluctuating component is sourced by the mean EPS collapsed fraction in spherical annyli surrounding each cell....
C
null
43,740
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Cosmo_c_files/recombinations.c
#ifndef _RICO_ #define _RICO_ #include <stdio.h> #include <stddef.h> #include <stdlib.h> #include <ctype.h> #include <math.h> #include <unistd.h> #include "../Parameter_files/COSMOLOGY.H" #include "../Parameter_files/INIT_PARAMS.H" #include <gsl/gsl_interp.h> #include <gsl/gsl_spline.h> #include "cosmo_progs.c" #inclu...
C
null
11,051
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Cosmo_c_files/misc.c
#ifndef _MISC_ #define _MISC_ #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <math.h> /*** Some usefull math macros ***/ #define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) static double mnarg1,mnarg2; #define FMAX(a,b) (mnarg1=(a),mnarg2=(b),(mnarg1) > (mnarg2) ?\ (mnarg1) : (mnarg2)) static do...
C
null
3,352
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Cosmo_c_files/cosmo_progs.c
/* Usefull cosmo progs. CAUTION: many of these assume standard cosmology (k=0, etc.), so check them before doing wierd things to cosmology. */ #ifndef _COSMO_PROGS_ #define _COSMO_PROGS_ #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <math.h> #include "../Parameter_files/COSMOLOGY.H" double avoi...
C
null
20,869
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Cosmo_c_files/ps.c
#ifndef _PS_ #define _PS_ #include <stdio.h> #include <stddef.h> #include <stdlib.h> #include <ctype.h> #include <math.h> #include <unistd.h> #include "../Parameter_files/COSMOLOGY.H" #include "../Parameter_files/INIT_PARAMS.H" #include <gsl/gsl_interp.h> #include <gsl/gsl_spline.h> #include "cosmo_progs.c" #include "...
C
null
64,466
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Parameter_files/INIT_PARAMS.H
/* These include fundamental parameters of the realization. The cosmology is defined in COSMOLOGY.H */ #ifndef _INITS_PARAMETERS_H_ #define _INITS_PARAMETERS_H_ #include <math.h> #include <unistd.h> #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <complex.h> #include <time.h> #include <string.h...
C/C++ Header
null
2,301
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Parameter_files/COSMOLOGY.H
#ifndef COSMOLOGY_H #define COSMOLOGY_H #include <math.h> /****** New in v1.1. ******/ /*** WDM parameters ***/ #define P_CUTOFF (int) (0) // supress the power spectrum? 0= CDM; 1=WDM #define M_WDM (float) (2) // mass of WDM particle in keV. this is ignored if P_CUTOFF is set to zero #define g_x (float) (1.5) /* deg...
C/C++ Header
null
6,209
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Parameter_files/HEAT_PARAMS.H
/* NOTE: We encourage the user to perform their own convergance tests if modifying the code significantly from the fiducial model. Preliminary convergance studies were done around the fiducial model however. */ #ifndef _HEAT_PARAMS_H_ #define _HEAT_PARAMS_H_ /* Flag specifying whether one wants to calculate the...
C/C++ Header
null
4,284
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Parameter_files/ANAL_PARAMS.H
#ifndef _ANAL_PARAM_H_ #define _ANAL_PARAM_H_ /**************************************************************************************************************/ /**************** BEGIN USER CHANGABLE DEFINITIONS **********************************************************/ /*********************************************...
C/C++ Header
null
12,495
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Out-of-box_Output/README.md
This folder contains some output, resulting from calling `Programs/drive_logZscroll_Ts`. The 21-cm power spectra are in the `Power_spectra` directory, in ASCII format, with the columns corresponding to `<k>` `<power in k>` `<cosmic variance std in power>`. Note the power spectra include redshift space distortion, i.e...
Markdown
null
574
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Pics/cm21_plot_filelist_withps.m
% 21cm_plot_filelist_withps % open the filelists [input_filename] = textread('input_box_filenames','%s'); [input_ps_filename] = textread('input_ps_filenames','%s'); color_bar = 1; expand_factor = 1; MIN = -52; MAX = 52; dim = 300; for file_ct=1:length(input_filename) curr_filename = input_filename{file_ct}; [p...
MATLAB/Octave
null
1,108
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Pics/LightConeSnapshot.py
# Script to generate a summary plot which are lightcone slice, the averaged birightness temperature and the power spectrum at k = 0.1 Mpc^-1. # USAGE: python LightConeSnapshot.py # Before use this script, must generates the co-eval redshifts output by 21cmFAST/21CMMC. # Simply run 'drive_logZscroll_Ts.c' first, then ge...
Python
null
28,467
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Pics/cm21_image_slice_withps.m
% matlab function to plot slice % % mostly written by: Dave Spiegel % usage: function cm21_image_slice_withps(infile, outfile, dim1, color_bar_flag, expand_factor, varargin) if length(varargin) > 0 z = varargin{1}; xH = varargin{2}; aveTb = varargin{3}; end if length(varargin) > 3 lower_color_limit =...
MATLAB/Octave
null
7,192
[ascl:1102.023]
https://github.com/andreimesinger/21cmFASTv2-C-only-
Pics/xH_image_slice_withps.m
% matlab function to plot slice % % mostly written by: Dave Spiegel % usage: function xH_image_slice_withps(infile, outfile, dim1, color_bar_flag, expand_factor, varargin) if length(varargin) > 0 z = varargin{1}; xH = varargin{2}; aveTb = varargin{3}; end if length(varargin) > 3 lower_color_limit = v...
MATLAB/Octave
null
7,159