Skip to content

Commit

Permalink
mcmc running
Browse files Browse the repository at this point in the history
  • Loading branch information
sblunt committed Oct 8, 2024
1 parent b37f60d commit cd0c00a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 7 additions & 0 deletions orbitize/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions tests/test_brightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,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_compute_posteriors()
# test_assert_brightness()
test_compute_posteriors()

0 comments on commit cd0c00a

Please sign in to comment.