aboutsummaryrefslogtreecommitdiffstats
path: root/acispy
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2017-02-23 18:19:13 +0800
committerAaron LI <aaronly.me@outlook.com>2017-02-23 18:19:13 +0800
commit4a82a0d0a01f1dc3dd952194c516c441ec8f71c7 (patch)
treea6b6431a6e2184bf68c10e5428b7d14475efbebe /acispy
parent6c495bbcfaeb793969f082d953d55d3a9ef91aaf (diff)
downloadchandra-acis-analysis-4a82a0d0a01f1dc3dd952194c516c441ec8f71c7.tar.bz2
acis.py: Update argument 'sep' handling for get_chips_str()
Diffstat (limited to 'acispy')
-rw-r--r--acispy/acis.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/acispy/acis.py b/acispy/acis.py
index 91d9fcf..f1d92ac 100644
--- a/acispy/acis.py
+++ b/acispy/acis.py
@@ -64,7 +64,7 @@ class ACIS:
raise ValueError("unknown chip combination: %s" % detnam)
@classmethod
- def get_chips_str(self, filepath, sep=":"):
+ def get_chips_str(self, filepath, sep=None):
"""
Return a string of the chips of interest according to the
active ACIS type.
@@ -74,17 +74,21 @@ class ACIS:
filepath : str
Path to the input FITS file
sep : str, optional
- Separator to join the chip ranges, e.g., 0:3, 0-3
+ Use a separator to join the chip ranges (e.g., ``0:3``, ``0-3``)
+ instead of including all chips (e.g., ``0123``).
Returns
-------
chips : str
- ``0:3`` if ACIS-I, ``7`` if ACIS-S;
+ ``0123`` or ``0<sep>3`` if ACIS-I, ``7`` if ACIS-S;
otherwise, ``ValueError`` raised.
"""
acis_type = self.get_type(filepath)
if acis_type == "I":
- return sep.join(["0", "3"])
+ if sep is None:
+ return "0123"
+ else:
+ return sep.join(["0", "3"])
elif acis_type == "S":
return "7"
else: