Skip to content

Commit 60577b5

Browse files
author
sambit-giri
committed
fesc data, generic module to read
files inside the package
1 parent 93780b5 commit 60577b5

2 files changed

Lines changed: 22 additions & 21 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
setup(
3838
name='tools21cm',
39-
version='2.3.6',
39+
version='2.3.7',
4040
author='Sambit Giri',
4141
author_email='sambit.giri@gmail.com',
4242
packages=find_packages(where="src"),

src/tools21cm/compare_constraints.py

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,6 @@
33
import os, sys
44
from .read_files import get_package_resource_path
55

6-
class EscapeFractionLymanAlpha:
7-
def __init__(self, verbose=True):
8-
self.verbose = verbose
9-
if self.verbose:
10-
print('--- Lyman-alpha Escape Fraction ---')
11-
self._load_constraints()
12-
13-
def _load_constraints(self):
14-
import pandas as pd
15-
16-
self.fesc_LymanAlpha_constraints = {}
17-
filename = get_package_resource_path('tools21cm', 'input_data/fesc_LyA_constraints.xlsx')
18-
19-
name = 'Napolitano+2024'
20-
df = pd.read_excel(filename, sheet_name=name, engine='openpyxl')
21-
self.fesc_LymanAlpha_constraints[name] = df
22-
23-
if self.verbose:
24-
print(f'Lyman-alpha escapse fraction references:\n{list(self.fesc_LymanAlpha_constraints.keys())}')
25-
266
class ReionizationHistory:
277
def __init__(self, verbose=True):
288
self.verbose = verbose
@@ -306,6 +286,27 @@ def _load_models(self):
306286
if self.verbose:
307287
print(f'Theory:\n{list(self.neutral_fraction_constraints.keys())}')
308288

289+
class EscapeFractionLymanAlpha:
290+
def __init__(self, verbose=True):
291+
self.verbose = verbose
292+
if self.verbose:
293+
print('--- Lyman-alpha Escape Fraction ---')
294+
self._load_constraints()
295+
296+
def _load_constraints(self):
297+
import pandas as pd
298+
299+
self.fesc_LymanAlpha_constraints = {}
300+
filename = get_package_resource_path('tools21cm', 'input_data/fesc_LyA_constraints.xlsx')
301+
302+
name = 'Napolitano+2024'
303+
df = pd.read_excel(filename, sheet_name=name, engine='openpyxl')
304+
self.fesc_LymanAlpha_constraints[name] = df
305+
306+
if self.verbose:
307+
print(f'Lyman-alpha escapse fraction references:\n{list(self.fesc_LymanAlpha_constraints.keys())}')
308+
309+
309310
if __name__ == "__main__":
310311
import matplotlib.pyplot as plt
311312
from matplotlib.cm import ScalarMappable

0 commit comments

Comments
 (0)