From 54a984339a270877d3b0307e2e6268e89f037819 Mon Sep 17 00:00:00 2001 From: Sarah Blunt Date: Wed, 14 Oct 2026 21:05:03 -0600 Subject: [PATCH 1/6] hotfix for brandt_correction breaking save/load --- orbitize/hipparcos.py | 2 ++ orbitize/results.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/orbitize/hipparcos.py b/orbitize/hipparcos.py index d5ec2f31..cb770712 100644 --- a/orbitize/hipparcos.py +++ b/orbitize/hipparcos.py @@ -201,6 +201,7 @@ def __init__( self.alphadec0_epoch = alphadec0_epoch self.hip_data = hip_data + self.brandt_correction = brandt_correction # dvd files don't contain the Hipparcos astrometric solution, so # we need to look it up @@ -371,6 +372,7 @@ def _save(self, hf): if self.hip_data is not None: hip_data_group = hf.create_group("hip_data") hip_data_group.update(self.hip_data) + hf.attrs["brandt_correction"] = self.brandt_correction def compute_lnlike(self, raoff_model, deoff_model, samples, param_idx): """ diff --git a/orbitize/results.py b/orbitize/results.py index 4d597246..5ead2d38 100644 --- a/orbitize/results.py +++ b/orbitize/results.py @@ -315,6 +315,7 @@ def load_results(self, filename, append=False): hip_data = {key : hip_data_raw[key][()] for key in hip_data_raw.keys()} else: hip_data = None + brandt_correction = bool(hf.attrs.get("brandt_correction", False)) hipparcos_IAD = orbitize.hipparcos.HipparcosLogProb( tmpfile, @@ -322,7 +323,8 @@ def load_results(self, filename, append=False): num_secondary_bodies, alphadec0_epoch, renormalize_errors, - hip_data, + hip_data=hip_data, + brandt_correction=brandt_correction ) # load Gaia data From 12434c1d336db92d13a47e619d314ebe2dc76763 Mon Sep 17 00:00:00 2001 From: Sarah Blunt Date: Thu, 15 Oct 2026 14:31:32 -0600 Subject: [PATCH 2/6] up number of mcmc steps in test_fit_selfconsist --- tests/test_multiplanet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_multiplanet.py b/tests/test_multiplanet.py index 0ba452c6..f352fdf6 100644 --- a/tests/test_multiplanet.py +++ b/tests/test_multiplanet.py @@ -236,7 +236,7 @@ def test_fit_selfconsist(): samp.curr_pos[0, 0, 4] = mass_b samp.curr_pos[0, 0, 5] = mass_c - samp.run_sampler(n_walkers * 200, burn_steps=200) + samp.run_sampler(n_walkers * 500, burn_steps=500) res = samp.results From 11bdae217db65545a10f547e9236542c1d7565d7 Mon Sep 17 00:00:00 2001 From: Sarah Blunt Date: Thu, 15 Oct 2026 17:15:38 -0600 Subject: [PATCH 3/6] load hgca from orbitize datadir if hgca_entry is none in legacy hdf5 save files --- orbitize/results.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/orbitize/results.py b/orbitize/results.py index 5ead2d38..ac7fe167 100644 --- a/orbitize/results.py +++ b/orbitize/results.py @@ -8,6 +8,7 @@ import orbitize.basis import orbitize.plot import orbitize.gaia, orbitize.hipparcos +from orbitize import DATADIR class Results(object): """ @@ -348,11 +349,16 @@ def load_results(self, filename, append=False): tmptbl.write(tmpfile, format="ascii", overwrite=True) hgca_entry_raw = hf.get("HGCA_entry") + hgca_entry = None if hgca_entry_raw is None: - raise KeyError("HGCA Entry not found in {} for initializing HGCALogProb".format(filename)) - hgca_entry = {key : hgca_entry_raw[key][()] for key in hgca_entry_raw.keys()} - - gaia = orbitize.gaia.HGCALogProb(int(hip_num), hipparcos_IAD, tmpfile, hgca_entry=hgca_entry) + if os.path.exists(os.path.join(DATADIR, "HGCA_vEDR3.fits")): + hgca_filepath = os.path.join(DATADIR, "HGCA_vEDR3.fits") + else: + raise KeyError("HGCA Entry not found in {} for initializing HGCALogProb".format(filename)) + else: + hgca_entry = {key : hgca_entry_raw[key][()] for key in hgca_entry_raw.keys()} + + gaia = orbitize.gaia.HGCALogProb(int(hip_num), hipparcos_IAD, tmpfile, hgca_filepath=hgca_filepath, hgca_entry=hgca_entry) hipparcos_IAD = None # HGCA handles hipparocs, so don't want to pass Hipparcos also into the system From 5da0837cf8513809e24703469ce436adb37ae422 Mon Sep 17 00:00:00 2001 From: Sarah Blunt Date: Thu, 15 Oct 2026 17:20:59 -0600 Subject: [PATCH 4/6] this unit test will pass if it's the last thing I do (up # steps for multiplanet self conisistency fit) --- tests/test_multiplanet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_multiplanet.py b/tests/test_multiplanet.py index f352fdf6..a296e1fb 100644 --- a/tests/test_multiplanet.py +++ b/tests/test_multiplanet.py @@ -236,7 +236,7 @@ def test_fit_selfconsist(): samp.curr_pos[0, 0, 4] = mass_b samp.curr_pos[0, 0, 5] = mass_c - samp.run_sampler(n_walkers * 500, burn_steps=500) + samp.run_sampler(n_walkers * 1000, burn_steps=1000) res = samp.results From d5ca74b6532b7965662e696c3e8391836df8f5f8 Mon Sep 17 00:00:00 2001 From: Sarah Blunt Date: Tue, 20 Oct 2026 16:26:25 -0600 Subject: [PATCH 5/6] set default hgca_filepath=None when loading results --- orbitize/results.py | 1 + 1 file changed, 1 insertion(+) diff --git a/orbitize/results.py b/orbitize/results.py index ac7fe167..1c68f62e 100644 --- a/orbitize/results.py +++ b/orbitize/results.py @@ -342,6 +342,7 @@ def load_results(self, filename, append=False): # alternatively load HGCA. Note requires hipparcos_IAD attribute gaiagost_data = hf.get("Gaia_GOST") + hgca_filepath = None if gaiagost_data is not None: tmpfile = 'tmpfile_gost_OkToDeleteAfterFitFinishes' From e9511c199bf8974ca31a55b8eec425cb9c7d2d7b Mon Sep 17 00:00:00 2001 From: Sarah Blunt Date: Tue, 20 Oct 2026 16:54:55 -0600 Subject: [PATCH 6/6] start walkers closer to true locations to hopefully make one annoying test pass without increasing step # again --- tests/test_multiplanet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_multiplanet.py b/tests/test_multiplanet.py index a296e1fb..a76173ef 100644 --- a/tests/test_multiplanet.py +++ b/tests/test_multiplanet.py @@ -231,8 +231,8 @@ def test_fit_selfconsist(): samp.curr_pos[0, :, 2] = np.random.normal(c_params[0], 0.01, n_walkers) # sma samp.curr_pos[0, :, 3] = np.random.normal(c_params[-1], 0.01, n_walkers) # tau # we will make a fairly broad mass starting position - samp.curr_pos[0, :, 4] = np.random.uniform(mass_b * 0.25, mass_b * 4, n_walkers) - samp.curr_pos[0, :, 5] = np.random.uniform(mass_c * 0.25, mass_c * 4, n_walkers) + samp.curr_pos[0, :, 4] = np.random.uniform(mass_b * 0.5, mass_b * 2, n_walkers) + samp.curr_pos[0, :, 5] = np.random.uniform(mass_c * 0.5, mass_c * 2, n_walkers) samp.curr_pos[0, 0, 4] = mass_b samp.curr_pos[0, 0, 5] = mass_c