Skip to content

Commit

Permalink
fix for Result File From Resumed MCMC Fails to Save #370
Browse files Browse the repository at this point in the history
  • Loading branch information
sblunt committed Aug 12, 2024
1 parent 0b8f27b commit 0145385
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions orbitize/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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'])
Expand All @@ -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
Expand Down

0 comments on commit 0145385

Please sign in to comment.