Skip to content

Commit

Permalink
fix cos(delta) bug
Browse files Browse the repository at this point in the history
  • Loading branch information
sblunt committed Feb 9, 2024
1 parent e20eaf4 commit 98148b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions orbitize/hipparcos.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def compute_astrometric_model(self, samples, param_idx):
Returns:
tuple of:
- float: predicted RA position offsets from the measured position
at alphadec0_epoch, calculated for each input epoch [mas]
- float: predicted RA*cos(delta0) position offsets from the measured
position at alphadec0_epoch, calculated for each input epoch [mas]
- float: predicted Dec position offsets from the measured position
at alphadec0_epoch, calculated for each input epoch [mas]
"""
Expand Down
4 changes: 3 additions & 1 deletion orbitize/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,9 @@ def compute_model(self, params_arr, use_rebound=False):
params_arr, self.param_idx
)

model[self.radec[0], 0] += ra_pred.reshape(model[self.radec[0], 0].shape)
# divide by cos(delta0) because orbitize! input is delta(ra), not
# delta(ra)*cos(delta0)
model[self.radec[0], 0] += ra_pred.reshape(model[self.radec[0], 0].shape) / np.cos(np.radians(self.pm_plx_predictor.delta0))
model[self.radec[0], 1] += dec_pred.reshape(model[self.radec[0], 0].shape)

if n_orbits == 1:
Expand Down

0 comments on commit 98148b7

Please sign in to comment.