Skip to content

Commit

Permalink
Complete removal of autonicer.file_find
Browse files Browse the repository at this point in the history
  • Loading branch information
nkphysics committed Dec 15, 2022
1 parent 66eaef0 commit c2a60f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
1 change: 0 additions & 1 deletion autonicer/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 2 additions & 13 deletions autonicer/autonicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import warnings
from astropy.utils.exceptions import AstropyWarning


def get_caldb_ver():
"""
Gets most up to nicer caldb version
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions autonicer/reprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

0 comments on commit c2a60f0

Please sign in to comment.