|
3 | 3 | import os, sys |
4 | 4 | from .read_files import get_package_resource_path |
5 | 5 |
|
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 | | - |
26 | 6 | class ReionizationHistory: |
27 | 7 | def __init__(self, verbose=True): |
28 | 8 | self.verbose = verbose |
@@ -306,6 +286,27 @@ def _load_models(self): |
306 | 286 | if self.verbose: |
307 | 287 | print(f'Theory:\n{list(self.neutral_fraction_constraints.keys())}') |
308 | 288 |
|
| 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 | + |
309 | 310 | if __name__ == "__main__": |
310 | 311 | import matplotlib.pyplot as plt |
311 | 312 | from matplotlib.cm import ScalarMappable |
|
0 commit comments