Skip to content

Commit

Permalink
reimplement tmiddle; fixes #15
Browse files Browse the repository at this point in the history
  • Loading branch information
j-faria committed May 15, 2024
1 parent 9fa53b6 commit d36f5e3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/kima/pykima/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ class data_holder:
def __repr__(self):
return f'data_holder(N={self.N}, t, y, e, obs)'

@property
def tmiddle(self):
return self.t.min() + 0.5 * self.t.ptp()


@dataclass
class astrometric_data_holder:
Expand Down Expand Up @@ -729,8 +733,6 @@ def __repr__(self):
# self.astrometric_data.N = data['mjd'].size


# self.tmiddle = self.data.t.min() + 0.5 * self.data.t.ptp()

def _read_jitters(self):
i1, i2 = self._current_column, self._current_column + self.n_jitters
self.jitter = self.posterior_sample[:, i1:i2]
Expand Down Expand Up @@ -2017,9 +2019,9 @@ def eval_model(self, sample, t=None,
# added so the last coefficient is 0
trend_par = np.r_[trend_par[::-1], 0.0]
if self.model in ('RVFWHMmodel', 'RVFWHMRHKmodel'):
v[0, :] += np.polyval(trend_par, t - self.tmiddle)
v[0, :] += np.polyval(trend_par, t - self.data.tmiddle)
else:
v += np.polyval(trend_par, t - self.tmiddle)
v += np.polyval(trend_par, t - self.data.tmiddle)

# TODO: check if _extra_data is always read correctly
if hasattr(self, 'indicator_correlations') and self.indicator_correlations and include_indicator_correlations:
Expand Down

0 comments on commit d36f5e3

Please sign in to comment.