Skip to content

Commit

Permalink
added sub-1d data arc handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rahil-makadia committed Nov 13, 2024
1 parent f585ffa commit bcd3226
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion grss/fit/fit_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,10 @@ def _get_lsq_state_correction(self, partials, residuals):
j += size
self.info_mats.append(atwa.copy())
# use pseudo-inverse if the data arc is less than 7 days
if self.obs.obsTimeMJD.max() - self.obs.obsTimeMJD.min() < 7.0:
data_arc = self.obs.obsTimeMJD.max() - self.obs.obsTimeMJD.min()
if data_arc < 1.0:
self.covariance = np.linalg.pinv(atwa, rcond=1e-10, hermitian=True)
elif data_arc < 7.0:
self.covariance = np.linalg.pinv(atwa, rcond=1e-20, hermitian=True)
else:
self.covariance = np.array(libgrss.matrix_inverse(atwa))
Expand Down

0 comments on commit bcd3226

Please sign in to comment.