From e6deb35cf0bb5e016f9ffe51e1a74526d7daa4cc Mon Sep 17 00:00:00 2001 From: Carlisle Wishard Date: Thu, 11 Nov 2021 14:49:51 -0500 Subject: [PATCH] added check to look for BIN_OUT in directory that param is in --- python/swiftest/swiftest/simulation_class.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index 8c9ecbc7b..47be96e75 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -55,15 +55,18 @@ def __init__(self, codename="Swiftest", param_file="", readbin=True): } self.codename = codename if param_file != "" : + dir_path = os.path.dirname(os.path.realpath(param_file)) self.read_param(param_file, codename) if readbin: if os.path.exists(self.param['BIN_OUT']): self.bin2xr() + elif os.path.exists(dir_path + '/' + self.param['BIN_OUT']): + self.param['BIN_OUT'] = dir_path + '/' + self.param['BIN_OUT'] + self.bin2xr() else: print(f"BIN_OUT file {self.param['BIN_OUT']} not found.") return - def add(self, plname, date=date.today().isoformat(), idval=None): """ Adds a solar system body to an existing simulation DataSet.