-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreset_models.py
60 lines (39 loc) · 1.64 KB
/
preset_models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""
These functions define some preset halo mass function models that can be specified instead of individually specifying
a bunch of keyword arguments. This is intended for a quick and easy user interface. The definitions shown here can also
act as a how-to guide if one wants to explore more complicated descriptions of the halo mass function, as the models
presented here show what each keyword argument accepted by pyHalo does.
"""
__all__ = ['preset_model_from_name']
def preset_model_from_name(name):
"""
Retruns a preset_model function from a string
:param name: the name of the preset model, should be the name of a function in this file
:return: the function
"""
if name == 'CDM':
from pyHalo.PresetModels.cdm import CDM
return CDM
elif name == 'WDM':
from pyHalo.PresetModels.wdm import WDM
return WDM
elif name == 'SIDM_core_collapse':
from pyHalo.PresetModels.sidm import SIDM_core_collapse
return SIDM_core_collapse
elif name == 'ULDM':
from pyHalo.PresetModels.uldm import ULDM
return ULDM
elif name == 'DMEmulator':
from pyHalo.PresetModels.external import DMFromEmulator
return DMFromEmulator
elif name == 'WDM_mixed':
from pyHalo.PresetModels.wdm import WDM_mixed
return WDM_mixed
elif name == 'WDMGeneral':
from pyHalo.PresetModels.wdm import WDMGeneral
return WDMGeneral
elif name == "DMGalacticus":
from pyHalo.PresetModels.external import DMFromGalacticus
return DMFromGalacticus
else:
raise Exception('preset model '+ str(name)+' not recognized!')