From 01453853bd87429a288032e5c2d85e107b3558e5 Mon Sep 17 00:00:00 2001 From: Sarah Blunt Date: Mon, 12 Aug 2024 11:47:03 -0700 Subject: [PATCH] fix for Result File From Resumed MCMC Fails to Save #370 --- orbitize/results.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/orbitize/results.py b/orbitize/results.py index ba502574..cecacaff 100644 --- a/orbitize/results.py +++ b/orbitize/results.py @@ -197,7 +197,7 @@ def load_results(self, filename, append=False): iad_data = hf.get("IAD_datafile") if iad_data is not None: - tmpfile = 'thisisprettyhackysorrylmao' + tmpfile = 'tmpfile_OkToDeleteAfterFitFinishes' with open(tmpfile, 'w+') as f: try: for l in np.array(iad_data): @@ -218,8 +218,6 @@ def load_results(self, filename, append=False): renormalize_errors, ) - os.system('rm {}'.format(tmpfile)) - # load Gaia data try: gaia_num = int(hf.attrs['gaia_num']) @@ -232,14 +230,14 @@ def load_results(self, filename, append=False): gaiagost_data = hf.get("Gaia_GOST") if gaiagost_data is not None: - tmpfile = 'thisisprettyhackysorrylmao' + tmpfile = 'tmpfile_OkToDeleteAfterFitFinishes' tmptbl = table.Table(np.array(gaiagost_data)) tmptbl.write(tmpfile, format="ascii", overwrite=True) gaia = orbitize.gaia.HGCALogProb(int(hip_num), hipparcos_IAD, tmpfile) hipparcos_IAD = None # HGCA handles hipparocs, so don't want to pass Hipparcos also into the system - os.system('rm {}'.format(tmpfile)) + else: hipparcos_IAD = None gaia = None