rahil-makadia / grss

Gauss-Radau Small-body Simulator. Maintainer: @rahil-makadia
https://rahil-makadia.github.io/grss/
MIT License
5 stars 0 forks source link

invalid value & more frequent outlier rejection failure #48

Closed Pachacoti closed 8 months ago

Pachacoti commented 8 months ago

I did a git pull to update grss but then I started to have the following issues popping out frequently with exactly the same steps of downloading optical + radar observations.

Issue 1:

Software/anaconda3/lib/python3.9/site-packages/grss/fit/fit_simulation.py:47: RuntimeWarning: invalid value encountered in sqrt
  variance = np.sqrt(np.diag(self.covariance))

Issue 2: The package seems to be more vulnerable to rejection of `bad' Gaia FPR observations compared to before. The following example is with 5786:

1            0.501           9.000           825.862             0.301
2            0.861           9.682           2229.015            0.811
3            3.579           29.089          38730.936           14.094
4            23.208          171.871             1582192.194             575.761
5            141.711             1038.769            58744111.822            21377.042
6            857.477             6260.708            2145982043.198          780925.052
7            65441.396           81808.656           14619462321301.691          5320037234.826
8            111617.170          244251.420          35633434073642.562          12967042967.119
9            325809.396          1169012.455             447851888690552.000             162973758621.016
Warning: Downleg light time did not converge for body integBody_pert_w_minus at time 58017.4, change from previous iteration was 1.43635e-15
10           403163.630          42274032.154            1835539810212089.500            667954807209.640
WARNING: Maximum number of iterations reached without converging.

After getting rid of the Gaia FPR observations, the convergence is quick:

Iteration       Unweighted RMS      Weighted RMS        Chi-squared     Reduced Chi-squared
1            0.530           0.553           733.074             0.307
2            0.527           0.548           719.551             0.301
3            0.527           0.548           719.551             0.301
Converged without rejecting outliers. Starting outlier rejection now...
4            0.466           0.493           582.173             0.245
5            0.466           0.492           580.154             0.245
6            0.466           0.492           580.154             0.245
Converged after rejecting outliers. Rejected 9 out of 1198 optical observations.

The previous outlier rejection algorithm may have worked even better.

rahil-makadia commented 8 months ago

Hi @Pachacoti, I have been playing around with short-arc OD and made some changes for inverting the information matrix in those cases that were being applied to all fits because I forgot to push my latest changes to main. I have done so now (if you're using pip, give it a few minutes to upload to PyPI). It should eliminate issue 1 and start converging for issue 2 as well. Feel free to reopen the issue if you run into issues...

Just a heads up, even though observation datasets with Gaia FPR data might converge, the FPR observations actually have so much information that they need me to update my observation models for some detailed physical effects. This will be one of my focuses for this Spring/Summer so stay tuned on better residuals for the FPR measurements soon :)