From 92e7991db9589045aa4b07cf6c7543f3903e1b59 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 17 Feb 2017 15:04:17 +0800 Subject: event2image.py: Use relative paths; Validate energy range --- scripts/event2image.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/event2image.py b/scripts/event2image.py index cba1d89..ba5e216 100755 --- a/scripts/event2image.py +++ b/scripts/event2image.py @@ -72,10 +72,15 @@ def main(): setup_pfiles(["dmkeypar", "dmcopy"]) manifest = get_manifest() - fov = manifest.getpath("fov") - infile = args.infile if args.infile else manifest.getpath("evt2_clean") + fov = manifest.getpath("fov", relative=True) + if args.infile: + infile = args.infile + else: + infile = manifest.getpath("evt2_clean", relative=True) chips = ACIS.get_chips_str(infile, sep="-") erange = "{elow}-{ehigh}".format(elow=args.elow, ehigh=args.ehigh) + if args.elow >= args.ehigh: + raise ValueError("invalid energy range: %s" % erange) if args.outfile: outfile = args.outfile else: -- cgit v1.2.2