From 6b14162d0b9a464be102daf0b0ff791a7b9e9f48 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 17 Oct 2016 15:18:58 +0800 Subject: configs/validate.py: Add "check_galactic_snr()" for "galactic/snr" --- fg21sim/configs/validate.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'fg21sim/configs') 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, ] -- cgit v1.2.2