diff --git a/autonicer/__init__.py b/autonicer/__init__.py index 8e5643d..c218c36 100644 --- a/autonicer/__init__.py +++ b/autonicer/__init__.py @@ -1,6 +1,5 @@ from .autonicer import AutoNICER from .autonicer import get_caldb_ver -from .autonicer import file_find from .reprocess import reprocess_check from .reprocess import inlist from .reprocess import Reprocess diff --git a/autonicer/autonicer.py b/autonicer/autonicer.py index 403cf94..6a37ddb 100644 --- a/autonicer/autonicer.py +++ b/autonicer/autonicer.py @@ -20,6 +20,7 @@ import warnings from astropy.utils.exceptions import AstropyWarning + def get_caldb_ver(): """ Gets most up to nicer caldb version @@ -29,18 +30,6 @@ def get_caldb_ver(): return convo[0] -def file_find(query): - """ - Runs a ls command and returns the contents in a list - """ - files = sp.run(f"ls {query}", shell=True, capture_output=True, encoding="utf-8") - filelist = [] - for i in str(files.stdout).split("\n"): - if i != "": - filelist.append(i) - return filelist - - class AutoNICER(object): def __init__(self, src=None, bc=None, comp=None): self.st = True @@ -106,7 +95,7 @@ def call_nicer(self): """ heasarc = Heasarc() try: - warnings.simplefilter('ignore', category=AstropyWarning) + warnings.simplefilter("ignore", category=AstropyWarning) xti = heasarc.query_object( self.obj, mission="nicermastr" ) # calls NICER master catalogue for an input object diff --git a/autonicer/reprocess.py b/autonicer/reprocess.py index 6a35026..5d3c416 100644 --- a/autonicer/reprocess.py +++ b/autonicer/reprocess.py @@ -146,13 +146,13 @@ def inlist(argp): """ cwd = os.getcwd() try: - df = pd.read_csv(f"{argp.inlist}") + df = pd.read_csv(f"{argp.inlist}") for i in df["Input"]: path_sep = i.split("/xti/event_cl/") os.chdir(path_sep[0]) if argp.checkcal is True or argp.reprocess is True: reprocess_check(argp) os.chdir(cwd) - + except FileNotFoundError: print(colored(f"{argp.inlist} NOT FOUND ", "red"))