aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/configs/manager.py
diff options
context:
space:
mode:
Diffstat (limited to 'fg21sim/configs/manager.py')
-rw-r--r--fg21sim/configs/manager.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py
index 7818d1c..1cddb75 100644
--- a/fg21sim/configs/manager.py
+++ b/fg21sim/configs/manager.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2016 Weitian LI <liweitianux@live.com>
+# Copyright (c) 2016-2017 Weitian LI <weitian@aaronly.me>
# MIT license
#
# References:
@@ -455,6 +455,22 @@ class ConfigManager:
return os.path.normpath(path)
@property
+ def foregrounds(self):
+ """Get all available and enabled foreground components.
+
+ Returns
+ -------
+ enabled : list[str]
+ Enabled foreground components to be simulated
+ available : list[str]
+ All available foreground components
+ """
+ fg = self.get("foregrounds")
+ avaliable = list(fg.keys())
+ enabled = [key for key, value in fg.items() if value]
+ return (enabled, avaliable)
+
+ @property
def frequencies(self):
"""Get or calculate if ``frequency/type = custom`` the frequencies
where to perform the simulations.