diff options
| author | Aaron LI <aaronly.me@outlook.com> | 2017-02-17 15:04:17 +0800 | 
|---|---|---|
| committer | Aaron LI <aaronly.me@outlook.com> | 2017-02-17 15:04:17 +0800 | 
| commit | 92e7991db9589045aa4b07cf6c7543f3903e1b59 (patch) | |
| tree | f02bd17976c81e127ae60d8717a33c1829e7b1c7 | |
| parent | 7a072e11681813753446fc3aeb3759f46c77b468 (diff) | |
| download | chandra-acis-analysis-92e7991db9589045aa4b07cf6c7543f3903e1b59.tar.bz2 | |
event2image.py: Use relative paths; Validate energy range
| -rwxr-xr-x | scripts/event2image.py | 9 | 
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:  | 
