aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-10-17 15:18:58 +0800
committerAaron LI <aaronly.me@outlook.com>2016-10-17 15:18:58 +0800
commit6b14162d0b9a464be102daf0b0ff791a7b9e9f48 (patch)
treeee5000373386fa69095833980ea56853662b84ee /fg21sim
parente748c1fd0928a1a98324b465de6f78e062052a73 (diff)
downloadfg21sim-6b14162d0b9a464be102daf0b0ff791a7b9e9f48.tar.bz2
configs/validate.py: Add "check_galactic_snr()" for "galactic/snr"
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/configs/validate.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/fg21sim/configs/validate.py b/fg21sim/configs/validate.py
index aaf7fd1..0fd2c64 100644
--- a/fg21sim/configs/validate.py
+++ b/fg21sim/configs/validate.py
@@ -103,12 +103,28 @@ def check_galactic_freefree(configs):
return results
+def check_galactic_snr(configs):
+ """Check the "[galactic][snr]" section of the configurations."""
+ comp = "galactic/snr"
+ comp_enabled = configs.getn("common/components")
+ results = {}
+ if comp in comp_enabled:
+ # Only validate the configs if this component is enabled
+ results.update(
+ _check_existence(configs, comp+"/catalog")
+ )
+ if configs.getn(comp+"/save"):
+ results.update(_check_missing(configs, comp+"/output_dir"))
+ return results
+
+
# Available checkers to validate the configurations
_CHECKERS = [
check_frequency,
check_output,
check_galactic_synchrotron,
check_galactic_freefree,
+ check_galactic_snr,
]