Skip to content

Commit

Permalink
Merge branch 'add-brigtness-calc-to-comp-all-orbits' of https://githu…
Browse files Browse the repository at this point in the history
…b.com/sblunt/orbitize into add-brigtness-calc-to-comp-all-orbits
  • Loading branch information
Farrmol committed Oct 10, 2024
2 parents 7300015 + cd0c00a commit 914810d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 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
14 changes: 7 additions & 7 deletions tests/test_brightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import pandas as pd
import matplotlib.pyplot as plt

print('hello')


def test_brightness_calculation():

Expand Down Expand Up @@ -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()

0 comments on commit 914810d

Please sign in to comment.