aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/analyze_path.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/analyze_path.py')
-rwxr-xr-xscripts/analyze_path.py39
1 files changed, 2 insertions, 37 deletions
diff --git a/scripts/analyze_path.py b/scripts/analyze_path.py
index dc33dcd..40ac393 100755
--- a/scripts/analyze_path.py
+++ b/scripts/analyze_path.py
@@ -15,44 +15,9 @@ The root directory of the object data has the format:
import os
import argparse
-import re
-
-RE_DATA_DIR = re.compile(r"^.*/(?P<name>[^/_]+)_oi(?P<obsid>\d+).*$")
-
-
-def get_name(path):
- """
- Extract the object name from the directory path.
-
- Parameters
- ----------
- path : str
- Path to the data directory
-
- Returns
- -------
- objname : str
- The name part of the data directory
- """
- return RE_DATA_DIR.match(path).group("name")
-
-
-def get_obsid(path):
- """
- Extract the observation ID from the directory path.
-
- Parameters
- ----------
- path : str
- Path to the data directory
-
- Returns
- -------
- obsid : int
- The observation ID of the data
- """
- return int(RE_DATA_DIR.match(path).group("obsid"))
+from context import acispy
+from acispy.analyze_path import get_name, get_obsid
def main():