diff --git a/orbitize/system.py b/orbitize/system.py index c016b4ba..d2ed093c 100644 --- a/orbitize/system.py +++ b/orbitize/system.py @@ -98,10 +98,15 @@ def __init__( # List of index arrays corresponding to each rv for each body self.rv = [] + # index arrays corresponding to brightness for each body + self.brightness = [] + self.fit_astrometry = True radec_indices = np.where(self.data_table["quant_type"] == "radec") seppa_indices = np.where(self.data_table["quant_type"] == "seppa") + brightness_indices = np.where(~np.isnan(self.data_table["brightness"])) + if len(radec_indices[0]) == 0 and len(seppa_indices[0]) == 0: self.fit_astrometry = False rv_indices = np.where(self.data_table["quant_type"] == "rv") @@ -140,6 +145,7 @@ def __init__( np.intersect1d(self.body_indices[body_num], seppa_indices) ) self.rv.append(np.intersect1d(self.body_indices[body_num], rv_indices)) + self.brightness.append(np.intersect1d(self.body_indices[body_num], brightness_indices)) # we should track the influence of the planet(s) on each other/the star if: # we are not fitting massless planets and @@ -302,6 +308,7 @@ def __init__( self.param_idx = self.basis.param_idx + def save(self, hf): """ Saves the current object to an hdf5 file diff --git a/tests/test_brightness.py b/tests/test_brightness.py index a1b4ca12..5073a55a 100644 --- a/tests/test_brightness.py +++ b/tests/test_brightness.py @@ -9,6 +9,8 @@ import pandas as pd import matplotlib.pyplot as plt +print('hello') + def test_brightness_calculation(): @@ -126,17 +128,15 @@ def test_compute_posteriors(): ax[1].axis('equal') plt.savefig('visual4farrah.png') - # model = test_system.compute_model(params_arr) + model = test_system.compute_model(params_arr) # print(model) - # test_mcmc = sampler.MCMC(test_system, 1, 50, num_threads=1) - - # test_mcmc.run_sampler(10) + test_mcmc = sampler.MCMC(test_system, 1, 50, num_threads=1) + test_mcmc.run_sampler(10) if __name__ == "__main__": #test_brightness_calculation() #test_read_input_with_brightness() - #test_assert_brightness() - test_assert_nan() - # test_compute_posteriors() + # test_assert_brightness() + test_compute_posteriors()