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.