(12104) Chesley orbit determination test#

Let’s start by importing the necessary libraries#

[1]:
from grss import fit
import numpy as np
np.set_printoptions(precision=40, linewidth=np.inf)

We’ll then retrieve the cometary state of the asteroid (from JPL SBDB) plus any nongravitational accelerations acting on it.#

[2]:
body_id = '12104'
init_sol, init_cov, nongrav_info = fit.get_sbdb_info(body_id)
de_kernel = 440

Next, we’ll retrieve the observations from different sources (MPC, JPL, Gaia Data Releases) and prepare them for the orbit determination process.#

[3]:
add_gaia_obs = True
optical_obs_file = None
t_min_tdb = None
t_max_tdb = None
debias_lowres = True
deweight = True
eliminate = False
num_obs_per_night = 4
verbose = True
obs_df = fit.get_optical_obs(body_id, optical_obs_file, t_min_tdb, t_max_tdb, debias_lowres, deweight, eliminate, num_obs_per_night, verbose)
obs_df = fit.add_radar_obs(obs_df, t_min_tdb, t_max_tdb, verbose)
if add_gaia_obs:
    gaia_dr = 'gaiafpr'
    obs_df = fit.add_gaia_obs(obs_df, t_min_tdb, t_max_tdb, gaia_dr, verbose)
Read in 5818 observations from the MPC.
        Filtered to 5818 observations that satisfy the time range and accepted observatory constraints.
Applying Eggl et al. (2020) debiasing scheme to the observations.
        Unknown star catalog: UNK
        No debiasing needed for 4507 observations.
        Debiased 1289 observations.
        No bias information for 22 observations.
Applying Vereš et al. (2017) weighting scheme to the observations.
        Using 3504 CCD observations with station-specific weight rules.
Applying sqrt(N/4) deweighting scheme.
        Deweighted 2740 observations.
Read in 459 Gaia observations from gaiafpr
        Filtered to 459 observations that satisfy the time range constraints.

All we need to do now is initialize the OD simulation and run the filter.#

[4]:
n_iter_max = 10
fit_sim = fit.FitSimulation(init_sol, obs_df, init_cov, n_iter_max=n_iter_max, de_kernel=de_kernel, nongrav_info=nongrav_info)
[5]:
fit_sim.filter_lsq()
Iteration               Unweighted RMS          Weighted RMS            Chi-squared             Reduced Chi-squared
1                        0.732                   0.524                   3440.903                        0.274
2                        0.732                   0.524                   3440.869                        0.274
Converged without rejecting outliers. Starting outlier rejection now...
3                        0.698                   0.487                   2982.989                        0.239
Converged after rejecting outliers. Rejected 31 out of 6277 optical observations.

Let’s print some summary statistics and plot some results.#

[6]:
fit_sim.print_summary()
Summary of the orbit fit calculations after postfit pass:
==============================================================
RMS unweighted: 0.6979151384759632
RMS weighted: 0.4874552352388902
chi-squared: 2982.98866026606
reduced chi-squared: 0.23890666828976934
square root of reduced chi-squared: 0.48878079779157585
--------------------------------------------------------------
Solution Time: MJD 58159.000 TDB = 2018-02-10 00:00:00.000 TDB
Solution Observation Arc: 18017.66 days (49.33 years)
--------------------------------------------------------------
Fitted Variable         Initial Value                   Uncertainty                     Fitted Value                    Uncertainty                     Change                          Change (sigma)
e                       2.45083648419e-02               7.35930079220e-10               2.45083647315e-02               7.10615929455e-10               -1.10339078152e-10              -0.155
q                       2.93638513084e+00               3.42422204087e-09               2.93638513139e+00               3.31353296006e-09               +5.50015144540e-10              +0.166
tp                      5.87279958670e+04               6.75036815572e-06               5.87279958665e+04               6.53722073080e-06               -4.59382135887e-07              -0.070
om                      7.80639502905e+01               1.25909933063e-07               7.80639502864e+01               1.18933153478e-07               -4.03449007536e-09              -0.034
w                       1.83014067686e+02               1.33658209540e-06               1.83014067584e+02               1.29594933451e-06               -1.01715357914e-07              -0.078
i                       1.11526201204e+01               2.98911285672e-08               1.11526201218e+01               2.86070645911e-08               +1.30950716937e-09              +0.046

[7]:
fit_sim.plot_summary(auto_close=True)
../../../_images/tests_python_fit_chesley_12_0.png
[8]:
fit_sim.iters[-1].plot_iteration_summary(title='Postfit Residuals', auto_close=True)
../../../_images/tests_python_fit_chesley_13_0.png
../../../_images/tests_python_fit_chesley_13_1.png
[9]:
mean_0 = np.array(list(init_sol.values())[1:])
cov_0 = init_cov
mean_f = np.array(list(fit_sim.x_nom.values()))
cov_f = fit_sim.covariance

maha_dist_f, maha_dist_0, bhattacharya, bhatt_coeff = fit.get_similarity_stats(mean_0, cov_0, mean_f, cov_f)
print(f'Mahalonobis distance between JPL and GRSS solution: {maha_dist_f:0.2f}')
print(f'Mahalonobis distance between GRSS and JPL solution: {maha_dist_0:0.2f}')
print(f'Bhattacharya distance between JPL and GRSS solution: {bhattacharya:0.4f}')
print(f'Bhattacharya coefficient between JPL and GRSS solution: {bhatt_coeff:0.4f}')
Mahalonobis distance between JPL and GRSS solution: 0.18
Mahalonobis distance between GRSS and JPL solution: 0.19
Bhattacharya distance between JPL and GRSS solution: 0.0028
Bhattacharya coefficient between JPL and GRSS solution: 0.9972

Finally, we’ll make sure the GRSS solution is statistically consistent with the JPL SBDB solution#

[10]:
assert maha_dist_f < 5.0
assert maha_dist_0 < 5.0
assert bhattacharya < 0.10
assert bhatt_coeff > 0.90
[ ]: