aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2017-02-17 15:04:17 +0800
committerAaron LI <aaronly.me@outlook.com>2017-02-17 15:04:17 +0800
commit92e7991db9589045aa4b07cf6c7543f3903e1b59 (patch)
treef02bd17976c81e127ae60d8717a33c1829e7b1c7 /scripts
parent7a072e11681813753446fc3aeb3759f46c77b468 (diff)
downloadchandra-acis-analysis-92e7991db9589045aa4b07cf6c7543f3903e1b59.tar.bz2
event2image.py: Use relative paths; Validate energy range
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/event2image.py9
1 files 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: