aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-08-16 23:34:04 +0800
committerAaron LI <aly@aaronly.me>2017-08-16 23:34:04 +0800
commit6c964cf5597332d874e264a3342855b0bc4f7327 (patch)
treed9a06244b9e0d15d7d5f877c00228c1c81ffcf8d
parente185edd294a1ff22c112c29e45e7eec0e6fa76cb (diff)
downloadchandra-acis-analysis-6c964cf5597332d874e264a3342855b0bc4f7327.tar.bz2
repro_acis.py: some cleanups by using update_manifest
-rwxr-xr-xbin/repro_acis.py36
1 files changed, 8 insertions, 28 deletions
diff --git a/bin/repro_acis.py b/bin/repro_acis.py
index 052414c..33d325f 100755
--- a/bin/repro_acis.py
+++ b/bin/repro_acis.py
@@ -1,9 +1,8 @@
#!/usr/bin/env python3
#
-# Copyright (c) 2017 Weitian LI <liweitianux@live.com>
+# Copyright (c) 2017 Weitian LI <weitian@aaronly.me>
# MIT license
#
-# 2017-02-27
"""
Reprocess Chandra ACIS raw "secondary" (level=1) data using the
@@ -20,6 +19,8 @@ from _context import acispy
from acispy.manifest import get_manifest
from acispy.pfiles import setup_pfiles
+import update_manifest
+
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@@ -56,36 +57,15 @@ def build_manifest(reprodir="repro", manifestfile="manifest.yaml"):
open(manifestfile, "w").close()
manifest = get_manifest(manifestfile)
- key = "directory"
- manifest.set(key, os.path.basename(os.getcwd()))
- logger.info("Added '%s' to manifest: %s" % (key, manifest.get(key)))
- key = "evt2"
- manifest.setpath(key, glob("%s/acisf*_repro_evt2.fits" % reprodir))
- logger.info("Added '%s' to manifest: %s" % (key, manifest.get(key)))
- key = "bpix"
- manifest.setpath(key, glob("%s/acisf*_repro_bpix1.fits" % reprodir))
- logger.info("Added '%s' to manifest: %s" % (key, manifest.get(key)))
- key = "asol"
- manifest.setpath(key, glob("%s/pcadf*_asol1.fits" % reprodir))
- logger.info("Added '%s' to manifest: %s" % (key, manifest.get(key)))
- key = "asol_lis"
- manifest.setpath(key, glob("%s/acisf*_asol1.lis" % reprodir))
- logger.info("Added '%s' to manifest: %s" % (key, manifest.get(key)))
- key = "fov"
- manifest.setpath(key, glob("%s/acisf*_repro_fov1.fits" % reprodir))
- logger.info("Added '%s' to manifest: %s" % (key, manifest.get(key)))
- key = "pbk"
- manifest.setpath(key, glob("%s/acisf*_pbk0.fits" % reprodir))
- logger.info("Added '%s' to manifest: %s" % (key, manifest.get(key)))
- key = "msk"
- manifest.setpath(key, glob("%s/acisf*_msk1.fits" % reprodir))
- logger.info("Added '%s' to manifest: %s" % (key, manifest.get(key)))
+ update_manifest.add_directory(manifest)
+ update_manifest.add_repro(reprodir=reprodir, manifest=manifest)
def main():
parser = argparse.ArgumentParser(
- description="Extract surface brightness profile (SBP)")
- parser.add_argument("-C", "--clobber", dest="clobber", action="store_true",
+ description="Reprocess ACIS raw data & create manifest.yaml")
+ parser.add_argument("-C", "--clobber",
+ dest="clobber", action="store_true",
help="overwrite existing file")
args = parser.parse_args()