import pandas as pd
import numpy as np

# Intra night association testing

# intra_night_separation_association testing

intra_sep_left_expected = pd.DataFrame(
    {
        "ra": [
            100.000,
            100.000,
            100.003,
            100.003,
            100.007,
            100.007,
            14.000,
            14.000,
            14.003,
            14.003,
            14.007,
            14.007,
        ],
        "dec": [
            8.000,
            8.000,
            8.002,
            8.002,
            8.005,
            8.005,
            16.000,
            16.000,
            15.998,
            15.998,
            15.992,
            15.992,
        ],
        "candid": [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6],
        "traj": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
    }
)

intra_sep_right_expected = pd.DataFrame(
    {
        "ra": [
            100.003,
            100.007,
            100.000,
            100.007,
            100.000,
            100.003,
            14.003,
            14.007,
            14.000,
            14.007,
            14.000,
            14.003,
        ],
        "dec": [
            8.002,
            8.005,
            8.000,
            8.005,
            8.000,
            8.002,
            15.998,
            15.992,
            16.000,
            15.992,
            16.000,
            15.998,
        ],
        "candid": [2, 3, 1, 3, 1, 2, 5, 6, 4, 6, 4, 5],
        "traj": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
    }
)

# compute_diff_mag testing

same_fid_left_expected1 = pd.DataFrame(
    {
        "ra": [
            100.000,
            100.000,
            100.003,
            100.003,
            100.007,
            100.007,
            100.001,
            100.001,
            100.003,
            100.003,
            100.008,
            100.008,
        ],
        "dec": [
            12.000,
            12.000,
            11.998,
            11.998,
            11.994,
            11.994,
            11.994,
            11.994,
            11.998,
            11.998,
            12.002,
            12.002,
        ],
        "jd": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "dcmag": [
            17.00,
            17.00,
            17.05,
            17.05,
            17.09,
            17.09,
            15.00,
            15.00,
            15.07,
            15.07,
            15.10,
            15.10,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
        "candid": [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6],
        "traj": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
    }
)


same_fid_right_expected1 = pd.DataFrame(
    {
        "ra": [
            100.003,
            100.007,
            100.000,
            100.007,
            100.000,
            100.003,
            100.003,
            100.008,
            100.001,
            100.008,
            100.001,
            100.003,
        ],
        "dec": [
            11.998,
            11.994,
            12.000,
            11.994,
            12.000,
            11.998,
            11.998,
            12.002,
            11.994,
            12.002,
            11.994,
            11.998,
        ],
        "jd": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "dcmag": [
            17.05,
            17.09,
            17.00,
            17.09,
            17.00,
            17.05,
            15.07,
            15.10,
            15.00,
            15.10,
            15.00,
            15.07,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
        "candid": [2, 3, 1, 3, 1, 2, 5, 6, 4, 6, 4, 5],
        "traj": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
    }
)


same_fid_left_expected2 = pd.DataFrame(
    {
        "ra": [100.0, 99.0, 99.8, 100.2, 100.7, 100.5],
        "dec": [12.0, 11.8, 11.2, 12.3, 11.7, 11.5],
        "jd": [1.05, 1.08, 1.09, 2.50, 2.60, 2.70],
        "dcmag": [15.00, 17.00, 16.00, 16.04, 17.03, 15.06],
        "fid": [1, 1, 1, 1, 1, 1],
        "candid": [1, 2, 3, 4, 5, 6],
        "traj": [1, 2, 3, 3, 2, 1],
    }
)


same_fid_right_expected2 = pd.DataFrame(
    {
        "ra": [100.5, 100.7, 100.2, 99.8, 99.0, 100.0],
        "dec": [11.5, 11.7, 12.3, 11.2, 11.8, 12.0],
        "jd": [2.70, 2.60, 2.50, 1.09, 1.08, 1.05],
        "dcmag": [15.06, 17.03, 16.04, 16.00, 17.00, 15.00],
        "fid": [1, 1, 1, 1, 1, 1],
        "candid": [6, 5, 4, 3, 2, 1],
        "traj": [1, 2, 3, 3, 2, 1],
    }
)


# intra_night_association testing

intra_night_test_traj = pd.DataFrame(
    {
        "ra": [
            106.305259,
            106.141905,
            169.860467,
            106.303285,
            106.141138,
            169.856885,
            106.140906,
            106.302386,
            106.140840,
            106.302364,
            169.833666,
            169.829712,
            169.829656,
        ],
        "dec": [
            18.176682,
            15.241181,
            15.206360,
            18.177874,
            15.239999,
            15.210309,
            15.239506,
            18.178404,
            15.239482,
            18.178424,
            15.236048,
            15.240389,
            15.240490,
        ],
        "dcmag": [
            0.066603,
            0.018517,
            0.038709,
            0.089385,
            0.020256,
            0.044030,
            0.021575,
            0.042095,
            0.023033,
            0.046602,
            0.032183,
            0.026171,
            0.025890,
        ],
        "ssnamenr": [
            3866,
            3051,
            19743,
            3866,
            3051,
            19743,
            3051,
            3866,
            3051,
            3866,
            19743,
            19743,
            19743,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2],
        "candid": [
            1520166712915015010,
            1520166711415015012,
            1520220641415015001,
            1520227401615015011,
            1520227400315015018,
            1520239140315015026,
            1520254695615015016,
            1520255162915015021,
            1520255630315015010,
            1520255631615015014,
            1520359440315015016,
            1520379906015015006,
            1520380381415015018,
        ],
        "jd": [
            2459274.666713,
            2459274.666713,
            2459274.7206481,
            2459274.7274074,
            2459274.7274074,
            2459274.7391435,
            2459274.7546991,
            2459274.755162,
            2459274.7556366,
            2459274.7556366,
            2459274.8594444,
            2459274.8799074,
            2459274.8803819,
        ],
    }
)

intra_night_left = pd.DataFrame(
    {
        "ra": [
            106.140906,
            106.302386,
            169.829712,
            106.141905,
            106.305259,
            169.860467,
            106.141138,
            106.303285,
            169.856885,
            169.833666,
        ],
        "dec": [
            15.239506,
            18.178404,
            15.240389,
            15.241181,
            18.176682,
            15.20636,
            15.239999,
            18.177874,
            15.210309,
            15.236048,
        ],
        "dcmag": [
            0.021575,
            0.042095,
            0.026171,
            0.018517,
            0.066603,
            0.038709,
            0.020256,
            0.089385,
            0.04403,
            0.032183,
        ],
        "ssnamenr": [3051, 3866, 19743, 3051, 3866, 19743, 3051, 3866, 19743, 19743],
        "fid": [2, 2, 2, 1, 1, 1, 1, 1, 1, 2],
        "candid": [
            1520254695615015016,
            1520255162915015021,
            1520379906015015006,
            1520166711415015012,
            1520166712915015010,
            1520220641415015001,
            1520227400315015018,
            1520227401615015011,
            1520239140315015026,
            1520359440315015016,
        ],
        "jd": [
            2459274.754699,
            2459274.755162,
            2459274.879907,
            2459274.666713,
            2459274.666713,
            2459274.720648,
            2459274.727407,
            2459274.727407,
            2459274.739144,
            2459274.859444,
        ],
    }
)

intra_night_right = pd.DataFrame(
    {
        "ra": [
            106.14084,
            106.302364,
            169.829656,
            106.141138,
            106.303285,
            169.856885,
            106.140906,
            106.302386,
            169.833666,
            169.829712,
        ],
        "dec": [
            15.239482,
            18.178424,
            15.24049,
            15.239999,
            18.177874,
            15.210309,
            15.239506,
            18.178404,
            15.236048,
            15.240389,
        ],
        "dcmag": [
            0.023033,
            0.046602,
            0.02589,
            0.020256,
            0.089385,
            0.04403,
            0.021575,
            0.042095,
            0.032183,
            0.026171,
        ],
        "ssnamenr": [3051, 3866, 19743, 3051, 3866, 19743, 3051, 3866, 19743, 19743],
        "fid": [2, 2, 2, 1, 1, 1, 2, 2, 2, 2],
        "candid": [
            1520255630315015010,
            1520255631615015014,
            1520380381415015018,
            1520227400315015018,
            1520227401615015011,
            1520239140315015026,
            1520254695615015016,
            1520255162915015021,
            1520359440315015016,
            1520379906015015006,
        ],
        "jd": [
            2459274.755637,
            2459274.755637,
            2459274.880382,
            2459274.727407,
            2459274.727407,
            2459274.739144,
            2459274.754699,
            2459274.755162,
            2459274.859444,
            2459274.879907,
        ],
    }
)


# Night to night association testing

# Cone search association testing

# Association that match the angle criterion
cone_search_two_last_observation_sample = pd.DataFrame(
    {
        "ra": [1, 2, 4, 5, 5, 6, 1, 2],
        "dec": [8, 7, 1, 2, 4, 8, 1, 1],
        "jd": [1, 2, 1, 2, 1, 2, 1, 2],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17],
        "trajectory_id": [20, 20, 21, 21, 22, 22, 23, 23],
    }
)

traj_assoc_sample = pd.DataFrame(
    {
        "ra": [2, 5, 6, 2],
        "dec": [7, 2, 8, 1],
        "jd": [2, 2, 2, 2],
        "candid": [11, 13, 15, 17],
        "trajectory_id": [20, 21, 22, 23],
    }
)

new_obs_assoc_sample = pd.DataFrame(
    {
        "ra": [3, 6, 7, 3],
        "dec": [6, 3, 9, 1],
        "jd": [3, 3, 3, 3],
        "candid": [18, 19, 20, 21],
        "trajectory_id": [30, 31, 32, 33],
    }
)

left_cone_search_expected = pd.DataFrame(
    {
        "ra": [2, 5, 6, 2],
        "dec": [7, 2, 8, 1],
        "jd": [2, 2, 2, 2],
        "candid": [11, 13, 15, 17],
        "trajectory_id": [20, 21, 22, 23],
    }
)

right_cone_search_expected = pd.DataFrame(
    {
        "ra": [3, 6, 7, 3],
        "dec": [6, 3, 9, 1],
        "jd": [3, 3, 3, 3],
        "candid": [18, 19, 20, 21],
        "tmp_traj": [30, 31, 32, 33],
        "trajectory_id": [20, 21, 22, 23],
    }
)

# Association that not match the angle criterion
false_cone_search_two_last_observation_sample = pd.DataFrame(
    {
        "ra": [2, 3, 8, 9, 7, 8],
        "dec": [1, 2, 2, 3, 5, 6],
        "jd": [1, 2, 1, 2, 1, 2],
        "candid": [10, 11, 12, 13, 14, 15],
        "trajectory_id": [20, 20, 21, 21, 22, 22],
    }
)

false_traj_assoc_sample = pd.DataFrame(
    {
        "ra": [3, 9, 8],
        "dec": [2, 3, 6],
        "jd": [2, 2, 2],
        "candid": [11, 13, 15],
        "trajectory_id": [20, 21, 22],
    }
)

false_new_obs_assoc_sample = pd.DataFrame(
    {
        "ra": [4, 8, 7],
        "dec": [1, 5, 7],
        "jd": [3, 3, 3],
        "candid": [16, 17, 18],
        "trajectory_id": [30, 31, 32],
    }
)

# Night to night trajectory association testing

night_to_night_two_last_sample = pd.DataFrame(
    {
        "ra": [1, 2, 5, 6, 10, 11, 1, 2, 7, 7, 1, 8],
        "dec": [1, 2, 1, 1, 1, 1, 6, 7, 7, 8, 11, 6],
        "dcmag": [13, 13.05, 15, 15.08, 17, 17.03, 16, 16.04, 17, 17.1, 14, 18],
        "fid": [1, 2, 1, 1, 2, 2, 1, 2, 2, 2, 1, 1],
        "jd": [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5],
    }
)

night_to_night_new_observation = pd.DataFrame(
    {
        "ra": [3, 7, 10.5, 2, 3, 4, 11, 8],
        "dec": [3, 2, 2, 8, 7, 9, 9, 9],
        "dcmag": [13.1, 15.13, 17.06, 16.07, 16.05, 15, 18, 18.5],
        "fid": [2, 1, 1, 1, 2, 1, 2, 2],
        "jd": [3, 3, 3, 3, 3, 3, 3, 3],
        "candid": [22, 23, 24, 25, 26, 27, 28, 29],
    }
)

night_to_night_traj_assoc_left_expected = pd.DataFrame(
    {
        "trajectory_id": [0, 1, 3, 3],
        "ra": [2, 6, 2, 2],
        "dec": [2, 1, 7, 7],
        "dcmag": [13.05, 15.08, 16.04, 16.04],
        "fid": [2, 1, 2, 2],
        "jd": [2, 2, 2, 2],
        "candid": [11, 13, 17, 17],
    }
)

night_to_night_traj_assoc_right_expected = pd.DataFrame(
    {
        "ra": [3.0, 7, 3, 2],
        "dec": [3, 2, 7, 8],
        "dcmag": [13.10, 15.13, 16.05, 16.07],
        "fid": [2, 1, 2, 1],
        "jd": [3, 3, 3, 3],
        "candid": [22, 23, 26, 25],
        "trajectory_id": [0, 1, 3, 3],
    }
)


# trajectory associations testing

trajectory_df_sample = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10],
        "dec": [1, 2, 3, 12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3],
        "dcmag": [
            12.02,
            12.05,
            12.3,
            15,
            15.1,
            15.23,
            13,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16,
            16.4,
            16.7,
        ],
        "fid": [1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
        "trajectory_id": [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5],
    }
)

traj_next_night_sample = pd.DataFrame(
    {
        "ra": [4, 5, 1, 1, 8, 7, 13, 13],
        "dec": [4, 5, 9, 8, 7, 8, 1, 2],
        "dcmag": [12.4, 12.52, 15.94, 15.47, 17.31, 17.43, 16.21, 16.28],
        "fid": [1, 1, 2, 1, 1, 1, 2, 2],
        "nid": [4, 4, 4, 4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.1, 4.2, 4.1, 4.2],
        "candid": [25, 26, 27, 28, 29, 30, 31, 32],
        "trajectory_id": [10, 10, 11, 11, 12, 12, 13, 13],
    }
)

new_observations_sample = pd.DataFrame(
    {
        "ra": [5, 5, 10, 9, 13],
        "dec": [1, 10, 4, 10, 11],
        "dcmag": [13.42, 17.5, 16.82, 15.86, 16.49],
        "fid": [2, 2, 1, 2, 1],
        "nid": [4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.2, 4.2, 4.3],
        "candid": [33, 34, 35, 36, 37],
    }
)

trajectory_df_expected = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 4, 5, 8, 7, 10],
        "dec": [1, 2, 3, 12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 4, 5, 7, 8, 4],
        "dcmag": [
            12.02,
            12.05,
            12.30,
            15.00,
            15.10,
            15.23,
            13.00,
            12.60,
            12.75,
            17.02,
            17.15,
            17.27,
            16.00,
            16.40,
            16.70,
            12.40,
            12.52,
            17.31,
            17.43,
            16.82,
        ],
        "fid": [1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 4, 4],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.1,
            4.2,
            4.1,
            4.2,
            4.2,
        ],
        "candid": [
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            29,
            30,
            35,
        ],
        "trajectory_id": [
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            3.0,
            3.0,
            3.0,
            4.0,
            4.0,
            4.0,
            5.0,
            5.0,
            5.0,
            1.0,
            1.0,
            4.0,
            4.0,
            5.0,
        ],
    }
)

traj_next_night_expected = pd.DataFrame(
    {
        "ra": [1, 1, 13, 13],
        "dec": [9, 8, 1, 2],
        "dcmag": [15.94, 15.47, 16.21, 16.28],
        "fid": [2, 1, 2, 2],
        "nid": [4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2],
        "candid": [27, 28, 31, 32],
        "trajectory_id": [11, 11, 13, 13],
    }
)

new_observations_expected = pd.DataFrame(
    {
        "ra": [5, 5, 9, 13],
        "dec": [1, 10, 10, 11],
        "dcmag": [13.42, 17.50, 15.86, 16.49],
        "fid": [2, 2, 2, 1],
        "nid": [4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.2, 4.3],
        "candid": [33, 34, 36, 37],
    }
)

trajectory_df_expected2 = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 4, 5, 8, 7],
        "dec": [1, 2, 3, 12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 4, 5, 7, 8],
        "dcmag": [
            12.02,
            12.05,
            12.30,
            15.00,
            15.10,
            15.23,
            13.00,
            12.60,
            12.75,
            17.02,
            17.15,
            17.27,
            16.00,
            16.40,
            16.70,
            12.40,
            12.52,
            17.31,
            17.43,
        ],
        "fid": [1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 4],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.1,
            4.2,
            4.1,
            4.2,
        ],
        "candid": [
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            29,
            30,
        ],
        "trajectory_id": [
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            3.0,
            3.0,
            3.0,
            4.0,
            4.0,
            4.0,
            5.0,
            5.0,
            5.0,
            1.0,
            1.0,
            4.0,
            4.0,
        ],
    }
)

trajectory_df_expected_empty = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 10],
        "dec": [1, 2, 3, 12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 4],
        "dcmag": [
            12.02,
            12.05,
            12.30,
            15.00,
            15.10,
            15.23,
            13.00,
            12.60,
            12.75,
            17.02,
            17.15,
            17.27,
            16.00,
            16.40,
            16.70,
            16.82,
        ],
        "fid": [1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.2,
        ],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 35],
        "trajectory_id": [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5],
    }
)

expected_trajectory_first_report = {
    "list of updated trajectories": [1.0, 4.0, 5.0],
    "all nid report": [
        {
            "old nid": 3,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        }
    ],
}


expected_trajectory_second_report = {
    "list of updated trajectories": [5.0],
    "all nid report": [
        {
            "old nid": 3,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        }
    ],
}

expected_trajectory_third_report = {
    "list of updated trajectories": [],
    "all nid report": [
        {
            "old nid": 3,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "trajectories_to_new_observation_report": {},
        }
    ],
}

# tracklets and observations associations testing

track_and_obs_trajectory_df_sample = pd.DataFrame(
    {
        "ra": [1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10],
        "dec": [12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3],
        "dcmag": [
            15,
            15.1,
            15.23,
            13,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16,
            16.4,
            16.7,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
        "candid": [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
        "trajectory_id": [2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5],
    }
)

track_and_obs_traj_next_night_sample = pd.DataFrame(
    {
        "ra": [2, 3, 7, 8],
        "dec": [2, 3, 1, 2],
        "dcmag": [15.74, 15.47, 16.21, 16.28],
        "fid": [2, 1, 2, 2],
        "nid": [4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2],
        "candid": [27, 28, 31, 32],
        "trajectory_id": [11, 11, 13, 13],
    }
)

track_and_obs_old_observations_sample = pd.DataFrame(
    {
        "ra": [1, 1, 4, 3, 6, 7, 9],
        "dec": [1, 5, 1, 5, 1, 7, 5],
        "dcmag": [15.52, 16.32, 14.96, 16.28, 16.03, 18.52, 17.68],
        "fid": [2, 1, 2, 2, 2, 1, 1],
        "nid": [2, 1, 3, 3, 3, 3, 3],
        "jd": [2.1, 1.2, 3.1, 3.2, 3.1, 3.2, 3.1],
        "candid": [33, 34, 35, 36, 37, 38, 39],
    }
)

track_and_obs_new_observations_sample = pd.DataFrame(
    {
        "ra": [2, 4, 6, 5, 10],
        "dec": [9, 6, 3, 10, 4],
        "dcmag": [15.52, 16.32, 14.96, 18.52, 17.99],
        "fid": [2, 1, 2, 1, 2],
        "nid": [4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.1],
        "candid": [40, 41, 42, 43, 44],
    }
)

track_and_obs_trajectory_df_expected = pd.DataFrame(
    {
        "ra": [
            1,
            2,
            2,
            6,
            7,
            8,
            6,
            7,
            8,
            9,
            10,
            10,
            3,
            9,
            4,
            10,
            1,
            2,
            2,
            3,
            7,
            8,
            6,
            1,
        ],
        "dec": [
            12,
            11,
            10,
            12,
            12,
            12,
            6,
            5,
            6,
            1,
            2,
            3,
            5,
            5,
            6,
            4,
            5,
            9,
            2,
            3,
            1,
            2,
            1,
            1,
        ],
        "dcmag": [
            15.00,
            15.10,
            15.23,
            13.00,
            12.60,
            12.75,
            17.02,
            17.15,
            17.27,
            16.00,
            16.40,
            16.70,
            16.28,
            17.68,
            16.32,
            17.99,
            16.32,
            15.52,
            15.74,
            15.47,
            16.21,
            16.28,
            16.03,
            15.52,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 3, 3, 4, 4, 1, 4, 4, 4, 4, 4, 3, 2],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            3.2,
            3.1,
            4.2,
            4.1,
            1.2,
            4.1,
            4.1,
            4.2,
            4.1,
            4.2,
            3.1,
            2.1,
        ],
        "candid": [
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            36,
            39,
            41,
            44,
            34,
            40,
            27,
            28,
            31,
            32,
            37,
            33,
        ],
        "trajectory_id": [
            2,
            2,
            2,
            3,
            3,
            3,
            4,
            4,
            4,
            5,
            5,
            5,
            6,
            7,
            6,
            7,
            8,
            8,
            11,
            11,
            13,
            13,
            13,
            11,
        ],
    }
)

track_and_obs_old_observations_expected = pd.DataFrame(
    {
        "ra": [4, 7, 6, 5],
        "dec": [1, 7, 3, 10],
        "dcmag": [14.96, 18.52, 14.96, 18.52],
        "fid": [2, 1, 2, 1],
        "nid": [3, 3, 4, 4],
        "jd": [3.1, 3.2, 4.1, 4.2],
        "candid": [35, 38, 42, 43],
    }
)


track_and_obs_trajectory_df_expected2 = pd.DataFrame(
    {
        "ra": [1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 3, 9, 4, 10, 1, 2],
        "dec": [12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 5, 5, 6, 4, 5, 9],
        "dcmag": [
            15,
            15.1,
            15.23,
            13,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16,
            16.4,
            16.7,
            16.28,
            17.68,
            16.32,
            17.99,
            16.32,
            15.52,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 3, 3, 4, 4, 1, 4],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 3.2, 3.1, 4.2, 4.1, 1.2, 4.1],
        "candid": [
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            36,
            39,
            41,
            44,
            34,
            40,
        ],
        "trajectory_id": [2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 7, 6, 7, 8, 8],
    }
)

track_and_obs_old_observations_expected2 = pd.DataFrame(
    {
        "ra": [1, 4, 6, 7, 6, 5],
        "dec": [1, 1, 1, 7, 3, 10],
        "dcmag": [15.52, 14.96, 16.03, 18.52, 14.96, 18.52],
        "fid": [2, 2, 2, 1, 2, 1],
        "nid": [2, 3, 3, 3, 4, 4],
        "jd": [2.1, 3.1, 3.1, 3.2, 4.1, 4.2],
        "candid": [33, 35, 37, 38, 42, 43],
    }
)

track_and_obs_trajectory_df_expected3 = pd.DataFrame(
    {
        "ra": [3, 9, 4, 10, 1, 2, 2, 3, 7, 8, 6, 1],
        "dec": [5, 5, 6, 4, 5, 9, 2, 3, 1, 2, 1, 1],
        "dcmag": [
            16.28,
            17.68,
            16.32,
            17.99,
            16.32,
            15.52,
            15.74,
            15.47,
            16.21,
            16.28,
            16.03,
            15.52,
        ],
        "fid": [2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 2],
        "nid": [3, 3, 4, 4, 1, 4, 4, 4, 4, 4, 3, 2],
        "jd": [3.2, 3.1, 4.2, 4.1, 1.2, 4.1, 4.1, 4.2, 4.1, 4.2, 3.1, 2.1],
        "candid": [36, 39, 41, 44, 34, 40, 27, 28, 31, 32, 37, 33],
        "trajectory_id": [6, 7, 6, 7, 8, 8, 11, 11, 13, 13, 13, 11],
    }
)

track_and_obs_trajectory_df_expected4 = pd.DataFrame(
    {
        "ra": [1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 2, 3, 7, 8],
        "dec": [12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 2, 3, 1, 2],
        "dcmag": [
            15,
            15.1,
            15.23,
            13,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16,
            16.4,
            16.7,
            15.74,
            15.47,
            16.21,
            16.28,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 4],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4.1, 4.2, 4.1, 4.2],
        "candid": [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28, 31, 32],
        "trajectory_id": [2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 11, 11, 13, 13],
    }
)

track_and_obs_old_observations_expected3 = pd.DataFrame(
    {
        "ra": [2, 4, 6, 5, 10],
        "dec": [9, 6, 3, 10, 4],
        "dcmag": [15.52, 16.32, 14.96, 18.52, 17.99],
        "fid": [2, 1, 2, 1, 2],
        "nid": [4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.1],
        "candid": [40, 41, 42, 43, 44],
    }
)

track_and_obs_trajectory_df_expected5 = pd.DataFrame(
    {
        "ra": [1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 2, 3, 7, 8, 6, 1],
        "dec": [12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 2, 3, 1, 2, 1, 1],
        "dcmag": [
            15,
            15.1,
            15.23,
            13,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16,
            16.4,
            16.7,
            15.74,
            15.47,
            16.21,
            16.28,
            16.03,
            15.52,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 4, 3, 2],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4.1, 4.2, 4.1, 4.2, 3.1, 2.1],
        "candid": [
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            27,
            28,
            31,
            32,
            37,
            33,
        ],
        "trajectory_id": [2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 11, 11, 13, 13, 13, 11],
    }
)

track_and_obs_old_observations_expected4 = pd.DataFrame(
    {
        "ra": [1, 4, 3, 7, 9],
        "dec": [5, 1, 5, 7, 5],
        "dcmag": [16.32, 14.96, 16.28, 18.52, 17.68],
        "fid": [1, 2, 2, 1, 1],
        "nid": [1, 3, 3, 3, 3],
        "jd": [1.2, 3.1, 3.2, 3.2, 3.1],
        "candid": [34, 35, 36, 38, 39],
    }
)

expected_traj_obs_report = {
    "list of updated trajectories": [6.0, 7.0, 8.0, 11.0, 13.0],
    "all nid report": [
        {
            "old nid": 3,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
    ],
}

expected_traj_obs_report2 = {
    "list of updated trajectories": [6.0, 7.0, 8.0],
    "all nid report": [
        {
            "old nid": 3,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
    ],
}


expected_traj_obs_report3 = {
    "list of updated trajectories": [6.0, 7.0, 8.0, 11.0, 13.0],
    "all nid report": [
        {
            "old nid": 3,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
    ],
}

expected_traj_obs_report4 = {
    "list of updated trajectories": [11.0, 13.0],
    "all nid report": [
        {
            "old nid": 3,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
    ],
}

# Night to night association testing

night_night_trajectory_sample = pd.DataFrame(
    {
        "ra": [1, 2, 3, 6, 7, 8, 11, 12, 13],
        "dec": [1, 2, 3, 1, 1, 2, 3, 4, 5],
        "dcmag": [12, 12.2, 12.4, 15, 15.4, 15.5, 13, 13.1, 13.2],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17, 18],
        "trajectory_id": [1, 1, 1, 2, 2, 2, 3, 3, 3],
    }
)

night_to_night_old_obs = pd.DataFrame(
    {
        "ra": [15, 7],
        "dec": [1, 7],
        "dcmag": [14, 16],
        "fid": [1, 2],
        "nid": [3, 2],
        "jd": [3, 2],
        "candid": [19, 29],
    }
)

night_to_night_new_obs = pd.DataFrame(
    {
        "ra": [4, 5, 1, 2, 12, 11, 16, 9, 17],
        "dec": [4, 5, 7, 8, 6, 7, 1, 3, 10],
        "dcmag": [12.5, 12.7, 17.2, 17.26, 13.32, 13.28, 14.12, 15.8, 15.21],
        "fid": [1, 1, 2, 2, 2, 2, 1, 1, 2],
        "nid": [4, 4, 4, 4, 4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.1, 4.2, 4.2, 4.1, 4.2],
        "candid": [20, 21, 22, 23, 24, 25, 26, 27, 28],
        "ssnamenr": [1, 1, 2, 2, 3, 3, 4, 5, 6],
    }
)


night_to_night_trajectory_df_expected = pd.DataFrame(
    {
        "ra": [1, 2, 3, 6, 7, 8, 11, 12, 13, 4, 5, 9, 15, 16, 1, 12, 2, 11],
        "dec": [1, 2, 3, 1, 1, 2, 3, 4, 5, 4, 5, 3, 1, 1, 7, 6, 8, 7],
        "dcmag": [
            12.00,
            12.20,
            12.40,
            15.00,
            15.40,
            15.50,
            13.00,
            13.10,
            13.20,
            12.50,
            12.70,
            15.80,
            14.00,
            14.12,
            17.20,
            13.32,
            17.26,
            13.28,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 3, 4, 4, 4, 4, 4],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.1,
            4.2,
            4.1,
            3.0,
            4.2,
            4.1,
            4.1,
            4.2,
            4.2,
        ],
        "candid": [
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            20,
            21,
            27,
            19,
            26,
            22,
            24,
            23,
            25,
        ],
        "trajectory_id": [1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 2, 7, 7, 5, 6, 5, 6],
        "ssnamenr": [
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            1,
            1,
            5,
            np.nan,
            4,
            2,
            3,
            2,
            3,
        ],
    }
)

night_to_night_old_observation_expected = pd.DataFrame(
    {
        "ra": [7, 17],
        "dec": [7, 10],
        "dcmag": [16.00, 15.21],
        "fid": [2, 2],
        "nid": [2, 4],
        "jd": [2.0, 4.2],
        "candid": [29, 28],
        "ssnamenr": [np.nan, 6.0],
    }
)


night_to_night_trajectory_df_expected2 = pd.DataFrame(
    {
        "ra": [15, 16, 4, 1, 12, 5, 2, 11],
        "dec": [1, 1, 4, 7, 6, 5, 8, 7],
        "dcmag": [14.00, 14.12, 12.50, 17.20, 13.32, 12.70, 17.26, 13.28],
        "fid": [1, 1, 1, 2, 2, 1, 2, 2],
        "nid": [3, 4, 4, 4, 4, 4, 4, 4],
        "jd": [3.0, 4.2, 4.1, 4.1, 4.1, 4.2, 4.2, 4.2],
        "candid": [19, 26, 20, 22, 24, 21, 23, 25],
        "trajectory_id": [7, 7, 4, 5, 6, 4, 5, 6],
        "ssnamenr": [np.nan, 4.0, 1, 2, 3, 1, 2, 3],
    }
)

night_to_night_old_observation_expected2 = pd.DataFrame(
    {
        "ra": [7, 9, 17],
        "dec": [7, 3, 10],
        "dcmag": [16.00, 15.80, 15.21],
        "fid": [2, 1, 2],
        "nid": [2, 4, 4],
        "jd": [2.0, 4.1, 4.2],
        "candid": [29, 27, 28],
        "ssnamenr": [np.nan, 5.0, 6.0],
    }
)


night_to_night_new_obs2 = pd.DataFrame(
    {
        "ra": [4, 5, 1, 2, 12, 11, 16, 9, 17],
        "dec": [4, 5, 7, 8, 6, 7, 1, 3, 10],
        "dcmag": [12.5, 17.7, 17.2, 13.26, 13.32, 18.28, 14.12, 15.8, 15.21],
        "fid": [1, 1, 2, 2, 2, 2, 1, 1, 2],
        "nid": [4, 4, 4, 4, 4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.1, 4.2, 4.2, 4.1, 4.2],
        "candid": [20, 21, 22, 23, 24, 25, 26, 27, 28],
    }
)


night_to_night_trajectory_df_expected3 = pd.DataFrame(
    {
        "ra": [
            1.0,
            2.0,
            3.0,
            6.0,
            7.0,
            8.0,
            11.0,
            12.0,
            13.0,
            4.0,
            9.0,
            15.0,
            16.0,
            7.0,
            5.0,
        ],
        "dec": [
            1.0,
            2.0,
            3.0,
            1.0,
            1.0,
            2.0,
            3.0,
            4.0,
            5.0,
            4.0,
            3.0,
            1.0,
            1.0,
            7.0,
            5.0,
        ],
        "dcmag": [
            12.00,
            12.20,
            12.40,
            15.00,
            15.40,
            15.50,
            13.00,
            13.10,
            13.20,
            12.50,
            15.80,
            14.00,
            14.12,
            16.00,
            17.70,
        ],
        "fid": [
            1.0,
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            2.0,
            2.0,
            1.0,
            1.0,
            1.0,
            1.0,
            2.0,
            1.0,
        ],
        "nid": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.0,
            4.0,
            3.0,
            4.0,
            2.0,
            4.0,
        ],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.1,
            4.1,
            3.0,
            4.2,
            2.0,
            4.2,
        ],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 27, 19, 26, 29, 21],
        "trajectory_id": [1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 4, 4, 5, 5],
    }
)

night_to_night_old_observation_expected3 = pd.DataFrame(
    {
        "ra": [1, 2, 12, 11, 17],
        "dec": [7, 8, 6, 7, 10],
        "dcmag": [17.20, 13.26, 13.32, 18.28, 15.21],
        "fid": [2, 2, 2, 2, 2],
        "nid": [4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.2],
        "candid": [22, 23, 24, 25, 28],
    }
)

inter_night_report1 = {
    "nid of the next night": 4,
    "intra night report": {
        "number of separation association": 6,
        "number of association filtered by magnitude": 0,
        "association metrics": {
            "precision": 100.0,
            "recall": 100.0,
            "True Positif": 3,
            "False Positif": 0,
            "False Negatif": 0,
            "total real association": 3,
        },
        "number of intra night tracklets": 3,
    },
    "trajectory association report": {
        "list of updated trajectories": [1.0, 2.0],
        "all nid report": [
            {
                "old nid": 3,
                "trajectories_to_tracklets_report": {
                    "number of inter night separation based association": 2,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 1,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "trajectories_to_new_observation_report": {
                    "number of inter night separation based association": 1,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
            }
        ],
    },
    "tracklets and observation association report": {
        "list of updated trajectories": [5.0, 6.0, 7.0],
        "all nid report": [
            {
                "old nid": 3,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 1,
                    "number of inter night magnitude filtered association": 0,
                    "metrics": {},
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
            {
                "old nid": 2,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "metrics": {},
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
        ],
    },
}

inter_night_report2 = {
    "nid of the next night": 4,
    "intra night report": {
        "number of separation association": 6,
        "number of association filtered by magnitude": 0,
        "association metrics": {},
        "number of intra night tracklets": 3,
    },
    "trajectory association report": {
        "list of updated trajectories": [],
        "all nid report": [],
    },
    "tracklets and observation association report": {
        "list of updated trajectories": [4.0, 5.0, 6.0, 7.0],
        "all nid report": [
            {
                "old nid": 3,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 1,
                    "number of inter night magnitude filtered association": 0,
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
            {
                "old nid": 2,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
        ],
    },
}

inter_night_report3 = {
    "nid of the next night": 4,
    "intra night report": {
        "number of separation association": 6,
        "number of association filtered by magnitude": 6,
        "association metrics": {},
        "number of intra night tracklets": 0,
    },
    "trajectory association report": {
        "list of updated trajectories": [1.0, 2.0],
        "all nid report": [
            {
                "old nid": 3,
                "trajectories_to_tracklets_report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "trajectories_to_new_observation_report": {
                    "number of inter night separation based association": 3,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 1,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
            }
        ],
    },
    "tracklets and observation association report": {
        "list of updated trajectories": [4.0, 5.0],
        "all nid report": [
            {
                "old nid": 3,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 1,
                    "number of inter night magnitude filtered association": 0,
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
            {
                "old nid": 2,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 1,
                    "number of inter night magnitude filtered association": 0,
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
        ],
    },
}


# Trajectory and tracklets association test

trajectories_sample_1 = pd.DataFrame(
    {
        "ra": [1, 2, 3, 5, 6, 6, 1, 2, 3, 7, 8, 8, 9, 10, 11, 11],
        "dec": [1, 2, 3, 1, 1, 2, 7, 7, 7, 4, 5, 6, 1, 1, 1, 2],
        "dcmag": [
            12,
            12.02,
            12.04,
            13,
            13.02,
            13.04,
            14,
            14.02,
            14.04,
            15.04,
            15.06,
            15.07,
            16.02,
            16.04,
            16.06,
            16.07,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2],
        "jd": [
            0.1,
            0.2,
            0.3,
            1.1,
            1.2,
            1.3,
            2.1,
            2.2,
            2.3,
            1.1,
            1.2,
            1.3,
            1.1,
            1.2,
            1.3,
            2.1,
        ],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
        "trajectory_id": [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4],
    }
)

tracklets_sample_1 = pd.DataFrame(
    {
        "ra": [4, 5, 8, 8, 11, 11, 11, 7, 8],
        "dec": [4, 5, 7, 8, 3, 4, 5, 3, 3],
        "dcmag": [12.06, 12.07, 15.08, 15.09, 16.08, 16.09, 16.11, 17.01, 17.02],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.1, 3.2, 3.1, 3.2, 3.1, 3.2, 3.3, 3.4, 3.5],
        "candid": [16, 17, 18, 19, 20, 21, 22, 23, 24],
        "trajectory_id": [10, 10, 11, 11, 12, 12, 12, 13, 13],
    }
)

# - test with duplicates

trajectories_sample_2 = pd.DataFrame(
    {
        "ra": [2, 3, 4, 10, 11, 12, 10, 11, 12, 3, 4, 5, 3, 4, 5],
        "dec": [3, 3, 3, 6, 6, 6, 2, 2, 2, 8, 8, 8, 10, 10, 10],
        "dcmag": [
            12,
            12.02,
            12.04,
            13.05,
            13.06,
            13.07,
            14.01,
            14.02,
            14.03,
            15.03,
            15.03,
            15.03,
            15.03,
            15.03,
            15.03,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        "jd": [
            0.1,
            0.2,
            0.3,
            0.3,
            0.4,
            0.5,
            0.1,
            0.2,
            0.3,
            0.3,
            0.4,
            0.5,
            0.1,
            0.2,
            0.3,
        ],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
        "trajectory_id": [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4],
    }
)

tracklets_sample_2 = pd.DataFrame(
    {
        "ra": [5, 6, 5, 6, 13, 14, 13, 14, 13, 14, 5, 6, 6, 7],
        "dec": [4, 4, 2, 2, 7, 7, 5, 5, 2, 2, 3, 3, 9, 9],
        "dcmag": [
            12.06,
            12.07,
            12.06,
            12.07,
            13.08,
            13.09,
            13.03,
            13.04,
            14.03,
            14.04,
            12.06,
            12.07,
            15.03,
            15.03,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.1, 3.2, 3.1, 3.2, 3.1, 3.2, 3.1, 3.2, 3.1, 3.2, 3.1, 3.2, 3.1, 3.2],
        "candid": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
        "trajectory_id": [10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16],
    }
)

# - expected outputs

trajectories_expected_1 = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 4, 5, 8, 7],
        "dec": [1, 2, 3, 12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 4, 5, 7, 8],
        "dcmag": [
            12.02,
            12.05,
            12.3,
            15.0,
            15.1,
            15.23,
            13.0,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16.0,
            16.4,
            16.7,
            12.4,
            12.52,
            17.31,
            17.43,
        ],
        "fid": [1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 4],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.1,
            4.2,
            4.1,
            4.2,
        ],
        "candid": [
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            29,
            30,
        ],
        "trajectory_id": [
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            3.0,
            3.0,
            3.0,
            4.0,
            4.0,
            4.0,
            5.0,
            5.0,
            5.0,
            1.0,
            1.0,
            4.0,
            4.0,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            True,
            True,
            True,
            True,
            True,
            True,
            False,
            False,
            False,
            True,
            True,
            True,
            False,
            False,
            False,
            False,
        ],
    }
)

tracklets_expected_1 = pd.DataFrame(
    {
        "ra": [1, 1, 13, 13],
        "dec": [9, 8, 1, 2],
        "dcmag": [15.94, 15.47, 16.21, 16.28],
        "fid": [2, 1, 2, 2],
        "nid": [4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2],
        "candid": [27, 28, 31, 32],
        "trajectory_id": [11, 11, 13, 13],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

trajectories_expected_2 = pd.DataFrame(
    {
        "ra": [
            1,
            2,
            3,
            5,
            6,
            6,
            1,
            2,
            3,
            7,
            8,
            8,
            9,
            10,
            11,
            11,
            11,
            11,
            11,
            8,
            8,
            4,
            5,
        ],
        "dec": [1, 2, 3, 1, 1, 2, 7, 7, 7, 4, 5, 6, 1, 1, 1, 2, 3, 4, 5, 7, 8, 4, 5],
        "dcmag": [
            12.0,
            12.02,
            12.04,
            13.0,
            13.02,
            13.04,
            14.0,
            14.02,
            14.04,
            15.04,
            15.06,
            15.07,
            16.02,
            16.04,
            16.06,
            16.07,
            16.08,
            16.09,
            16.11,
            15.08,
            15.09,
            12.06,
            12.07,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3],
        "jd": [
            0.1,
            0.2,
            0.3,
            1.1,
            1.2,
            1.3,
            2.1,
            2.2,
            2.3,
            1.1,
            1.2,
            1.3,
            1.1,
            1.2,
            1.3,
            2.1,
            3.1,
            3.2,
            3.3,
            3.1,
            3.2,
            3.1,
            3.2,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            20,
            21,
            22,
            18,
            19,
            16,
            17,
        ],
        "trajectory_id": [
            0.0,
            0.0,
            0.0,
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            3.0,
            3.0,
            3.0,
            4.0,
            4.0,
            4.0,
            4.0,
            4.0,
            4.0,
            4.0,
            3.0,
            3.0,
            0.0,
            0.0,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            True,
            True,
            True,
            True,
            True,
            True,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

tracklets_expected_2 = pd.DataFrame(
    {
        "ra": [7, 8],
        "dec": [3, 3],
        "dcmag": [17.01, 17.02],
        "fid": [1, 1],
        "nid": [3, 3],
        "jd": [3.4, 3.5],
        "candid": [23, 24],
        "trajectory_id": [13, 13],
        "provisional designation": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
    }
)

traj_and_track_assoc_report_expected = {
    "updated trajectories": [0.0, 3.0, 4.0],
    "all nid_report": [
        {
            "old nid": 2,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
    ],
}

trajectories_expected_3 = pd.DataFrame(
    {
        "ra": [
            2,
            3,
            4,
            10,
            11,
            12,
            10,
            11,
            12,
            3,
            4,
            5,
            3,
            4,
            5,
            2,
            3,
            4,
            2,
            3,
            4,
            10,
            11,
            12,
            5,
            6,
            5,
            6,
            13,
            14,
            5,
            6,
            13,
            14,
            13,
            14,
            6,
            7,
            6,
            7,
        ],
        "dec": [
            3,
            3,
            3,
            6,
            6,
            6,
            2,
            2,
            2,
            8,
            8,
            8,
            10,
            10,
            10,
            3,
            3,
            3,
            3,
            3,
            3,
            6,
            6,
            6,
            4,
            4,
            2,
            2,
            7,
            7,
            3,
            3,
            5,
            5,
            2,
            2,
            9,
            9,
            9,
            9,
        ],
        "dcmag": [
            12.0,
            12.02,
            12.04,
            13.05,
            13.06,
            13.07,
            14.01,
            14.02,
            14.03,
            15.03,
            15.03,
            15.03,
            15.03,
            15.03,
            15.03,
            12.0,
            12.02,
            12.04,
            12.0,
            12.02,
            12.04,
            13.05,
            13.06,
            13.07,
            12.06,
            12.07,
            12.06,
            12.07,
            13.08,
            13.09,
            12.06,
            12.07,
            13.03,
            13.04,
            14.03,
            14.04,
            15.03,
            15.03,
            15.03,
            15.03,
        ],
        "fid": [
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
        ],
        "nid": [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
        ],
        "jd": [
            0.1,
            0.2,
            0.3,
            0.3,
            0.4,
            0.5,
            0.1,
            0.2,
            0.3,
            0.3,
            0.4,
            0.5,
            0.1,
            0.2,
            0.3,
            0.1,
            0.2,
            0.3,
            0.1,
            0.2,
            0.3,
            0.3,
            0.4,
            0.5,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            0,
            1,
            2,
            0,
            1,
            2,
            3,
            4,
            5,
            16,
            17,
            18,
            19,
            20,
            21,
            26,
            27,
            22,
            23,
            24,
            25,
            28,
            29,
            28,
            29,
        ],
        "trajectory_id": [
            0.0,
            0.0,
            0.0,
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            3.0,
            3.0,
            3.0,
            4.0,
            4.0,
            4.0,
            5.0,
            5.0,
            5.0,
            6.0,
            6.0,
            6.0,
            7.0,
            7.0,
            7.0,
            5.0,
            5.0,
            6.0,
            6.0,
            7.0,
            7.0,
            0.0,
            0.0,
            1.0,
            1.0,
            2.0,
            2.0,
            3.0,
            3.0,
            4.0,
            4.0,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)


# Trajectories and new observations associations

trajectories_sample_3 = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 3, 7, 8, 9, 11, 12, 13, 15, 15, 15, 16, 17, 17],
        "dec": [1, 1, 1, 7, 7, 7, 3, 4, 5, 9, 9, 9, 2, 3, 4, 8, 8, 7],
        "dcmag": [
            11,
            11.01,
            11.02,
            12.01,
            12.01,
            12.02,
            13,
            13.02,
            13.03,
            14,
            14.02,
            14.03,
            15.01,
            15.01,
            15.02,
            16.04,
            16.05,
            16.06,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 1, 0, 1, 1, 0, 1, 2, 0, 2, 2, 0, 0, 0, 0, 1, 1],
        "jd": [
            0.1,
            0.2,
            1.3,
            0.1,
            1.1,
            1.2,
            0.1,
            1.1,
            2.3,
            0.0,
            2.2,
            2.4,
            0.0,
            0.1,
            0.2,
            0.1,
            1.1,
            1.2,
        ],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17],
        "trajectory_id": [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5],
    }
)

new_observations_sample_1 = pd.DataFrame(
    {
        "ra": [4, 1, 3, 6, 6, 10, 15, 17],
        "dec": [1, 5, 4, 2, 8, 6, 5, 6],
        "dcmag": [11.03, 14.52, 17.84, 14.12, 16.25, 13.04, 15.03, 16.07],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.1, 3.1, 3.2, 3.3, 3.4, 3.4, 3.4, 3.5],
        "candid": [18, 16, 20, 21, 22, 23, 24, 25],
    }
)

# - test with duplicates

trajectories_sample_4 = pd.DataFrame(
    {
        "ra": [2, 3, 4, 10, 11, 11, 17, 18, 19, 2, 3, 4],
        "dec": [2, 2, 2, 6, 6, 5, 5, 4, 3, 7, 7, 7],
        "dcmag": [
            11,
            11.01,
            11.02,
            12.01,
            12.01,
            12.02,
            13,
            13.02,
            13.03,
            14,
            14.02,
            14.03,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 1, 1, 0, 0, 0, 0, 1, 2, 0, 2, 2],
        "jd": [0.1, 1.2, 1.3, 0.1, 0.1, 0.2, 0.1, 1.1, 2.3, 0.0, 2.2, 2.4],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
        "trajectory_id": [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3],
    }
)

new_observations_sample_2 = pd.DataFrame(
    {
        "ra": [5, 5, 5, 6, 10, 12, 11, 12, 15, 18, 19, 20],
        "dec": [1, 2, 3, 5, 4, 4, 3, 1, 7, 3, 2, 2],
        "dcmag": [
            11.03,
            11.04,
            11.02,
            14.12,
            12.05,
            12.04,
            15.03,
            16.07,
            15.21,
            13.04,
            13.05,
            13.06,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.1, 3.1, 3.2, 3.3, 3.4, 3.4, 3.4, 3.5, 3.5, 3.4, 3.2, 3.1],
        "candid": [18, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
    }
)

trajectories_sample_5 = pd.DataFrame(
    {
        "ra": [
            3,
            4,
            5,
            3,
            4,
            5,
            8,
            8,
            8,
            11,
            11,
            11,
            13,
            13,
            13,
            17,
            18,
            19,
            17,
            18,
            19,
        ],
        "dec": [3, 3, 3, 5, 5, 5, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 3, 3, 5, 5, 5],
        "dcmag": [
            11,
            11.01,
            11.02,
            11,
            11.01,
            11.02,
            15.23,
            15.24,
            15.25,
            12.01,
            12.01,
            12.02,
            12.01,
            12.01,
            12.02,
            13,
            13.02,
            13.03,
            13,
            13.02,
            13.03,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 1, 0, 1, 1, 0, 2, 2, 0, 1, 2, 0, 0, 1, 0, 1, 2, 0, 2, 2],
        "jd": [
            0.1,
            0.2,
            1.3,
            0.1,
            1.1,
            1.2,
            0.1,
            2.1,
            2.3,
            0.0,
            1.2,
            2.4,
            0.1,
            0.2,
            1.3,
            0.2,
            1.1,
            2.3,
            0.1,
            2.4,
            2.5,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
        ],
        "trajectory_id": [
            0,
            0,
            0,
            1,
            1,
            1,
            2,
            2,
            2,
            3,
            3,
            3,
            4,
            4,
            4,
            5,
            5,
            5,
            6,
            6,
            6,
        ],
    }
)

new_observations_sample_3 = pd.DataFrame(
    {
        "ra": [6, 8, 12, 20, 4],
        "dec": [4, 4, 5, 4, 7],
        "dcmag": [11.03, 15.29, 12.02, 13.12, 17.85],
        "fid": [1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3],
        "jd": [3.1, 3.1, 3.2, 3.3, 3.5],
        "candid": [21, 22, 23, 24, 25],
    }
)

# - expected outputs

trajectories_expected_4 = pd.DataFrame(
    {
        "ra": [
            1,
            2,
            3,
            1,
            2,
            3,
            7,
            8,
            9,
            11,
            12,
            13,
            15,
            15,
            15,
            16,
            17,
            17,
            10,
            4,
            17,
            15,
        ],
        "dec": [1, 1, 1, 7, 7, 7, 3, 4, 5, 9, 9, 9, 2, 3, 4, 8, 8, 7, 6, 1, 6, 5],
        "dcmag": [
            11.0,
            11.01,
            11.02,
            12.01,
            12.01,
            12.02,
            13.0,
            13.02,
            13.03,
            14.0,
            14.02,
            14.03,
            15.01,
            15.01,
            15.02,
            16.04,
            16.05,
            16.06,
            13.04,
            11.03,
            16.07,
            15.03,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 1, 0, 1, 1, 0, 1, 2, 0, 2, 2, 0, 0, 0, 0, 1, 1, 3, 3, 3, 3],
        "jd": [
            0.1,
            0.2,
            1.3,
            0.1,
            1.1,
            1.2,
            0.1,
            1.1,
            2.3,
            0.0,
            2.2,
            2.4,
            0.0,
            0.1,
            0.2,
            0.1,
            1.1,
            1.2,
            3.4,
            3.1,
            3.5,
            3.4,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            23,
            18,
            25,
            24,
        ],
        "trajectory_id": [
            0,
            0,
            0,
            1,
            1,
            1,
            2,
            2,
            2,
            3,
            3,
            3,
            4,
            4,
            4,
            5,
            5,
            5,
            2,
            0,
            5,
            4,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            True,
            True,
            True,
            False,
            False,
            False,
            True,
            True,
            True,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

new_observations_expected_1 = pd.DataFrame(
    {
        "ra": [1, 3, 6, 6],
        "dec": [5, 4, 2, 8],
        "dcmag": [14.52, 17.84, 14.12, 16.25],
        "fid": [1, 1, 1, 1],
        "nid": [3, 3, 3, 3],
        "jd": [3.1, 3.2, 3.3, 3.4],
        "candid": [16, 20, 21, 22],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

expected_traj_obs_report_1 = {
    "traj to obs report": [
        {
            "old nid": 2,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 5,
                "number of inter night magnitude filtered association": 3,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
    ],
    "updated trajectories": [0.0, 2.0, 4.0, 5.0],
}


trajectories_expected_5 = pd.DataFrame(
    {
        "ra": [
            2,
            3,
            4,
            10,
            11,
            11,
            17,
            18,
            19,
            2,
            3,
            4,
            17,
            18,
            19,
            20,
            19,
            2,
            3,
            4,
            2,
            3,
            4,
            5,
            5,
            5,
            10,
            11,
            11,
            12,
            10,
        ],
        "dec": [
            2,
            2,
            2,
            6,
            6,
            5,
            5,
            4,
            3,
            7,
            7,
            7,
            5,
            4,
            3,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            3,
            1,
            6,
            6,
            5,
            4,
            4,
        ],
        "dcmag": [
            11.0,
            11.01,
            11.02,
            12.01,
            12.01,
            12.02,
            13.0,
            13.02,
            13.03,
            14.0,
            14.02,
            14.03,
            13.0,
            13.02,
            13.03,
            13.06,
            13.05,
            11.0,
            11.01,
            11.02,
            11.0,
            11.01,
            11.02,
            11.04,
            11.02,
            11.03,
            12.01,
            12.01,
            12.02,
            12.04,
            12.05,
        ],
        "fid": [
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
        ],
        "nid": [
            0,
            1,
            1,
            0,
            0,
            0,
            0,
            1,
            2,
            0,
            2,
            2,
            0,
            1,
            2,
            3,
            3,
            0,
            1,
            1,
            0,
            1,
            1,
            3,
            3,
            3,
            0,
            0,
            0,
            3,
            3,
        ],
        "jd": [
            0.1,
            1.2,
            1.3,
            0.1,
            0.1,
            0.2,
            0.1,
            1.1,
            2.3,
            0.0,
            2.2,
            2.4,
            0.1,
            1.1,
            2.3,
            3.1,
            3.2,
            0.1,
            1.2,
            1.3,
            0.1,
            1.2,
            1.3,
            3.1,
            3.2,
            3.1,
            0.1,
            0.1,
            0.2,
            3.4,
            3.4,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            6,
            7,
            8,
            29,
            28,
            0,
            1,
            2,
            0,
            1,
            2,
            16,
            20,
            18,
            3,
            4,
            5,
            23,
            22,
        ],
        "trajectory_id": [
            0,
            0,
            0,
            1,
            1,
            1,
            2,
            2,
            2,
            3,
            3,
            3,
            4,
            4,
            4,
            4,
            2,
            5,
            5,
            5,
            6,
            6,
            6,
            5,
            6,
            0,
            7,
            7,
            7,
            7,
            1,
        ],
        "ref_epoch": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            True,
            True,
            True,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

new_observations_expected_2 = pd.DataFrame(
    {
        "ra": [6, 11, 12, 15, 18],
        "dec": [5, 3, 1, 7, 3],
        "dcmag": [14.12, 15.03, 16.07, 15.21, 13.04],
        "fid": [1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3],
        "jd": [3.3, 3.4, 3.5, 3.5, 3.4],
        "candid": [21, 24, 25, 26, 27],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
    }
)

expected_traj_obs_report_2 = {
    "traj to obs report": [
        {
            "old nid": 2,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 1,
                "number of duplicated association": 1,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 2,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 5,
                "number of inter night magnitude filtered association": 3,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 1,
                "metrics": {},
            },
        },
    ],
    "updated trajectories": [0, 1, 2, 4, 5, 6, 7],
}


trajectories_expected_6 = pd.DataFrame(
    {
        "ra": [
            3,
            4,
            5,
            3,
            4,
            5,
            8,
            8,
            8,
            11,
            11,
            11,
            13,
            13,
            13,
            17,
            18,
            19,
            17,
            18,
            19,
            8,
            12,
            20,
            20,
            6,
            6,
        ],
        "dec": [
            3,
            3,
            3,
            5,
            5,
            5,
            1,
            2,
            3,
            2,
            3,
            4,
            2,
            3,
            4,
            3,
            3,
            3,
            5,
            5,
            5,
            4,
            5,
            4,
            4,
            4,
            4,
        ],
        "dcmag": [
            11.0,
            11.01,
            11.02,
            11.0,
            11.01,
            11.02,
            15.23,
            15.24,
            15.25,
            12.01,
            12.01,
            12.02,
            12.01,
            12.01,
            12.02,
            13.0,
            13.02,
            13.03,
            13.0,
            13.02,
            13.03,
            15.29,
            12.02,
            13.12,
            13.12,
            11.03,
            11.03,
        ],
        "fid": [
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
        ],
        "nid": [
            0,
            0,
            1,
            0,
            1,
            1,
            0,
            2,
            2,
            0,
            1,
            2,
            0,
            0,
            1,
            0,
            1,
            2,
            0,
            2,
            2,
            3,
            3,
            3,
            3,
            3,
            3,
        ],
        "jd": [
            0.1,
            0.2,
            1.3,
            0.1,
            1.1,
            1.2,
            0.1,
            2.1,
            2.3,
            0.0,
            1.2,
            2.4,
            0.1,
            0.2,
            1.3,
            0.2,
            1.1,
            2.3,
            0.1,
            2.4,
            2.5,
            3.1,
            3.2,
            3.3,
            3.3,
            3.1,
            3.1,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            22,
            23,
            24,
            24,
            21,
            21,
        ],
        "trajectory_id": [
            0,
            0,
            0,
            1,
            1,
            1,
            2,
            2,
            2,
            3,
            3,
            3,
            4,
            4,
            4,
            5,
            5,
            5,
            6,
            6,
            6,
            2,
            3,
            5,
            6,
            0,
            1,
        ],
        "ref_epoch": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            True,
            True,
            True,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

new_observations_expected_3 = pd.DataFrame(
    {
        "ra": [4],
        "dec": [7],
        "dcmag": [17.85],
        "fid": [1],
        "nid": [3],
        "jd": [3.5],
        "candid": [25],
        "ref_epoch": [-1.0],
        "provisional designation": [-1.0],
        "a": [-1.0],
        "e": [-1.0],
        "i": [-1.0],
        "long. node": [-1.0],
        "arg. peric": [-1.0],
        "mean anomaly": [-1.0],
        "rms_a": [-1.0],
        "rms_e": [-1.0],
        "rms_i": [-1.0],
        "rms_long. node": [-1.0],
        "rms_arg. peric": [-1.0],
        "rms_mean anomaly": [-1.0],
    }
)

expected_traj_obs_report_3 = {
    "traj to obs report": [
        {
            "old nid": 2,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 4,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
    ],
    "updated trajectories": [0.0, 1.0, 2.0, 3.0, 5.0, 6.0],
}


# Tracklets and old observations associations


tracklets_sample_3 = pd.DataFrame(
    {
        "ra": [2, 3, 4, 5, 7, 8, 10, 11, 11, 12, 5, 6],
        "dec": [2, 3, 6, 6, 7, 7, 5, 6, 3, 3, 1, 2],
        "dcmag": [
            11,
            11.01,
            12.02,
            12.03,
            13.0,
            13.02,
            14.05,
            14.6,
            15.01,
            15.03,
            16.04,
            16.06,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.0, 3.1, 3.0, 3.1, 3.0, 3.1, 3.0, 3.1, 3.0, 3.1, 3.0, 3.1],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5],
    }
)

old_observations_sample_1 = pd.DataFrame(
    {
        "ra": [1, 1, 3, 7, 9, 10],
        "dec": [1, 4, 6, 3, 4, 3],
        "dcmag": [11.01, 17.23, 12.02, 16.21, 14.04, 15.02],
        "fid": [1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 1, 1, 2, 2],
        "jd": [0.1, 0.2, 1.2, 1.5, 2.4, 2.7],
        "candid": [12, 13, 14, 15, 16, 17],
    }
)

# - with duplicates

tracklets_sample_4 = pd.DataFrame(
    {
        "ra": [4, 5, 4, 5, 6, 7, 11, 11, 13, 13],
        "dec": [2, 2, 4, 4, 8, 8, 4, 3, 4, 3],
        "dcmag": [10.01, 10.2, 10.04, 10.05, 12.03, 12.06, 14.01, 14.05, 14.02, 14.06],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.0, 3.1, 3.0, 3.1, 3.0, 3.1, 3.0, 3.1, 3.0, 3.1],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4],
    }
)

old_observations_sample_2 = pd.DataFrame(
    {
        "ra": [3, 3, 2, 8, 12],
        "dec": [3, 5, 7, 4, 5],
        "dcmag": [10.0, 10.03, 15.42, 18.01, 14.02],
        "fid": [1, 1, 1, 1, 1],
        "nid": [0, 0, 1, 2, 1],
        "jd": [0.0, 0.2, 1.1, 2.3, 1.5],
        "candid": [10, 11, 12, 13, 14],
    }
)

tracklets_sample_5 = pd.DataFrame(
    {
        "ra": [3, 4, 12, 12, 5, 6],
        "dec": [2, 2, 4, 3, 6, 5],
        "dcmag": [10.01, 10.03, 11.02, 11.04, 14.06, 14.08],
        "fid": [1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3],
        "jd": [3.0, 3.1, 3.0, 3.1, 3.0, 3.1],
        "candid": [0, 1, 2, 3, 4, 5],
        "trajectory_id": [0, 0, 1, 1, 2, 2],
    }
)

old_observations_sample_3 = pd.DataFrame(
    {
        "ra": [2, 2, 4, 5, 11, 13],
        "dec": [1, 3, 6, 7, 5, 5],
        "dcmag": [10.04, 10.06, 14.04, 14.06, 11.06, 11.02],
        "fid": [1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 0, 2, 1, 1],
        "jd": [0.0, 0.1, 0.3, 2.1, 1.2, 1.3],
        "candid": [6, 7, 8, 9, 10, 11],
    }
)

# - expected outputs

tracklets_obs_expected_1 = pd.DataFrame(
    {
        "ra": [2, 3, 4, 5, 7, 8, 10, 11, 11, 12, 5, 6, 9, 10, 3, 1],
        "dec": [2, 3, 6, 6, 7, 7, 5, 6, 3, 3, 1, 2, 4, 3, 6, 1],
        "dcmag": [
            11.0,
            11.01,
            12.02,
            12.03,
            13.0,
            13.02,
            14.05,
            14.6,
            15.01,
            15.03,
            16.04,
            16.06,
            14.04,
            15.02,
            12.02,
            11.01,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 0],
        "jd": [
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            2.4,
            2.7,
            1.2,
            0.1,
        ],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 14, 12],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 3, 4, 1, 0],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            True,
            True,
            False,
            False,
            False,
            False,
            True,
            True,
            False,
            False,
            False,
            False,
        ],
    }
)

old_obs_expected_1 = pd.DataFrame(
    {
        "ra": [1, 7],
        "dec": [4, 3],
        "dcmag": [17.23, 16.21],
        "fid": [1, 1],
        "nid": [0, 1],
        "jd": [0.2, 1.5],
        "candid": [13, 15],
        "provisional designation": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
    }
)

track_and_obs_report_expected_1 = {
    "track and obs report": [
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 1,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "old observation to tracklets report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 2,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
    ],
    "updated tracklets": [0.0, 1.0, 3.0, 4.0],
}

tracklets_obs_expected_2 = pd.DataFrame(
    {
        "ra": [
            4.0,
            5.0,
            4.0,
            5.0,
            6.0,
            7.0,
            11.0,
            11.0,
            13.0,
            13.0,
            12.0,
            12.0,
            4.0,
            5.0,
            3.0,
            3.0,
            3.0,
        ],
        "dec": [
            2.0,
            2.0,
            4.0,
            4.0,
            8.0,
            8.0,
            4.0,
            3.0,
            4.0,
            3.0,
            5.0,
            5.0,
            4.0,
            4.0,
            5.0,
            3.0,
            3.0,
        ],
        "dcmag": [
            10.01,
            10.2,
            10.04,
            10.05,
            12.03,
            12.06,
            14.01,
            14.05,
            14.02,
            14.06,
            14.02,
            14.02,
            10.04,
            10.05,
            10.03,
            10.0,
            10.0,
        ],
        "fid": [
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
        ],
        "nid": [
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            1.0,
            1.0,
            3.0,
            3.0,
            0.0,
            0.0,
            0.0,
        ],
        "jd": [
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            1.5,
            1.5,
            3.0,
            3.1,
            0.2,
            0.0,
            0.0,
        ],
        "candid": [
            0.0,
            1.0,
            2.0,
            3.0,
            4.0,
            5.0,
            6.0,
            7.0,
            8.0,
            9.0,
            14.0,
            14.0,
            2.0,
            3.0,
            11.0,
            10.0,
            10.0,
        ],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 3, 4, 5, 5, 5, 0, 1],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            True,
            True,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

old_obs_expected_2 = pd.DataFrame(
    {
        "ra": [2, 8],
        "dec": [7, 4],
        "dcmag": [15.42, 18.01],
        "fid": [1, 1],
        "nid": [1, 2],
        "jd": [1.1, 2.3],
        "candid": [12, 13],
        "provisional designation": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
    }
)

track_and_obs_report_expected_2 = {
    "track and obs report": [
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "old observation to tracklets report": {
                "number of inter night separation based association": 5,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 1,
                "number of duplicated association": 1,
                "metrics": {},
            },
        },
    ],
    "updated tracklets": [0.0, 1.0, 3.0, 4.0, 5.0],
}


tracklets_obs_expected_3 = pd.DataFrame(
    {
        "ra": [
            3.0,
            4.0,
            12.0,
            12.0,
            5.0,
            6.0,
            5.0,
            12.0,
            12.0,
            13.0,
            11.0,
            3.0,
            4.0,
            2.0,
            2.0,
        ],
        "dec": [
            2.0,
            2.0,
            4.0,
            3.0,
            6.0,
            5.0,
            7.0,
            4.0,
            3.0,
            5.0,
            5.0,
            2.0,
            2.0,
            3.0,
            1.0,
        ],
        "dcmag": [
            10.01,
            10.03,
            11.02,
            11.04,
            14.06,
            14.08,
            14.06,
            11.02,
            11.04,
            11.02,
            11.06,
            10.01,
            10.03,
            10.06,
            10.04,
        ],
        "fid": [
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
        ],
        "nid": [
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            2.0,
            3.0,
            3.0,
            1.0,
            1.0,
            3.0,
            3.0,
            0.0,
            0.0,
        ],
        "jd": [
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            2.1,
            3.0,
            3.1,
            1.3,
            1.2,
            3.0,
            3.1,
            0.1,
            0.0,
        ],
        "candid": [
            0.0,
            1.0,
            2.0,
            3.0,
            4.0,
            5.0,
            9.0,
            2.0,
            3.0,
            11.0,
            10.0,
            0.0,
            1.0,
            7.0,
            6.0,
        ],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 1, 4, 4, 4, 0],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

old_obs_expected_3 = pd.DataFrame(
    {
        "ra": [4],
        "dec": [6],
        "dcmag": [14.04],
        "fid": [1],
        "nid": [0],
        "jd": [0.3],
        "candid": [8],
        "provisional designation": [-1.0],
        "a": [-1.0],
        "e": [-1.0],
        "i": [-1.0],
        "long. node": [-1.0],
        "arg. peric": [-1.0],
        "mean anomaly": [-1.0],
        "rms_a": [-1.0],
        "rms_e": [-1.0],
        "rms_i": [-1.0],
        "rms_long. node": [-1.0],
        "rms_arg. peric": [-1.0],
        "rms_mean anomaly": [-1.0],
    }
)

track_and_obs_report_expected_3 = {
    "track and obs report": [
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 1,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "old observation to tracklets report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 1,
                "metrics": {},
            },
        },
    ],
    "updated tracklets": [0.0, 1.0, 2.0, 3.0, 4.0],
}


# old observations with new observations associations test

old_observations_sample_4 = pd.DataFrame(
    {
        "ra": [1, 5, 2, 8, 11, 15],
        "dec": [1, 5, 9, 10, 5, 2],
        "dcmag": [11.01, 15.23, 12.02, 16.21, 14.04, 15.02],
        "fid": [1, 1, 1, 1, 1, 1],
        "nid": [2, 2, 1, 2, 0, 1],
        "jd": [2.1, 2.2, 1.2, 2.5, 0.4, 1.7],
        "candid": [0, 1, 2, 3, 4, 5],
    }
)

new_observation_sample_4 = pd.DataFrame(
    {
        "ra": [2, 3, 6, 7, 13, 17],
        "dec": [2, 8, 5, 2, 8, 6],
        "dcmag": [11.01, 12.08, 15.22, 16.21, 14.04, 15.02],
        "fid": [1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3],
        "jd": [3.1, 3.2, 3.2, 3.5, 3.4, 3.7],
        "candid": [6, 7, 8, 9, 10, 11],
    }
)

# - expected outputs

new_trajectory = pd.DataFrame(
    {
        "ra": [1, 5, 2, 6, 2, 3, 11, 13],
        "dec": [1, 5, 2, 5, 9, 8, 5, 8],
        "dcmag": [11.01, 15.23, 11.01, 15.22, 12.02, 12.08, 14.04, 14.04],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [2, 2, 3, 3, 1, 3, 0, 3],
        "jd": [2.1, 2.2, 3.1, 3.2, 1.2, 3.2, 0.4, 3.4],
        "candid": [0, 1, 6, 8, 2, 7, 4, 10],
        "trajectory_id": [0, 1, 0, 1, 2, 2, 3, 3],
    }
)

remaining_old_obs = pd.DataFrame(
    {
        "ra": [8, 15],
        "dec": [10, 2],
        "dcmag": [16.21, 15.02],
        "fid": [1, 1],
        "nid": [2, 1],
        "jd": [2.5, 1.7],
        "candid": [3, 5],
    }
)

remaining_new_obs = pd.DataFrame(
    {
        "ra": [7, 17],
        "dec": [2, 6],
        "dcmag": [16.21, 15.02],
        "fid": [1, 1],
        "nid": [3, 3],
        "jd": [3.5, 3.7],
        "candid": [9, 11],
    }
)

expected_obs_report = {
    "new trajectories": [0.0, 1.0, 2.0, 3.0],
    "all nid report": [
        {
            "old nid": 2,
            "observation associations": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "metrics": {},
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 1,
            "observation associations": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "metrics": {},
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 0,
            "observation associations": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "metrics": {},
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
    ],
}

# Test OrbFit

orbfit_samples = pd.DataFrame(
    {
        "ra": [
            81.9573635,
            90.2196466,
            90.9775852,
            92.1435109,
            95.3013857,
            232.2341868,
            231.1129767,
            231.0902895,
            229.1117136,
            225.6399955,
            225.1320369,
            224.1494043,
            224.1634648,
            223.6981941,
            222.8868291,
        ],
        "dec": [
            17.8940455,
            19.557214,
            19.6537084,
            19.7877896,
            20.0710622,
            -19.3694842,
            -18.6551774,
            -18.6566602,
            -18.7584283,
            -17.98425,
            -19.042805,
            -19.1458152,
            -17.6336513,
            -17.5222626,
            -19.3963402,
        ],
        "dcmag": [
            19.020416610644606,
            19.277157763192974,
            19.58262478343493,
            19.47009613328474,
            19.45875219190675,
            18.420662169461323,
            19.515643038956597,
            19.103981755075086,
            18.288246458485204,
            18.846686864667113,
            19.715124628473514,
            19.522913764553984,
            19.280371183840067,
            18.326972606767193,
            20.113162330613832,
        ],
        "fid": [2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1],
        "jd": [
            2459276.6515856,
            2459301.6557755,
            2459303.6663194,
            2459306.7054051,
            2459314.6574421,
            2459329.7716204,
            2459342.8558449,
            2459342.9366435,
            2459345.8568634,
            2459363.834375,
            2459365.7932176,
            2459370.7529051,
            2459373.7345139,
            2459377.7514468,
            2459379.689537,
        ],
        "trajectory_id": [2, 2, 2, 2, 2, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0],
    }
)

# - expected outputs

orbfit_output = pd.DataFrame(
    {
        "trajectory_id": [0, 1, 2],
        "provisional designation": ["K21J00A", "K21H00B", "K21E00C"],
        "ref_epoch": [2459365.748243189, 2459345.797868819, 2459303.631433099],
        "a": [2.251437705296581, 3.146290451465606, 2.53276408981958],
        "e": [0.125535937703596, 0.092386374483295, 0.21979650706685],
        "i": [6.4643575931745, 1.607049951428, 6.530453217436],
        "long. node": [50.5348303205253, 37.54350205425, 150.4841279350065],
        "arg. peric": [210.5960462174106, 166.8803952053398, 250.4271290562264],
        "mean anomaly": [342.871124394792, 22.3686256246004, 52.2712276077339],
        "rms_a": [0.00136864, -1.0, 0.141996],
        "rms_e": [0.00222514, -1.0, 0.014428],
        "rms_i": [0.0354767, -1.0, 0.0562678],
        "rms_long. node": [0.00670637, -1.0, 0.555542],
        "rms_arg. peric": [1.13426, -1.0, 10.4839],
        "rms_mean anomaly": [0.787228, -1.0, 9.93615],
    }
)

# Test orbit_elem_dataframe - expected outputs

orb_elem_output = pd.DataFrame(
    {
        "trajectory_id": [0],
        "provisional designation": ["K21E00A"],
        "ref_epoch": [2459274.810893373],
        "a": [1.5834346988159376],
        "e": [0.613572037782866],
        "i": [5.9442185803697],
        "long. node": [343.795980283847],
        "arg. peric": [270.1932521117385],
        "mean anomaly": [333.9568546371023],
        "rms_a": [-1],
        "rms_e": [-1],
        "rms_i": [-1],
        "rms_long. node": [-1],
        "rms_arg. peric": [-1],
        "rms_mean anomaly": [-1],
    }
)

# Test compute_orbit_elem - expected outputs

compute_orbit_elem_output = pd.DataFrame(
    {
        "ra": [
            81.9573635,
            90.2196466,
            90.9775852,
            92.1435109,
            95.3013857,
            232.2341868,
            229.1117136,
            225.6399955,
            224.1634648,
            223.6981941,
            231.1129767,
            231.0902895,
            225.1320369,
            224.1494043,
            222.8868291,
        ],
        "dec": [
            17.8940455,
            19.557214,
            19.6537084,
            19.7877896,
            20.0710622,
            -19.3694842,
            -18.7584283,
            -17.98425,
            -17.6336513,
            -17.5222626,
            -18.6551774,
            -18.6566602,
            -19.042805,
            -19.1458152,
            -19.3963402,
        ],
        "dcmag": [
            19.020416610644606,
            19.277157763192974,
            19.58262478343493,
            19.47009613328474,
            19.45875219190675,
            18.420662169461323,
            18.288246458485204,
            18.846686864667113,
            19.280371183840067,
            18.326972606767193,
            19.515643038956597,
            19.103981755075086,
            19.715124628473514,
            19.522913764553984,
            20.113162330613832,
        ],
        "fid": [2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1],
        "jd": [
            2459276.6515856,
            2459301.6557755,
            2459303.6663194,
            2459306.7054051,
            2459314.6574421,
            2459329.7716204,
            2459345.8568634,
            2459363.834375,
            2459373.7345139,
            2459377.7514468,
            2459342.8558449,
            2459342.9366435,
            2459365.7932176,
            2459370.7529051,
            2459379.689537,
        ],
        "trajectory_id": [2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
        "provisional designation": [
            "K21E00C",
            "K21E00C",
            "K21E00C",
            "K21E00C",
            "K21E00C",
            "K21H00B",
            "K21H00B",
            "K21H00B",
            "K21H00B",
            "K21H00B",
            "K21J00A",
            "K21J00A",
            "K21J00A",
            "K21J00A",
            "K21J00A",
        ],
        "ref_epoch": [
            2459303.631433099,
            2459303.631433099,
            2459303.631433099,
            2459303.631433099,
            2459303.631433099,
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
            2459365.748243189,
            2459365.748243189,
            2459365.748243189,
            2459365.748243189,
            2459365.748243189,
        ],
        "a": [
            2.53276408981958,
            2.53276408981958,
            2.53276408981958,
            2.53276408981958,
            2.53276408981958,
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
            2.251437705296581,
            2.251437705296581,
            2.251437705296581,
            2.251437705296581,
            2.251437705296581,
        ],
        "e": [
            0.21979650706685,
            0.21979650706685,
            0.21979650706685,
            0.21979650706685,
            0.21979650706685,
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
            0.125535937703596,
            0.125535937703596,
            0.125535937703596,
            0.125535937703596,
            0.125535937703596,
        ],
        "i": [
            6.530453217436,
            6.530453217436,
            6.530453217436,
            6.530453217436,
            6.530453217436,
            1.607049951428,
            1.607049951428,
            1.607049951428,
            1.607049951428,
            1.607049951428,
            6.4643575931745,
            6.4643575931745,
            6.4643575931745,
            6.4643575931745,
            6.4643575931745,
        ],
        "long. node": [
            150.4841279350065,
            150.4841279350065,
            150.4841279350065,
            150.4841279350065,
            150.4841279350065,
            37.54350205425,
            37.54350205425,
            37.54350205425,
            37.54350205425,
            37.54350205425,
            50.5348303205253,
            50.5348303205253,
            50.5348303205253,
            50.5348303205253,
            50.5348303205253,
        ],
        "<NAME>": [
            250.4271290562264,
            250.4271290562264,
            250.4271290562264,
            250.4271290562264,
            250.4271290562264,
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
            210.5960462174106,
            210.5960462174106,
            210.5960462174106,
            210.5960462174106,
            210.5960462174106,
        ],
        "mean anomaly": [
            52.2712276077339,
            52.2712276077339,
            52.2712276077339,
            52.2712276077339,
            52.2712276077339,
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
            342.871124394792,
            342.871124394792,
            342.871124394792,
            342.871124394792,
            342.871124394792,
        ],
        "rms_a": [
            0.141996,
            0.141996,
            0.141996,
            0.141996,
            0.141996,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            0.00136864,
            0.00136864,
            0.00136864,
            0.00136864,
            0.00136864,
        ],
        "rms_e": [
            0.014428,
            0.014428,
            0.014428,
            0.014428,
            0.014428,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            0.00222514,
            0.00222514,
            0.00222514,
            0.00222514,
            0.00222514,
        ],
        "rms_i": [
            0.0562678,
            0.0562678,
            0.0562678,
            0.0562678,
            0.0562678,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            0.0354767,
            0.0354767,
            0.0354767,
            0.0354767,
            0.0354767,
        ],
        "rms_long. node": [
            0.555542,
            0.555542,
            0.555542,
            0.555542,
            0.555542,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            0.00670637,
            0.00670637,
            0.00670637,
            0.00670637,
            0.00670637,
        ],
        "rms_arg. peric": [
            10.4839,
            10.4839,
            10.4839,
            10.4839,
            10.4839,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            1.13426,
            1.13426,
            1.13426,
            1.13426,
            1.13426,
        ],
        "rms_mean anomaly": [
            9.93615,
            9.93615,
            9.93615,
            9.93615,
            9.93615,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            0.787228,
            0.787228,
            0.787228,
            0.787228,
            0.787228,
        ],
    }
)

# Test Intra night step for inter_night associations

input_observation = pd.DataFrame(
    {
        "ra": [
            190.3093822,
            192.4757989,
            250.1164907,
            249.0639657,
            328.36068,
            42.1808185,
            42.6036852,
            42.1815458,
            42.5304125,
            42.1822624,
            42.5310979,
            42.1830249,
            42.6053935,
            42.5318612,
            42.6059568,
            42.1837213,
            42.1846499,
            42.606639,
            42.5334801,
            42.185469,
            42.6073259,
            42.5343328,
            42.6079834,
            42.5351813,
            42.1863528,
            42.1871921,
            42.6086452,
            42.6093149,
            42.1881009,
        ],
        "dec": [
            -1.8656935,
            4.0747939,
            -25.1107537,
            -8.4772727,
            -9.3780665,
            24.9404015,
            26.4502336,
            24.9407228,
            23.465135,
            24.9410442,
            23.4653673,
            24.9413411,
            26.4509386,
            23.4655574,
            26.4511729,
            24.9416392,
            24.9420043,
            26.4514583,
            23.4660646,
            24.9423478,
            26.451733,
            23.4662918,
            26.4519922,
            23.4665642,
            24.9426992,
            24.9430564,
            26.4522669,
            26.4525455,
            24.9434112,
        ],
        "jd": [
            2459390.6913889,
            2459390.7134838,
            2459390.7453356,
            2459390.814456,
            2459390.8690972,
            2459390.9629745,
            2459390.9629745,
            2459390.9649769,
            2459390.9649769,
            2459390.9669907,
            2459390.9669907,
            2459390.9689931,
            2459390.9689931,
            2459390.9689931,
            2459390.9710069,
            2459390.9710069,
            2459390.9733912,
            2459390.9733912,
            2459390.9733912,
            2459390.9757523,
            2459390.9757523,
            2459390.9757523,
            2459390.9781134,
            2459390.9781134,
            2459390.9781134,
            2459390.9804745,
            2459390.9804745,
            2459390.9828472,
            2459390.9828472,
        ],
        "fid": [
            1,
            1,
            1,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
        ],
        "nid": [
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
        ],
        "dcmag": [
            18.314560154790556,
            18.00043889328813,
            18.22956917803643,
            18.671504334026544,
            18.97395169454908,
            17.32167894539666,
            14.18589614910271,
            17.408995803526878,
            17.204864326115214,
            17.295811143089832,
            17.190303194288884,
            17.300278772697972,
            14.200502024176384,
            17.188696167174,
            14.200700388434196,
            17.289626601611015,
            17.349472109274732,
            14.171918091768449,
            17.15134512124073,
            17.42240352052329,
            14.180283722871964,
            17.18776120850724,
            14.19692343234462,
            17.116678387486722,
            17.43911808647409,
            17.406475158998877,
            14.195819077486222,
            14.201333882232895,
            17.42343435989272,
        ],
        "candid": [
            1636191384715015000,
            1636213482115015000,
            1636245332415015004,
            1636314454515015038,
            1636369094215015007,
            1636462971915015003,
            1636462973515015007,
            1636464971915015001,
            1636464970015015029,
            1636466991915015002,
            1636466990015015026,
            1636468991915015002,
            1636468993515015005,
            1636468990015015032,
            1636471003515015005,
            1636471001915015001,
            1636473393015015000,
            1636473394615015007,
            1636473391315015012,
            1636475753015015001,
            1636475754615015004,
            1636475751315015012,
            1636478114615015003,
            1636478111315015007,
            1636478113015015000,
            1636480473015015000,
            1636480474615015006,
            1636482844615015006,
            1636482843015015001,
        ],
        "ssnamenr": [
            "4258",
            "4262",
            "22758",
            "23415",
            "42647",
            "4963",
            "760",
            "4963",
            "1936",
            "4963",
            "1936",
            "4963",
            "760",
            "1936",
            "760",
            "4963",
            "4963",
            "760",
            "1936",
            "4963",
            "760",
            "1936",
            "760",
            "1936",
            "4963",
            "4963",
            "760",
            "760",
            "4963",
        ],
    }
)

input_observation_2 = pd.DataFrame(
    {
        "ra": [190.3093822, 192.4757989, 249.0639657],
        "dec": [-1.8656935, 4.0747939, -8.4772727],
        "jd": [2459390.6913889, 2459390.7134838, 2459390.814456],
        "fid": [1, 1, 2],
        "nid": [1636, 1636, 1636],
        "dcmag": [18.314560154790556, 18.00043889328813, 18.671504334026544],
        "candid": [1636191384715015000, 1636213482115015000, 1636314454515015038],
        "ssnamenr": ["4258", "4262", "23415"],
    }
)

# - expected outputs

tracklets_output = pd.DataFrame(
    {
        "ra": [
            42.5343328,
            42.6086452,
            42.1871921,
            42.1808185,
            42.5304125,
            42.1815458,
            42.6036852,
            42.5310979,
            42.1822624,
            42.6053935,
            42.1830249,
            42.1837213,
            42.5318612,
            42.6059568,
            42.606639,
            42.1846499,
            42.5334801,
            42.185469,
            42.6073259,
            42.1863528,
            42.6079834,
            42.5351813,
            42.6093149,
            42.1881009,
        ],
        "dec": [
            23.4662918,
            26.4522669,
            24.9430564,
            24.9404015,
            23.465135,
            24.9407228,
            26.4502336,
            23.4653673,
            24.9410442,
            26.4509386,
            24.9413411,
            24.9416392,
            23.4655574,
            26.4511729,
            26.4514583,
            24.9420043,
            23.4660646,
            24.9423478,
            26.451733,
            24.9426992,
            26.4519922,
            23.4665642,
            26.4525455,
            24.9434112,
        ],
        "jd": [
            2459390.9757523,
            2459390.9804745,
            2459390.9804745,
            2459390.9629745,
            2459390.9649769,
            2459390.9649769,
            2459390.9629745,
            2459390.9669907,
            2459390.9669907,
            2459390.9689931,
            2459390.9689931,
            2459390.9710069,
            2459390.9689931,
            2459390.9710069,
            2459390.9733912,
            2459390.9733912,
            2459390.9733912,
            2459390.9757523,
            2459390.9757523,
            2459390.9781134,
            2459390.9781134,
            2459390.9781134,
            2459390.9828472,
            2459390.9828472,
        ],
        "fid": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        "nid": [
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
        ],
        "dcmag": [
            17.18776120850724,
            14.195819077486222,
            17.406475158998877,
            17.32167894539666,
            17.204864326115214,
            17.408995803526878,
            14.18589614910271,
            17.190303194288884,
            17.295811143089832,
            14.200502024176384,
            17.300278772697972,
            17.289626601611015,
            17.188696167174,
            14.200700388434196,
            14.171918091768449,
            17.349472109274732,
            17.15134512124073,
            17.42240352052329,
            14.180283722871964,
            17.43911808647409,
            14.19692343234462,
            17.116678387486722,
            14.201333882232895,
            17.42343435989272,
        ],
        "candid": [
            1636475751315015012,
            1636480474615015006,
            1636480473015015000,
            1636462971915015003,
            1636464970015015029,
            1636464971915015001,
            1636462973515015007,
            1636466990015015026,
            1636466991915015002,
            1636468993515015005,
            1636468991915015002,
            1636471001915015001,
            1636468990015015032,
            1636471003515015005,
            1636473394615015007,
            1636473393015015000,
            1636473391315015012,
            1636475753015015001,
            1636475754615015004,
            1636478113015015000,
            1636478114615015003,
            1636478111315015007,
            1636482844615015006,
            1636482843015015001,
        ],
        "ssnamenr": [
            "1936",
            "760",
            "4963",
            "4963",
            "1936",
            "4963",
            "760",
            "1936",
            "4963",
            "760",
            "4963",
            "4963",
            "1936",
            "760",
            "760",
            "4963",
            "1936",
            "4963",
            "760",
            "4963",
            "760",
            "1936",
            "760",
            "4963",
        ],
        "trajectory_id": [
            4,
            6,
            3,
            3,
            4,
            3,
            6,
            4,
            3,
            6,
            3,
            3,
            4,
            6,
            6,
            3,
            4,
            3,
            6,
            3,
            6,
            4,
            6,
            3,
        ],
    }
)

remaining_new_obs_output = pd.DataFrame(
    {
        "ra": [190.3093822, 192.4757989, 250.1164907, 249.0639657, 328.36068],
        "dec": [-1.8656935, 4.0747939, -25.1107537, -8.4772727, -9.3780665],
        "jd": [
            2459390.6913889,
            2459390.7134838,
            2459390.7453356,
            2459390.814456,
            2459390.8690972,
        ],
        "fid": [1, 1, 1, 2, 2],
        "nid": [1636, 1636, 1636, 1636, 1636],
        "dcmag": [
            18.314560154790556,
            18.00043889328813,
            18.22956917803643,
            18.671504334026544,
            18.97395169454908,
        ],
        "candid": [
            1636191384715015000,
            1636213482115015000,
            1636245332415015004,
            1636314454515015038,
            1636369094215015007,
        ],
        "ssnamenr": ["4258", "4262", "22758", "23415", "42647"],
    }
)

tracklets_expected_metrics = {
    "number of separation association": 176,
    "number of association filtered by magnitude": 0,
    "association metrics": {
        "precision": 100.0,
        "recall": 100.0,
        "True Positif": 21,
        "False Positif": 0,
        "False Negatif": 0,
        "total real association": 21,
    },
    "number of intra night tracklets": 3,
}


tracklets_output_2 = pd.DataFrame({"trajectory_id": []})

remaining_new_obs_output_2 = pd.DataFrame(
    {
        "ra": [190.3093822, 192.4757989, 249.0639657],
        "dec": [-1.8656935, 4.0747939, -8.4772727],
        "jd": [2459390.6913889, 2459390.7134838, 2459390.814456],
        "fid": [1, 1, 2],
        "nid": [1636, 1636, 1636],
        "dcmag": [18.314560154790556, 18.00043889328813, 18.671504334026544],
        "candid": [1636191384715015000, 1636213482115015000, 1636314454515015038],
        "ssnamenr": ["4258", "4262", "23415"],
    }
)

# Test Trajectories and Tracklets associations Steps in Inter night associations

traj_sample = pd.DataFrame(
    {
        "ra": [
            186.5040008,
            168.6524972,
            167.4181099,
            168.6523934,
            170.4261379,
            170.9717685,
            170.962155,
            167.4075773,
            170.4161533,
            168.643705,
            168.6436267,
            186.4808089,
            173.3796056,
            173.3680826,
        ],
        "dec": [
            44.7314698,
            0.9052992,
            0.7732693,
            0.9053366,
            -6.1125869,
            -13.4971232,
            -13.491155,
            0.7772116,
            -6.1111145,
            0.9088778,
            0.9089254,
            44.7262375,
            7.9868333,
            7.9916832,
        ],
        "jd": [
            2459291.781875,
            2459291.7905556,
            2459291.7910185,
            2459291.7910185,
            2459291.7910185,
            2459291.7926042,
            2459291.835625,
            2459291.836088,
            2459291.836088,
            2459291.836088,
            2459291.8365509,
            2459291.8407176,
            2459291.7905556,
            2459291.8365509,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2],
        "nid": [
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
        ],
        "candid": [
            1537281870615015004,
            1537290551415015014,
            1537291016115015020,
            1537291016015015008,
            1537291011115015026,
            1537292601415015006,
            1537335621415015029,
            1537336086115015006,
            1537336081115015019,
            1537336086015015011,
            1537336551415015017,
            1537340710615015003,
            1537290555215015014,
            1537336555215015010,
        ],
        "dcmag": [
            18.24371301323446,
            16.743894489172938,
            17.368181071421624,
            16.723799914402477,
            14.332974466763252,
            17.537944743785797,
            16.929160615392856,
            16.83615755653922,
            18.644103030043368,
            16.216850388506607,
            16.240993228516896,
            17.64516573574104,
            17.470940376908793,
            16.761806758388268,
        ],
        "ssnamenr": [
            "99956",
            "3525",
            "5891",
            "3525",
            "99969",
            "10936",
            "10936",
            "5891",
            "99969",
            "3525",
            "3525",
            "99956",
            "1131",
            "1131",
        ],
        "trajectory_id": [4, 2, 3, 2, 5, 0, 0, 3, 5, 2, 2, 4, 1, 1],
        "not_updated": [
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "ref_epoch": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
    }
)

track_sample = pd.DataFrame(
    {
        "ra": [
            116.3740686,
            116.378338,
            167.2025741,
            170.7601106,
            170.7599095,
            167.1931768,
            168.4665006,
            167.1930804,
            162.624763,
            162.6243687,
            162.6237897,
            170.7460899,
            170.745984,
            167.1832584,
            168.4583886,
            162.6115944,
            162.6114272,
            162.6110749,
            203.95862,
            203.9477719,
            173.1350125,
            173.1244823,
        ],
        "dec": [
            46.9331292,
            46.9186626,
            0.8573175,
            -13.3601006,
            -13.3599521,
            0.8608448,
            0.9842065,
            0.860896,
            44.0008725,
            44.0006253,
            44.0002676,
            -13.3511835,
            -13.351098,
            0.8646139,
            0.9875339,
            43.9922395,
            43.9921097,
            43.9918713,
            -6.09188,
            -6.0865106,
            8.0921375,
            8.0965144,
        ],
        "jd": [
            2459292.6814699,
            2459292.7236343,
            2459292.753206,
            2459292.7726042,
            2459292.7735301,
            2459292.7938194,
            2459292.794294,
            2459292.794294,
            2459292.8075116,
            2459292.8084606,
            2459292.8098843,
            2459292.8358912,
            2459292.8363657,
            2459292.8368519,
            2459292.8368519,
            2459292.8411574,
            2459292.8416319,
            2459292.842581,
            2459292.8774421,
            2459292.936794,
            2459292.7956944,
            2459292.8378356,
        ],
        "fid": [1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2],
        "nid": [
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
        ],
        "candid": [
            1538181462815015010,
            1538223632815015014,
            1538253204815015007,
            1538272605615015000,
            1538273530315015016,
            1538293814815015009,
            1538294290315015019,
            1538294290215015013,
            1538307511415015016,
            1538308466015015005,
            1538309884815015004,
            1538335895615015000,
            1538336360315015011,
            1538336850215015012,
            1538336850315015022,
            1538341154815015003,
            1538341636015015009,
            1538342581415015003,
            1538377441515015040,
            1538436791515015047,
            1538295690615015016,
            1538337830615015025,
        ],
        "dcmag": [
            18.75538096440109,
            17.388190194142993,
            16.38345096268365,
            17.407960400594295,
            17.45544077836076,
            17.399079120824545,
            16.882386749897492,
            17.422983631636527,
            17.070684603766836,
            17.018834560517735,
            17.03552357727233,
            16.870491564990747,
            16.890761891765294,
            16.598299027841747,
            16.251481761141033,
            16.31657739361883,
            16.321679024232985,
            16.295972237444545,
            18.96152984542355,
            19.184091428608127,
            17.545962356941715,
            16.776867088160635,
        ],
        "ssnamenr": [
            "99949",
            "99949",
            "5891",
            "10936",
            "10936",
            "5891",
            "3525",
            "5891",
            "29147",
            "29147",
            "29147",
            "10936",
            "10936",
            "5891",
            "3525",
            "29147",
            "29147",
            "29147",
            "99946",
            "99946",
            "1131",
            "1131",
        ],
        "trajectory_id": [
            16,
            16,
            14,
            10,
            10,
            14,
            13,
            14,
            12,
            12,
            12,
            10,
            10,
            14,
            13,
            12,
            12,
            12,
            15,
            15,
            11,
            11,
        ],
        "not_updated": [
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "ref_epoch": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
    }
)

# - expected outputs

traj_not_updated_expected = pd.DataFrame(
    {
        "ra": [186.5040008, 170.4261379, 170.4161533, 186.4808089],
        "dec": [44.7314698, -6.1125869, -6.1111145, 44.7262375],
        "jd": [2459291.781875, 2459291.7910185, 2459291.836088, 2459291.8407176],
        "fid": [1, 1, 2, 2],
        "nid": [1537, 1537, 1537, 1537],
        "candid": [
            1537281870615015004,
            1537291011115015026,
            1537336081115015019,
            1537340710615015003,
        ],
        "dcmag": [
            18.24371301323446,
            14.332974466763252,
            18.644103030043368,
            17.64516573574104,
        ],
        "ssnamenr": ["99956", "99969", "99969", "99956"],
        "trajectory_id": [4, 5, 5, 4],
        "not_updated": [True, True, True, True],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

other_track_expected = pd.DataFrame(
    {
        "ra": [116.3740686, 116.378338, 203.95862, 203.9477719],
        "dec": [46.9331292, 46.9186626, -6.09188, -6.0865106],
        "jd": [2459292.6814699, 2459292.7236343, 2459292.8774421, 2459292.936794],
        "fid": [1, 2, 2, 1],
        "nid": [1538, 1538, 1538, 1538],
        "candid": [
            1538181462815015010,
            1538223632815015014,
            1538377441515015040,
            1538436791515015047,
        ],
        "dcmag": [
            18.75538096440109,
            17.388190194142993,
            18.96152984542355,
            19.184091428608127,
        ],
        "ssnamenr": ["99949", "99949", "99946", "99946"],
        "trajectory_id": [16, 16, 15, 15],
        "not_updated": [True, True, True, True],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

track_orb_expected = pd.DataFrame(
    {
        "ra": [
            168.6524972,
            168.6523934,
            168.643705,
            168.6436267,
            168.4665006,
            168.4583886,
            167.4181099,
            167.4075773,
            167.2025741,
            167.1931768,
            167.1930804,
            167.1832584,
            170.9717685,
            170.962155,
            170.7601106,
            170.7599095,
            170.7460899,
            170.745984,
            162.624763,
            162.6243687,
            162.6237897,
            162.6115944,
            162.6114272,
            162.6110749,
        ],
        "dec": [
            0.9052992,
            0.9053366,
            0.9088778,
            0.9089254,
            0.9842065,
            0.9875339,
            0.7732693,
            0.7772116,
            0.8573175,
            0.8608448,
            0.860896,
            0.8646139,
            -13.4971232,
            -13.491155,
            -13.3601006,
            -13.3599521,
            -13.3511835,
            -13.351098,
            44.0008725,
            44.0006253,
            44.0002676,
            43.9922395,
            43.9921097,
            43.9918713,
        ],
        "jd": [
            2459291.7905556,
            2459291.7910185,
            2459291.836088,
            2459291.8365509,
            2459292.794294,
            2459292.8368519,
            2459291.7910185,
            2459291.836088,
            2459292.753206,
            2459292.7938194,
            2459292.794294,
            2459292.8368519,
            2459291.7926042,
            2459291.835625,
            2459292.7726042,
            2459292.7735301,
            2459292.8358912,
            2459292.8363657,
            2459292.8075116,
            2459292.8084606,
            2459292.8098843,
            2459292.8411574,
            2459292.8416319,
            2459292.842581,
        ],
        "fid": [1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2],
        "nid": [
            1537,
            1537,
            1537,
            1537,
            1538,
            1538,
            1537,
            1537,
            1538,
            1538,
            1538,
            1538,
            1537,
            1537,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
        ],
        "candid": [
            1537290551415015014,
            1537291016015015008,
            1537336086015015011,
            1537336551415015017,
            1538294290315015019,
            1538336850315015022,
            1537291016115015020,
            1537336086115015006,
            1538253204815015007,
            1538293814815015009,
            1538294290215015013,
            1538336850215015012,
            1537292601415015006,
            1537335621415015029,
            1538272605615015000,
            1538273530315015016,
            1538335895615015000,
            1538336360315015011,
            1538307511415015016,
            1538308466015015005,
            1538309884815015004,
            1538341154815015003,
            1538341636015015009,
            1538342581415015003,
        ],
        "dcmag": [
            16.743894489172938,
            16.723799914402477,
            16.216850388506607,
            16.240993228516896,
            16.882386749897492,
            16.251481761141033,
            17.368181071421624,
            16.83615755653922,
            16.38345096268365,
            17.399079120824545,
            17.422983631636527,
            16.598299027841747,
            17.537944743785797,
            16.929160615392856,
            17.407960400594295,
            17.45544077836076,
            16.870491564990747,
            16.890761891765294,
            17.070684603766836,
            17.018834560517735,
            17.03552357727233,
            16.31657739361883,
            16.321679024232985,
            16.295972237444545,
        ],
        "ssnamenr": [
            "3525",
            "3525",
            "3525",
            "3525",
            "3525",
            "3525",
            "5891",
            "5891",
            "5891",
            "5891",
            "5891",
            "5891",
            "10936",
            "10936",
            "10936",
            "10936",
            "10936",
            "10936",
            "29147",
            "29147",
            "29147",
            "29147",
            "29147",
            "29147",
        ],
        "trajectory_id": [
            2,
            2,
            2,
            2,
            2,
            2,
            3,
            3,
            3,
            3,
            3,
            3,
            0,
            0,
            0,
            0,
            0,
            0,
            12,
            12,
            12,
            12,
            12,
            12,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            True,
            True,
            True,
            True,
            True,
            True,
        ],
        "provisional designation": [
            "K21F00C",
            "K21F00C",
            "K21F00C",
            "K21F00C",
            "K21F00C",
            "K21F00C",
            "K21F00D",
            "K21F00D",
            "K21F00D",
            "K21F00D",
            "K21F00D",
            "K21F00D",
            "K21F00A",
            "K21F00A",
            "K21F00A",
            "K21F00A",
            "K21F00A",
            "K21F00A",
            "K21F00N",
            "K21F00N",
            "K21F00N",
            "K21F00N",
            "K21F00N",
            "K21F00N",
        ],
        "ref_epoch": [
            2459291.789210112,
            2459291.789210112,
            2459291.789210112,
            2459291.789210112,
            2459291.789210112,
            2459291.789210112,
            2459292.718054266,
            2459292.718054266,
            2459292.718054266,
            2459292.718054266,
            2459292.718054266,
            2459292.718054266,
            2459292.73460517,
            2459292.73460517,
            2459292.73460517,
            2459292.73460517,
            2459292.73460517,
            2459292.73460517,
            2459292.768442255,
            2459292.768442255,
            2459292.768442255,
            2459292.768442255,
            2459292.768442255,
            2459292.768442255,
        ],
        "a": [
            1.559445761719178,
            1.559445761719178,
            1.559445761719178,
            1.559445761719178,
            1.559445761719178,
            1.559445761719178,
            1.4462063804947276,
            1.4462063804947276,
            1.4462063804947276,
            1.4462063804947276,
            1.4462063804947276,
            1.4462063804947276,
            1.9032215831605253,
            1.9032215831605253,
            1.9032215831605253,
            1.9032215831605253,
            1.9032215831605253,
            1.9032215831605253,
            0.873159936610304,
            0.873159936610304,
            0.873159936610304,
            0.873159936610304,
            0.873159936610304,
            0.873159936610304,
        ],
        "e": [
            0.172255774041509,
            0.172255774041509,
            0.172255774041509,
            0.172255774041509,
            0.172255774041509,
            0.172255774041509,
            0.139367571636477,
            0.139367571636477,
            0.139367571636477,
            0.139367571636477,
            0.139367571636477,
            0.139367571636477,
            0.459819088028512,
            0.459819088028512,
            0.459819088028512,
            0.459819088028512,
            0.459819088028512,
            0.459819088028512,
            0.497851080722456,
            0.497851080722456,
            0.497851080722456,
            0.497851080722456,
            0.497851080722456,
            0.497851080722456,
        ],
        "i": [
            1.0220113353982,
            1.0220113353982,
            1.0220113353982,
            1.0220113353982,
            1.0220113353982,
            1.0220113353982,
            0.9180094404804,
            0.9180094404804,
            0.9180094404804,
            0.9180094404804,
            0.9180094404804,
            0.9180094404804,
            6.9612744498974,
            6.9612744498974,
            6.9612744498974,
            6.9612744498974,
            6.9612744498974,
            6.9612744498974,
            24.7196038142678,
            24.7196038142678,
            24.7196038142678,
            24.7196038142678,
            24.7196038142678,
            24.7196038142678,
        ],
        "long. node": [
            288.611992803378,
            288.611992803378,
            288.611992803378,
            288.611992803378,
            288.611992803378,
            288.611992803378,
            269.357956247959,
            269.357956247959,
            269.357956247959,
            269.357956247959,
            269.357956247959,
            269.357956247959,
            212.2493916922841,
            212.2493916922841,
            212.2493916922841,
            212.2493916922841,
            212.2493916922841,
            212.2493916922841,
            178.1160546687316,
            178.1160546687316,
            178.1160546687316,
            178.1160546687316,
            178.1160546687316,
            178.1160546687316,
        ],
        "<NAME>": [
            207.1877577853199,
            207.1877577853199,
            207.1877577853199,
            207.1877577853199,
            207.1877577853199,
            207.1877577853199,
            295.3600175861495,
            295.3600175861495,
            295.3600175861495,
            295.3600175861495,
            295.3600175861495,
            295.3600175861495,
            37.6055931919099,
            37.6055931919099,
            37.6055931919099,
            37.6055931919099,
            37.6055931919099,
            37.6055931919099,
            226.8832404690586,
            226.8832404690586,
            226.8832404690586,
            226.8832404690586,
            226.8832404690586,
            226.8832404690586,
        ],
        "mean anomaly": [
            28.2408416499565,
            28.2408416499565,
            28.2408416499565,
            28.2408416499565,
            28.2408416499565,
            28.2408416499565,
            338.5028638743083,
            338.5028638743083,
            338.5028638743083,
            338.5028638743083,
            338.5028638743083,
            338.5028638743083,
            331.8559386949461,
            331.8559386949461,
            331.8559386949461,
            331.8559386949461,
            331.8559386949461,
            331.8559386949461,
            79.5353878032673,
            79.5353878032673,
            79.5353878032673,
            79.5353878032673,
            79.5353878032673,
            79.5353878032673,
        ],
        "rms_a": [
            0.258929,
            0.258929,
            0.258929,
            0.258929,
            0.258929,
            0.258929,
            0.641555,
            0.641555,
            0.641555,
            0.641555,
            0.641555,
            0.641555,
            2.73653,
            2.73653,
            2.73653,
            2.73653,
            2.73653,
            2.73653,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            0.754289,
            0.754289,
            0.754289,
            0.754289,
            0.754289,
            0.754289,
            0.672692,
            0.672692,
            0.672692,
            0.672692,
            0.672692,
            0.672692,
            1.13127,
            1.13127,
            1.13127,
            1.13127,
            1.13127,
            1.13127,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            1.62077,
            1.62077,
            1.62077,
            1.62077,
            1.62077,
            1.62077,
            0.228257,
            0.228257,
            0.228257,
            0.228257,
            0.228257,
            0.228257,
            10.1173,
            10.1173,
            10.1173,
            10.1173,
            10.1173,
            10.1173,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            208.206,
            208.206,
            208.206,
            208.206,
            208.206,
            208.206,
            171.829,
            171.829,
            171.829,
            171.829,
            171.829,
            171.829,
            53.5567,
            53.5567,
            53.5567,
            53.5567,
            53.5567,
            53.5567,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            702.419,
            702.419,
            702.419,
            702.419,
            702.419,
            702.419,
            453.415,
            453.415,
            453.415,
            453.415,
            453.415,
            453.415,
            86.6842,
            86.6842,
            86.6842,
            86.6842,
            86.6842,
            86.6842,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            323.212,
            323.212,
            323.212,
            323.212,
            323.212,
            323.212,
            186.464,
            186.464,
            186.464,
            186.464,
            186.464,
            186.464,
            71.7878,
            71.7878,
            71.7878,
            71.7878,
            71.7878,
            71.7878,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
    }
)

traj_track_metrics_expected = {
    "updated trajectories": [0.0, 1.0, 2.0, 3.0],
    "all nid_report": [
        {
            "old nid": 1537,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 4,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {
                    "precision": 0.0,
                    "recall": 0.0,
                    "True Positif": 0,
                    "False Positif": 4,
                    "False Negatif": 0,
                    "total real association": 0,
                },
            },
        }
    ],
}

small_traj_expected = pd.DataFrame(
    {
        "ra": [173.3796056, 173.3680826, 173.1350125, 173.1244823],
        "dec": [7.9868333, 7.9916832, 8.0921375, 8.0965144],
        "jd": [2459291.7905556, 2459291.8365509, 2459292.7956944, 2459292.8378356],
        "fid": [1, 2, 1, 2],
        "nid": [1537, 1537, 1538, 1538],
        "candid": [
            1537290555215015014,
            1537336555215015010,
            1538295690615015016,
            1538337830615015025,
        ],
        "dcmag": [
            17.470940376908793,
            16.761806758388268,
            17.545962356941715,
            16.776867088160635,
        ],
        "ssnamenr": ["1131", "1131", "1131", "1131"],
        "trajectory_id": [1, 1, 1, 1],
        "not_updated": [False, False, False, False],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

# Test Trajectories and new observations associations Steps in Inter night associations

traj_sample_2 = pd.DataFrame(
    {
        "ra": [
            113.5161051,
            115.9766909,
            144.8664828,
            144.8664282,
            144.8568979,
            113.5120529,
            113.5119507,
            115.9704401,
            300.575368,
            300.5781883,
            300.5790747,
        ],
        "dec": [
            15.4004424,
            52.362439,
            31.5997876,
            31.5998135,
            31.6001948,
            15.4031158,
            15.4031798,
            52.3384133,
            -4.0623298,
            -4.0616476,
            -4.0614048,
        ],
        "ssnamenr": [
            "28691",
            "99949",
            "99930",
            "99930",
            "99930",
            "28691",
            "28691",
            "99949",
            "3728",
            "3728",
            "3728",
        ],
        "jd": [
            2459276.7106944,
            2459276.713912,
            2459276.7286343,
            2459276.7291088,
            2459276.7775231,
            2459276.7800347,
            2459276.7819329,
            2459276.7856944,
            2459277.0352662,
            2459277.0440509,
            2459277.0469792,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2],
        "nid": [1522, 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1522],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanyihd",
            "ZTF21aanykrh",
            "ZTF21aanyoyw",
            "ZTF21aanyoyw",
            "ZTF21aanzjrd",
            "ZTF21aanzlqo",
            "ZTF21aanzlqo",
            "ZTF21aanzopx",
            "ZTF21aaobpfj",
            "ZTF21aaobqot",
            "ZTF21aaobqxg",
        ],
        "candid": [
            1522210695615015001,
            1522213910515015003,
            1522228631915015011,
            1522229103015015014,
            1522277521915015006,
            1522280035615015002,
            1522281930315015009,
            1522285690515015012,
            1522535261815015007,
            1522544051815015004,
            1522546971815015005,
        ],
        "magpsf": [
            18.694379806518555,
            18.999000549316406,
            18.895910263061523,
            18.888437271118164,
            18.275619506835938,
            18.254955291748047,
            18.321918487548828,
            17.851123809814453,
            17.91790771484375,
            17.964813232421875,
            17.9420223236084,
        ],
        "sigmapsf": [
            0.08066412061452866,
            0.10815799236297607,
            0.07555245608091354,
            0.0981987938284874,
            0.07174281775951385,
            0.0689801573753357,
            0.07774920016527176,
            0.048972807824611664,
            0.11288779228925705,
            0.08232304453849792,
            0.06886935234069824,
        ],
        "magnr": [
            22.760000228881836,
            22.451000213623047,
            22.798999786376953,
            23.171998977661133,
            23.023000717163086,
            22.624000549316406,
            22.215999603271484,
            22.635000228881836,
            21.895000457763672,
            21.895000457763672,
            16.204999923706055,
        ],
        "sigmagnr": [
            0.31200000643730164,
            0.21400000154972076,
            0.3330000042915344,
            0.34200000762939453,
            0.3330000042915344,
            0.2840000092983246,
            0.22599999606609344,
            0.28200000524520874,
            0.1340000033378601,
            0.1340000033378601,
            0.01600000075995922,
        ],
        "magzpsci": [
            26.38237953186035,
            26.413000106811523,
            26.31390953063965,
            26.340438842773438,
            26.266620635986328,
            26.25095558166504,
            26.057918548583984,
            26.31112289428711,
            26.08490753173828,
            26.115812301635742,
            26.130022048950195,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.670297450941028,
            18.95811945264242,
            18.866195775358634,
            18.867924932665797,
            18.2618987979544,
            18.23528620354176,
            18.28580399353136,
            17.838383673470858,
            17.885221059900132,
            17.93164863680288,
            15.883371362435756,
        ],
        "dcmagerr": [
            0.0791909464641598,
            0.10446100102873071,
            0.07406042965891489,
            0.09657332250639565,
            0.0709652051872327,
            0.06793337306584203,
            0.07556816827015138,
            0.0485131793944022,
            0.10961195779634823,
            0.07994814397430444,
            0.017083043965914837,
        ],
        "trajectory_id": [0, 3, 2, 2, 2, 0, 0, 3, 1, 1, 1],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
        ],
    }
)

new_obs_sample = pd.DataFrame(
    {
        "ra": [113.630711, 113.4235261, 208.1300173, 224.2631717, 301.2054266],
        "dec": [18.2657994, 15.4768524, -26.5825343, 4.9952381, -3.9005005],
        "ssnamenr": ["100068", "28691", "99961", "100052", "3728"],
        "jd": [
            2459278.686412,
            2459278.7137269,
            2459278.9394792,
            2459278.9583218,
            2459279.0453935,
        ],
        "fid": [2, 1, 2, 2, 2],
        "nid": [1524, 1524, 1524, 1524, 1524],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aaocqpx",
            "ZTF21aaocytl",
            "ZTF21aaogdtq",
            "ZTF21aaoggor",
            "ZTF21aaogrom",
        ],
        "candid": [
            1524186412915015024,
            1524213721415015086,
            1524439470415015002,
            1524458324715015007,
            1524545391815015002,
        ],
        "magpsf": [
            19.143362045288086,
            18.73301887512207,
            18.811845779418945,
            19.057483673095703,
            18.034717559814453,
        ],
        "sigmapsf": [
            0.10398470610380173,
            0.12779207527637482,
            0.13058899343013763,
            0.11876894533634186,
            0.13105228543281555,
        ],
        "magnr": [
            22.868000030517578,
            18.891000747680664,
            22.079999923706055,
            22.809999465942383,
            20.572999954223633,
        ],
        "sigmagnr": [
            0.3179999887943268,
            0.017999999225139618,
            0.1979999989271164,
            0.27000001072883606,
            0.07999999821186066,
        ],
        "magzpsci": [
            26.325361251831055,
            25.975017547607422,
            26.238845825195312,
            26.357484817504883,
            26.193716049194336,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t"],
        "dcmag": [
            19.110317561887875,
            17.880204964203514,
            18.757883876849455,
            19.026190442703804,
            17.92725547303823,
        ],
        "dcmagerr": [
            0.10131703650885979,
            0.0590784856331265,
            0.12462757904029284,
            0.1156493141389798,
            0.11894163004867943,
        ],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
    }
)

# - expected outputs

other_traj_expected = pd.DataFrame(
    {
        "ra": [115.9766909, 144.8664828, 144.8664282, 144.8568979, 115.9704401],
        "dec": [52.362439, 31.5997876, 31.5998135, 31.6001948, 52.3384133],
        "ssnamenr": ["99949", "99930", "99930", "99930", "99949"],
        "jd": [
            2459276.713912,
            2459276.7286343,
            2459276.7291088,
            2459276.7775231,
            2459276.7856944,
        ],
        "fid": [1, 1, 1, 2, 2],
        "nid": [1522, 1522, 1522, 1522, 1522],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanykrh",
            "ZTF21aanyoyw",
            "ZTF21aanyoyw",
            "ZTF21aanzjrd",
            "ZTF21aanzopx",
        ],
        "candid": [
            1522213910515015003,
            1522228631915015011,
            1522229103015015014,
            1522277521915015006,
            1522285690515015012,
        ],
        "magpsf": [
            18.999000549316406,
            18.895910263061523,
            18.888437271118164,
            18.275619506835938,
            17.851123809814453,
        ],
        "sigmapsf": [
            0.10815799236297607,
            0.07555245608091354,
            0.0981987938284874,
            0.07174281775951385,
            0.048972807824611664,
        ],
        "magnr": [
            22.451000213623047,
            22.798999786376953,
            23.171998977661133,
            23.023000717163086,
            22.635000228881836,
        ],
        "sigmagnr": [
            0.21400000154972076,
            0.3330000042915344,
            0.34200000762939453,
            0.3330000042915344,
            0.28200000524520874,
        ],
        "magzpsci": [
            26.413000106811523,
            26.31390953063965,
            26.340438842773438,
            26.266620635986328,
            26.31112289428711,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t"],
        "dcmag": [
            18.95811945264242,
            18.866195775358634,
            18.867924932665797,
            18.2618987979544,
            17.838383673470858,
        ],
        "dcmagerr": [
            0.10446100102873071,
            0.07406042965891489,
            0.09657332250639565,
            0.0709652051872327,
            0.0485131793944022,
        ],
        "trajectory_id": [3, 2, 2, 2, 3],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True, True],
    }
)

remaining_new_observations_expected = pd.DataFrame(
    {
        "ra": [113.630711, 208.1300173, 224.2631717],
        "dec": [18.2657994, -26.5825343, 4.9952381],
        "ssnamenr": ["100068", "99961", "100052"],
        "jd": [2459278.686412, 2459278.9394792, 2459278.9583218],
        "fid": [2, 2, 2],
        "nid": [1524, 1524, 1524],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aaocqpx", "ZTF21aaogdtq", "ZTF21aaoggor"],
        "candid": [1524186412915015024, 1524439470415015002, 1524458324715015007],
        "magpsf": [19.143362045288086, 18.811845779418945, 19.057483673095703],
        "sigmapsf": [0.10398470610380173, 0.13058899343013763, 0.11876894533634186],
        "magnr": [22.868000030517578, 22.079999923706055, 22.809999465942383],
        "sigmagnr": [0.3179999887943268, 0.1979999989271164, 0.27000001072883606],
        "magzpsci": [26.325361251831055, 26.238845825195312, 26.357484817504883],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [19.110317561887875, 18.757883876849455, 19.026190442703804],
        "dcmagerr": [0.10131703650885979, 0.12462757904029284, 0.1156493141389798],
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
    }
)

traj_orb_expected = pd.DataFrame(
    {
        "ra": [
            113.5161051,
            113.5120529,
            113.5119507,
            113.4235261,
            300.575368,
            300.5781883,
            300.5790747,
            301.2054266,
        ],
        "dec": [
            15.4004424,
            15.4031158,
            15.4031798,
            15.4768524,
            -4.0623298,
            -4.0616476,
            -4.0614048,
            -3.9005005,
        ],
        "ssnamenr": [
            "28691",
            "28691",
            "28691",
            "28691",
            "3728",
            "3728",
            "3728",
            "3728",
        ],
        "jd": [
            2459276.7106944,
            2459276.7800347,
            2459276.7819329,
            2459278.7137269,
            2459277.0352662,
            2459277.0440509,
            2459277.0469792,
            2459279.0453935,
        ],
        "fid": [1, 2, 2, 1, 2, 2, 2, 2],
        "nid": [1522, 1522, 1522, 1524, 1522, 1522, 1522, 1524],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanyihd",
            "ZTF21aanzlqo",
            "ZTF21aanzlqo",
            "ZTF21aaocytl",
            "ZTF21aaobpfj",
            "ZTF21aaobqot",
            "ZTF21aaobqxg",
            "ZTF21aaogrom",
        ],
        "candid": [
            1522210695615015001,
            1522280035615015002,
            1522281930315015009,
            1524213721415015086,
            1522535261815015007,
            1522544051815015004,
            1522546971815015005,
            1524545391815015002,
        ],
        "magpsf": [
            18.694379806518555,
            18.254955291748047,
            18.321918487548828,
            18.73301887512207,
            17.91790771484375,
            17.964813232421875,
            17.9420223236084,
            18.034717559814453,
        ],
        "sigmapsf": [
            0.08066412061452866,
            0.0689801573753357,
            0.07774920016527176,
            0.12779207527637482,
            0.11288779228925705,
            0.08232304453849792,
            0.06886935234069824,
            0.13105228543281555,
        ],
        "magnr": [
            22.760000228881836,
            22.624000549316406,
            22.215999603271484,
            18.891000747680664,
            21.895000457763672,
            21.895000457763672,
            16.204999923706055,
            20.572999954223633,
        ],
        "sigmagnr": [
            0.31200000643730164,
            0.2840000092983246,
            0.22599999606609344,
            0.017999999225139618,
            0.1340000033378601,
            0.1340000033378601,
            0.01600000075995922,
            0.07999999821186066,
        ],
        "magzpsci": [
            26.38237953186035,
            26.25095558166504,
            26.057918548583984,
            25.975017547607422,
            26.08490753173828,
            26.115812301635742,
            26.130022048950195,
            26.193716049194336,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.670297450941028,
            18.23528620354176,
            18.28580399353136,
            17.880204964203514,
            17.885221059900132,
            17.93164863680288,
            15.883371362435756,
            17.92725547303823,
        ],
        "dcmagerr": [
            0.0791909464641598,
            0.06793337306584203,
            0.07556816827015138,
            0.0590784856331265,
            0.10961195779634823,
            0.07994814397430444,
            0.017083043965914837,
            0.11894163004867943,
        ],
        "trajectory_id": [0, 0, 0, 0, 1, 1, 1, 1],
        "provisional designation": [
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00B",
            "K21E00B",
            "K21E00B",
            "K21E00B",
        ],
        "ref_epoch": [
            2459276.73705011,
            2459276.73705011,
            2459276.73705011,
            2459276.73705011,
            2459276.972787451,
            2459276.972787451,
            2459276.972787451,
            2459276.972787451,
        ],
        "a": [
            2.045247924877714,
            2.045247924877714,
            2.045247924877714,
            2.045247924877714,
            3.631373977515124,
            3.631373977515124,
            3.631373977515124,
            3.631373977515124,
        ],
        "e": [
            0.226628667362174,
            0.226628667362174,
            0.226628667362174,
            0.226628667362174,
            0.753720999812878,
            0.753720999812878,
            0.753720999812878,
            0.753720999812878,
        ],
        "i": [
            3.8098742126947,
            3.8098742126947,
            3.8098742126947,
            3.8098742126947,
            6.2640774176343,
            6.2640774176343,
            6.2640774176343,
            6.2640774176343,
        ],
        "long. node": [
            238.666381451279,
            238.666381451279,
            238.666381451279,
            238.666381451279,
            155.9882013723979,
            155.9882013723979,
            155.9882013723979,
            155.9882013723979,
        ],
        "arg. peric": [
            350.3792330754913,
            350.3792330754913,
            350.3792330754913,
            350.3792330754913,
            39.1867174459162,
            39.1867174459162,
            39.1867174459162,
            39.1867174459162,
        ],
        "mean anomaly": [
            292.3984747695732,
            292.3984747695732,
            292.3984747695732,
            292.3984747695732,
            357.1129429971405,
            357.1129429971405,
            357.1129429971405,
            357.1129429971405,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [False, False, False, False, False, False, False, False],
    }
)

# Test Old observations and Tracklets associations Steps in Inter night associations

old_obs_sample = pd.DataFrame(
    {
        "ra": [
            92.0087889,
            103.7587267,
            162.4834896,
            123.8027539,
            103.6863524,
            162.4600928,
            193.0789323,
        ],
        "dec": [
            40.1530657,
            44.5252852,
            15.5037062,
            40.292739,
            28.7771754,
            22.1389033,
            8.1612066,
        ],
        "ssnamenr": ["99920", "100011", "9648", "100040", "100007", "9798", "10141"],
        "jd": [
            2459276.6631134,
            2459276.664537,
            2459276.7584259,
            2459276.7780324,
            2459276.7824074,
            2459276.8375579,
            2459276.8784954,
        ],
        "fid": [2, 2, 1, 2, 2, 2, 2],
        "nid": [1522, 1522, 1522, 1522, 1522, 1522, 1522],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanxtga",
            "ZTF21aanxudg",
            "ZTF21aanzbqo",
            "ZTF21aanzivy",
            "ZTF21aanznau",
            "ZTF21aanzzqg",
            "ZTF21aaoawnr",
        ],
        "candid": [
            1522163111715015006,
            1522164530215015004,
            1522258421415015026,
            1522278032115015001,
            1522282406315015010,
            1522337556115015013,
            1522378495315015001,
        ],
        "magpsf": [
            18.949705123901367,
            19.590517044067383,
            18.48122215270996,
            17.90482521057129,
            19.103891372680664,
            16.557010650634766,
            16.666120529174805,
        ],
        "sigmapsf": [
            0.08777513355016708,
            0.11668884754180908,
            0.09149670600891113,
            0.051000598818063736,
            0.0934842973947525,
            0.03837168961763382,
            0.04247678071260452,
        ],
        "magnr": [
            20.98200035095215,
            22.591999053955078,
            22.698999404907227,
            21.69499969482422,
            22.945999145507812,
            20.839000701904297,
            22.79800033569336,
        ],
        "sigmagnr": [
            0.06199999898672104,
            0.2849999964237213,
            0.23999999463558197,
            0.1080000028014183,
            0.3619999885559082,
            0.039000000804662704,
            0.36000001430511475,
        ],
        "magzpsci": [
            26.302705764770508,
            26.18451690673828,
            26.1732234954834,
            26.3148250579834,
            26.206892013549805,
            26.07801055908203,
            26.240121841430664,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.797990408030735,
            19.51859517298127,
            18.45585679029058,
            17.87338957776582,
            19.070816915757433,
            16.532080295555772,
            16.662174736490613,
        ],
        "dcmagerr": [
            0.07675535718167358,
            0.11072679243160007,
            0.08955554492570561,
            0.049640909960709,
            0.09132759275947543,
            0.037511097269921925,
            0.04234283512121146,
        ],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
    }
)

track_sample_2 = pd.DataFrame(
    {
        "ra": [
            161.9661916,
            162.079508,
            161.9581831,
            162.0733505,
            192.7468513,
            191.2799858,
            192.7278852,
            191.2451751,
        ],
        "dec": [
            15.6892091,
            22.3057623,
            15.6919695,
            22.3083508,
            8.2857081,
            45.1262247,
            8.2924203,
            45.1288944,
        ],
        "ssnamenr": [
            "9648",
            "9798",
            "9648",
            "9798",
            "10141",
            "99956",
            "10141",
            "99956",
        ],
        "jd": [
            2459278.7617708,
            2459278.7617708,
            2459278.7919329,
            2459278.7919329,
            2459278.818588,
            2459278.8512153,
            2459278.9221875,
            2459278.9486343,
        ],
        "fid": [1, 1, 2, 2, 1, 1, 2, 2],
        "nid": [1524, 1524, 1524, 1524, 1524, 1524, 1524, 1524],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aaodryj",
            "ZTF21aaodrux",
            "ZTF21aaoejfn",
            "ZTF21aaoeior",
            "ZTF21aaoetco",
            "ZTF21aaoexoh",
            "ZTF21aaofylx",
            "ZTF21aaogfrn",
        ],
        "candid": [
            1524261770215015013,
            1524261774915015011,
            1524291930215015012,
            1524291934915015005,
            1524318581015015017,
            1524351211215015004,
            1524422181015015020,
            1524448631215015002,
        ],
        "magpsf": [
            18.48137092590332,
            17.410818099975586,
            17.688735961914062,
            16.532590866088867,
            17.310577392578125,
            18.07114601135254,
            16.649301528930664,
            17.442279815673828,
        ],
        "sigmapsf": [
            0.09166973829269409,
            0.06021394580602646,
            0.04816843941807747,
            0.031043054535984993,
            0.045813847333192825,
            0.0635342225432396,
            0.04310397803783417,
            0.05552997812628746,
        ],
        "magnr": [
            22.35300064086914,
            22.81100082397461,
            23.097999572753906,
            22.856000900268555,
            19.447999954223633,
            23.288000106811523,
            21.869998931884766,
            22.934999465942383,
        ],
        "sigmagnr": [
            0.21799999475479126,
            0.2980000078678131,
            0.3449999988079071,
            0.34599998593330383,
            0.026000000536441803,
            0.3230000138282776,
            0.12200000137090683,
            0.3479999899864197,
        ],
        "magzpsci": [
            26.158370971679688,
            26.291818618774414,
            26.182735443115234,
            26.220590591430664,
            26.34857749938965,
            26.381145477294922,
            26.23830223083496,
            26.277280807495117,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.446161166049862,
            17.403102322155167,
            17.680657883195302,
            16.529222260425907,
            17.171513405357267,
            18.062735135363535,
            16.640175162236993,
            17.43541938581569,
        ],
        "dcmagerr": [
            0.08901684272965601,
            0.05982478176648555,
            0.04787973191104046,
            0.030965445394305197,
            0.040427152330406134,
            0.06309319638211854,
            0.04275537488480032,
            0.0552237272814471,
        ],
        "trajectory_id": [5, 6, 5, 6, 4, 7, 4, 7],
        "not_updated": [True, True, True, True, True, True, True, True],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
    }
)

# - expected outputs

remaining_track_expected = pd.DataFrame(
    {
        "ra": [191.2799858, 191.2451751],
        "dec": [45.1262247, 45.1288944],
        "ssnamenr": ["99956", "99956"],
        "jd": [2459278.8512153, 2459278.9486343],
        "fid": [1, 2],
        "nid": [1524, 1524],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aaoexoh", "ZTF21aaogfrn"],
        "candid": [1524351211215015004, 1524448631215015002],
        "magpsf": [18.07114601135254, 17.442279815673828],
        "sigmapsf": [0.0635342225432396, 0.05552997812628746],
        "magnr": [23.288000106811523, 22.934999465942383],
        "sigmagnr": [0.3230000138282776, 0.3479999899864197],
        "magzpsci": [26.381145477294922, 26.277280807495117],
        "isdiffpos": ["t", "t"],
        "dcmag": [18.062735135363535, 17.43541938581569],
        "dcmagerr": [0.06309319638211854, 0.0552237272814471],
        "trajectory_id": [7, 7],
        "not_updated": [True, True],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
    }
)

remaining_old_observations_expected = pd.DataFrame(
    {
        "ra": [92.0087889, 103.7587267, 123.8027539, 103.6863524],
        "dec": [40.1530657, 44.5252852, 40.292739, 28.7771754],
        "ssnamenr": ["99920", "100011", "100040", "100007"],
        "jd": [2459276.6631134, 2459276.664537, 2459276.7780324, 2459276.7824074],
        "fid": [2, 2, 2, 2],
        "nid": [1522, 1522, 1522, 1522],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": ["ZTF21aanxtga", "ZTF21aanxudg", "ZTF21aanzivy", "ZTF21aanznau"],
        "candid": [
            1522163111715015006,
            1522164530215015004,
            1522278032115015001,
            1522282406315015010,
        ],
        "magpsf": [
            18.949705123901367,
            19.590517044067383,
            17.90482521057129,
            19.103891372680664,
        ],
        "sigmapsf": [
            0.08777513355016708,
            0.11668884754180908,
            0.051000598818063736,
            0.0934842973947525,
        ],
        "magnr": [
            20.98200035095215,
            22.591999053955078,
            21.69499969482422,
            22.945999145507812,
        ],
        "sigmagnr": [
            0.06199999898672104,
            0.2849999964237213,
            0.1080000028014183,
            0.3619999885559082,
        ],
        "magzpsci": [
            26.302705764770508,
            26.18451690673828,
            26.3148250579834,
            26.206892013549805,
        ],
        "isdiffpos": ["t", "t", "t", "t"],
        "dcmag": [
            18.797990408030735,
            19.51859517298127,
            17.87338957776582,
            19.070816915757433,
        ],
        "dcmagerr": [
            0.07675535718167358,
            0.11072679243160007,
            0.049640909960709,
            0.09132759275947543,
        ],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

traj_orb_expected_2 = pd.DataFrame(
    {
        "ra": [
            161.9661916,
            161.9581831,
            162.4834896,
            162.079508,
            162.0733505,
            162.4600928,
            192.7468513,
            192.7278852,
            193.0789323,
        ],
        "dec": [
            15.6892091,
            15.6919695,
            15.5037062,
            22.3057623,
            22.3083508,
            22.1389033,
            8.2857081,
            8.2924203,
            8.1612066,
        ],
        "ssnamenr": [
            "9648",
            "9648",
            "9648",
            "9798",
            "9798",
            "9798",
            "10141",
            "10141",
            "10141",
        ],
        "jd": [
            2459278.7617708,
            2459278.7919329,
            2459276.7584259,
            2459278.7617708,
            2459278.7919329,
            2459276.8375579,
            2459278.818588,
            2459278.9221875,
            2459276.8784954,
        ],
        "fid": [1, 2, 1, 1, 2, 2, 1, 2, 2],
        "nid": [1524, 1524, 1522, 1524, 1524, 1522, 1524, 1524, 1522],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aaodryj",
            "ZTF21aaoejfn",
            "ZTF21aanzbqo",
            "ZTF21aaodrux",
            "ZTF21aaoeior",
            "ZTF21aanzzqg",
            "ZTF21aaoetco",
            "ZTF21aaofylx",
            "ZTF21aaoawnr",
        ],
        "candid": [
            1524261770215015013,
            1524291930215015012,
            1522258421415015026,
            1524261774915015011,
            1524291934915015005,
            1522337556115015013,
            1524318581015015017,
            1524422181015015020,
            1522378495315015001,
        ],
        "magpsf": [
            18.48137092590332,
            17.688735961914062,
            18.48122215270996,
            17.410818099975586,
            16.532590866088867,
            16.557010650634766,
            17.310577392578125,
            16.649301528930664,
            16.666120529174805,
        ],
        "sigmapsf": [
            0.09166973829269409,
            0.04816843941807747,
            0.09149670600891113,
            0.06021394580602646,
            0.031043054535984993,
            0.03837168961763382,
            0.045813847333192825,
            0.04310397803783417,
            0.04247678071260452,
        ],
        "magnr": [
            22.35300064086914,
            23.097999572753906,
            22.698999404907227,
            22.81100082397461,
            22.856000900268555,
            20.839000701904297,
            19.447999954223633,
            21.869998931884766,
            22.79800033569336,
        ],
        "sigmagnr": [
            0.21799999475479126,
            0.3449999988079071,
            0.23999999463558197,
            0.2980000078678131,
            0.34599998593330383,
            0.039000000804662704,
            0.026000000536441803,
            0.12200000137090683,
            0.36000001430511475,
        ],
        "magzpsci": [
            26.158370971679688,
            26.182735443115234,
            26.1732234954834,
            26.291818618774414,
            26.220590591430664,
            26.07801055908203,
            26.34857749938965,
            26.23830223083496,
            26.240121841430664,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.446161166049862,
            17.680657883195302,
            18.45585679029058,
            17.403102322155167,
            16.529222260425907,
            16.532080295555772,
            17.171513405357267,
            16.640175162236993,
            16.662174736490613,
        ],
        "dcmagerr": [
            0.08901684272965601,
            0.04787973191104046,
            0.08955554492570561,
            0.05982478176648555,
            0.030965445394305197,
            0.037511097269921925,
            0.040427152330406134,
            0.04275537488480032,
            0.04234283512121146,
        ],
        "trajectory_id": [5, 5, 5, 6, 6, 6, 4, 4, 4],
        "not_updated": [False, False, False, False, False, False, False, False, False],
        "provisional designation": [
            "K21E00F",
            "K21E00F",
            "K21E00F",
            "K21E00G",
            "K21E00G",
            "K21E00G",
            "K21E00E",
            "K21E00E",
            "K21E00E",
        ],
        "ref_epoch": [
            2459278.726063516,
            2459278.726063516,
            2459278.726063516,
            2459278.724601283,
            2459278.724601283,
            2459278.724601283,
            2459278.773746477,
            2459278.773746477,
            2459278.773746477,
        ],
        "a": [
            2.3707418113470933,
            2.3707418113470933,
            2.3707418113470933,
            1.792450345712722,
            1.792450345712722,
            1.792450345712722,
            1.7215158936547512,
            1.7215158936547512,
            1.7215158936547512,
        ],
        "e": [
            0.779980097563079,
            0.779980097563079,
            0.779980097563079,
            0.494532176023262,
            0.494532176023262,
            0.494532176023262,
            0.314683773493673,
            0.314683773493673,
            0.314683773493673,
        ],
        "i": [
            6.1345978178853,
            6.1345978178853,
            6.1345978178853,
            6.4523305836603,
            6.4523305836603,
            6.4523305836603,
            3.2251129938703,
            3.2251129938703,
            3.2251129938703,
        ],
        "long. node": [
            159.6236681266895,
            159.6236681266895,
            159.6236681266895,
            131.3217210296768,
            131.3217210296768,
            131.3217210296768,
            78.7179359722708,
            78.7179359722708,
            78.7179359722708,
        ],
        "arg. peric": [
            265.3835827797645,
            265.3835827797645,
            265.3835827797645,
            305.5851330080031,
            305.5851330080031,
            305.5851330080031,
            39.9884068173304,
            39.9884068173304,
            39.9884068173304,
        ],
        "mean anomaly": [
            13.3275505526146,
            13.3275505526146,
            13.3275505526146,
            32.895438876027,
            32.895438876027,
            32.895438876027,
            27.3335771675384,
            27.3335771675384,
            27.3335771675384,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
    }
)


# Test night_to_night_association

trajectory_df_1 = pd.DataFrame(
    {
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True],
        "trajectory_id": [0, 0, 0, 0],
        "ra": [232.2341868, 229.1117136, 225.6399955, 224.1634648],
        "dec": [-19.3694842, -18.7584283, -17.98425, -17.6336513],
        "ssnamenr": ["64580", "64580", "64580", "64580"],
        "jd": [2459329.7716204, 2459345.8568634, 2459363.834375, 2459373.7345139],
        "fid": [2.0, 1.0, 2.0, 2.0],
        "nid": [1575.0, 1591.0, 1609.0, 1619.0],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": ["ZTF21aaxkiar", "ZTF21abausam", "ZTF21abctzom", "ZTF21abexdou"],
        "candid": [
            1.575271621215015e18,
            1.591356862315015e18,
            1.609334372615015e18,
            1.619234511615015e18,
        ],
        "magpsf": [
            19.092945098876953,
            19.17802619934082,
            19.020505905151367,
            19.378360748291016,
        ],
        "sigmapsf": [
            0.2158745676279068,
            0.0965801477432251,
            0.13174483180046082,
            0.18420521914958954,
        ],
        "magnr": [
            19.410999298095703,
            19.062000274658203,
            20.928998947143555,
            22.014999389648438,
        ],
        "sigmagnr": [
            0.023000000044703484,
            0.03400000184774399,
            0.07000000029802322,
            0.2240000069141388,
        ],
        "magzpsci": [
            26.123945236206055,
            26.182025909423828,
            26.267505645751953,
            26.200359344482422,
        ],
        "isdiffpos": ["t", "t", "t", "t"],
        "dcmag": [
            18.420662169461323,
            18.288246458485204,
            18.846686864667113,
            19.280371183840067,
        ],
        "dcmagerr": [
            0.11670594902127972,
            0.04661359940750083,
            0.11273170545876375,
            0.16941500452233074,
        ],
    }
)

old_observation_1 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

new_observation_1 = pd.DataFrame(
    {
        "ra": [223.6981941],
        "dec": [-17.5222626],
        "ssnamenr": ["64580"],
        "jd": [2459377.7514468],
        "fid": [2],
        "nid": [1623],
        "fink_class": ["Solar System MPC"],
        "objectId": ["ZTF21abftjdf"],
        "candid": [1623251441615015013],
        "magpsf": [19.393381118774414],
        "sigmapsf": [0.15704740583896637],
        "magnr": [18.89900016784668],
        "sigmagnr": [0.019999999552965164],
        "magzpsci": [26.21238136291504],
        "isdiffpos": ["t"],
        "dcmag": [18.326972606767193],
        "dcmagerr": [0.060128034429116364],
        "provisional designation": [-1.0],
        "ref_epoch": [-1.0],
        "a": [-1.0],
        "e": [-1.0],
        "i": [-1.0],
        "long. node": [-1.0],
        "arg. peric": [-1.0],
        "mean anomaly": [-1.0],
        "rms_a": [-1.0],
        "rms_e": [-1.0],
        "rms_i": [-1.0],
        "rms_long. node": [-1.0],
        "rms_arg. peric": [-1.0],
        "rms_mean anomaly": [-1.0],
        "not_updated": [True],
        "trajectory_id": [-1.0],
    }
)

trajectory_df_2 = pd.DataFrame(
    {
        "ra": [179.1879857, 179.2238741],
        "dec": [64.4537652, 64.3186296],
        "ssnamenr": ["2017SE19", "2017SE19"],
        "jd": [2459276.7421759, 2459276.8492708],
        "fid": [1, 2],
        "nid": [1522, 1522],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aanyvka", "ZTF21aaoadpx"],
        "candid": [1522242175915015017, 1522349275915015009],
        "magpsf": [18.811309814453125, 18.166519165039062],
        "sigmapsf": [0.09543465077877045, 0.06866215914487839],
        "magnr": [22.988000869750977, 22.492000579833984],
        "sigmagnr": [0.3479999899864197, 0.18199999630451202],
        "magzpsci": [26.342309951782227, 26.28152084350586],
        "isdiffpos": ["t", "t"],
        "dcmag": [18.788736186167718, 18.146615338868997],
        "dcmagerr": [0.0937448233135806, 0.06749592086393852],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [0, 0],
    }
)

old_observation_2 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

new_observation_2 = pd.DataFrame(
    {
        "ra": [180.570757, 180.5827225],
        "dec": [59.4718195, 59.3651274],
        "ssnamenr": ["2017SE19", "2017SE19"],
        "jd": [2459280.7750231, 2459280.8664931],
        "fid": [2, 1],
        "nid": [1526, 1526],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aaomjlk", "ZTF21aaopcpj"],
        "candid": [1526275020515015007, 1526366490515015007],
        "magpsf": [18.269437789916992, 18.94061851501465],
        "sigmapsf": [0.07619858533143997, 0.07713817805051804],
        "magnr": [22.566999435424805, 21.913000106811523],
        "sigmagnr": [0.28200000524520874, 0.09200000017881393],
        "magzpsci": [26.31043815612793, 26.413618087768555],
        "isdiffpos": ["t", "t"],
        "dcmag": [18.249552076041237, 18.877713861153353],
        "dcmagerr": [0.07499052693624493, 0.07297997798239418],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [-1.0, -1.0],
    }
)

trajectory_df_3 = pd.DataFrame(
    {
        "ra": [179.1879857, 179.2238741, 180.570757, 180.5827225, 181.8514115],
        "dec": [64.4537652, 64.3186296, 59.4718195, 59.3651274, 47.8395695],
        "ssnamenr": ["2017SE19", "2017SE19", "2017SE19", "2017SE19", "2017SE19"],
        "jd": [
            2459276.7421759,
            2459276.8492708,
            2459280.7750231,
            2459280.8664931,
            2459291.781875,
        ],
        "fid": [1.0, 2.0, 2.0, 1.0, 1.0],
        "nid": [1522.0, 1522.0, 1526.0, 1526.0, 1537.0],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanyvka",
            "ZTF21aaoadpx",
            "ZTF21aaomjlk",
            "ZTF21aaopcpj",
            "ZTF21aapqwag",
        ],
        "candid": [
            1.522242175915015e18,
            1.522349275915015e18,
            1.526275020515015e18,
            1.526366490515015e18,
            1.537281874715015e18,
        ],
        "magpsf": [
            18.811309814453125,
            18.166519165039062,
            18.269437789916992,
            18.94061851501465,
            19.183595657348633,
        ],
        "sigmapsf": [
            0.09543465077877045,
            0.06866215914487839,
            0.07619858533143997,
            0.07713817805051804,
            0.07974370568990707,
        ],
        "magnr": [
            22.988000869750977,
            22.492000579833984,
            22.566999435424805,
            21.913000106811523,
            22.934999465942383,
        ],
        "sigmagnr": [
            0.3479999899864197,
            0.18199999630451202,
            0.28200000524520874,
            0.09200000017881393,
            0.2639999985694885,
        ],
        "magzpsci": [
            26.342309951782227,
            26.28152084350586,
            26.31043815612793,
            26.413618087768555,
            26.379596710205078,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t"],
        "dcmag": [
            18.788736186167718,
            18.146615338868997,
            18.249552076041237,
            18.877713861153353,
            19.15146773195843,
        ],
        "dcmagerr": [
            0.0937448233135806,
            0.06749592086393852,
            0.07499052693624493,
            0.07297997798239418,
            0.0778003211595225,
        ],
        "provisional designation": [
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00A",
        ],
        "ref_epoch": [
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
        ],
        "a": [
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
        ],
        "e": [
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
        ],
        "i": [
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
        ],
        "long. node": [
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
        ],
        "arg. peric": [
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
        ],
        "mean anomaly": [
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True, True],
        "trajectory_id": [0, 0, 0, 0, 0],
    }
)

old_observation_3 = pd.DataFrame(
    {
        "ra": [181.931075],
        "dec": [45.9650565],
        "ssnamenr": ["2017SE19"],
        "jd": [2459293.804456],
        "fid": [1],
        "nid": [1539],
        "fink_class": ["Solar System MPC"],
        "objectId": ["ZTF21aaqikoo"],
        "candid": [1539304453115015016],
        "magpsf": [19.371646881103516],
        "sigmapsf": [0.1383635401725769],
        "magnr": [23.24799919128418],
        "sigmagnr": [0.33500000834465027],
        "magzpsci": [26.335647583007812],
        "isdiffpos": ["t"],
        "dcmag": [19.34179712858365],
        "dcmagerr": [0.13491757573154542],
        "provisional designation": [-1.0],
        "ref_epoch": [-1.0],
        "a": [-1.0],
        "e": [-1.0],
        "i": [-1.0],
        "long. node": [-1.0],
        "arg. peric": [-1.0],
        "mean anomaly": [-1.0],
        "rms_a": [-1.0],
        "rms_e": [-1.0],
        "rms_i": [-1.0],
        "rms_long. node": [-1.0],
        "rms_arg. peric": [-1.0],
        "rms_mean anomaly": [-1.0],
        "not_updated": [True],
        "trajectory_id": [-1.0],
    }
)

new_observation_3 = pd.DataFrame(
    {
        "ra": [182.2518899, 182.2517747],
        "dec": [36.9173521, 36.9113943],
        "ssnamenr": ["2017SE19", "2017SE19"],
        "jd": [2459304.7972569, 2459304.8051852],
        "fid": [2, 2],
        "nid": [1550, 1550],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aareokk", "ZTF21aarerdi"],
        "candid": [1550297251015015008, 1550305185215015001],
        "magpsf": [19.162599563598633, 19.02241325378418],
        "sigmapsf": [0.16024233400821686, 0.12882009148597717],
        "magnr": [23.09600067138672, 22.722999572753906],
        "sigmagnr": [0.2720000147819519, 0.2070000022649765],
        "magzpsci": [26.19659996032715, 26.209413528442383],
        "isdiffpos": ["t", "t"],
        "dcmag": [19.13186950523745, 18.984898693049793],
        "dcmagerr": [0.1559553421506885, 0.12464350904855288],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [-1.0, -1.0],
    }
)

trajectory_df_4 = pd.DataFrame(
    {
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

old_observation_4 = pd.DataFrame(
    {
        "ra": [150.2767428],
        "dec": [29.6432911],
        "ssnamenr": ["107951"],
        "jd": [2459274.8828472],
        "fid": [2],
        "nid": [1520],
        "fink_class": ["Solar System MPC"],
        "objectId": ["ZTF21aanrpmx"],
        "candid": [1520382840715015005],
        "magpsf": [18.91179847717285],
        "sigmapsf": [0.16078680753707886],
        "magnr": [22.88599967956543],
        "sigmagnr": [0.2849999964237213],
        "magzpsci": [26.24679946899414],
        "isdiffpos": ["t"],
        "dcmag": [18.883507138530334],
        "dcmagerr": [0.1568226716835336],
        "provisional designation": [-1.0],
        "ref_epoch": [-1.0],
        "a": [-1.0],
        "e": [-1.0],
        "i": [-1.0],
        "long. node": [-1.0],
        "arg. peric": [-1.0],
        "mean anomaly": [-1.0],
        "rms_a": [-1.0],
        "rms_e": [-1.0],
        "rms_i": [-1.0],
        "rms_long. node": [-1.0],
        "rms_arg. peric": [-1.0],
        "rms_mean anomaly": [-1.0],
        "not_updated": [-1.0],
        "trajectory_id": [-1.0],
    }
)

new_observation_4 = pd.DataFrame(
    {
        "ra": [150.0755966, 150.0461002],
        "dec": [29.657104, 29.658911],
        "ssnamenr": ["107951", "107951"],
        "jd": [2459275.7066204, 2459275.8239583],
        "fid": [1, 2],
        "nid": [1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantyqu", "ZTF21aanvhpk"],
        "candid": [1521206625615015004, 1521323955615015004],
        "magpsf": [19.61456871032715, 19.14607048034668],
        "sigmapsf": [0.17709490656852722, 0.1350758671760559],
        "magnr": [22.579999923706055, 22.739999771118164],
        "sigmagnr": [0.33799999952316284, 0.3149999976158142],
        "magzpsci": [26.359567642211914, 26.265071868896484],
        "isdiffpos": ["t", "t"],
        "dcmag": [19.548137703415094, 19.10678402261543],
        "dcmagerr": [0.1677876844765026, 0.13075569292812592],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [-1.0, -1.0],
    }
)

trajectory_df_5 = pd.DataFrame(
    {
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

old_observation_5 = pd.DataFrame(
    {
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
        "nid": [],
    }
)

new_observation_5 = pd.DataFrame(
    {
        "ra": [150.0755966, 150.0461002],
        "dec": [29.657104, 29.658911],
        "ssnamenr": ["107951", "107951"],
        "jd": [2459275.7066204, 2459275.8239583],
        "fid": [1, 2],
        "nid": [1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantyqu", "ZTF21aanvhpk"],
        "candid": [1521206625615015004, 1521323955615015004],
        "magpsf": [19.61456871032715, 19.14607048034668],
        "sigmapsf": [0.17709490656852722, 0.1350758671760559],
        "magnr": [22.579999923706055, 22.739999771118164],
        "sigmagnr": [0.33799999952316284, 0.3149999976158142],
        "magzpsci": [26.359567642211914, 26.265071868896484],
        "isdiffpos": ["t", "t"],
        "dcmag": [19.548137703415094, 19.10678402261543],
        "dcmagerr": [0.1677876844765026, 0.13075569292812592],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [-1.0, -1.0],
    }
)

new_observation_6 = pd.DataFrame(
    {
        "ra": [109.6396459, 95.2193295, 253.3348862],
        "dec": [25.9449035, 26.6148543, -17.4185314],
        "ssnamenr": ["104", "10207", "968"],
        "jd": [2459275.6721065, 2459275.7482407, 2459275.9837384],
        "fid": [1, 2, 1],
        "nid": [1521, 1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantoba", "ZTF21aanumhy", "ZTF21aanwlbu"],
        "candid": [1521172102915015000, 1521248243515015012, 1521483732815015002],
        "magpsf": [13.17834758758545, 18.19043731689453, 16.02326011657715],
        "sigmapsf": [0.02265007793903351, 0.0796399712562561, 0.031096111983060837],
        "magnr": [22.445999145507812, 22.268999099731445, 20.648000717163086],
        "sigmagnr": [0.23199999332427979, 0.2770000100135803, 0.07699999958276749],
        "magzpsci": [26.360347747802734, 26.35443878173828, 26.164260864257812],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [14.35973511234515, 18.167110771136397, 16.005616394386976],
        "dcmagerr": [0.02263767934691149, 0.07816924152753131, 0.030620034981926652],
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
        "not_updated": [True, True, True],
        "trajectory_id": [-1.0, -1.0, -1.0],
    }
)

old_observation_6 = pd.DataFrame(
    {
        "ra": [109.6370802, 95.1293755, 253.099651],
        "dec": [25.9631427, 26.6712457, -17.4600157],
        "ssnamenr": ["104", "10207", "968"],
        "jd": [2459274.66625, 2459274.7565741, 2459274.9812963],
        "fid": [1, 2, 1],
        "nid": [1520, 1520, 1520],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aanqmdh", "ZTF21aanqxgh", "ZTF21aanrvcs"],
        "candid": [1520166251615015000, 1520256574615015010, 1520481292815015007],
        "magpsf": [13.194306373596191, 18.275035858154297, 16.058544158935547],
        "sigmapsf": [0.017068419605493546, 0.12942494451999664, 0.037365127354860306],
        "magnr": [22.93899917602539, 22.70599937438965, 22.2450008392334],
        "sigmagnr": [0.3580000102519989, 0.3610000014305115, 0.257999986410141],
        "magzpsci": [26.317306518554688, 26.312036514282227, 26.140544891357422],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [14.31691743145683, 18.257456472779257, 16.0542382758845],
        "dcmagerr": [0.01706278616994172, 0.12747819103055866, 0.03723124251898085],
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
        "not_updated": [-1.0, -1.0, -1.0],
        "trajectory_id": [-1.0, -1.0, -1.0],
    }
)

new_observation_7 = pd.DataFrame(
    {
        "ra": [109.6396459, 95.2193295, 253.3348862],
        "dec": [25.9449035, 26.6148543, -17.4185314],
        "ssnamenr": ["104", "10207", "968"],
        "jd": [2459275.6721065, 2459275.7482407, 2459275.9837384],
        "fid": [1, 2, 1],
        "nid": [1521, 1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantoba", "ZTF21aanumhy", "ZTF21aanwlbu"],
        "candid": [1521172102915015000, 1521248243515015012, 1521483732815015002],
        "magpsf": [13.17834758758545, 18.19043731689453, 16.02326011657715],
        "sigmapsf": [0.02265007793903351, 0.0796399712562561, 0.031096111983060837],
        "magnr": [22.445999145507812, 22.268999099731445, 20.648000717163086],
        "sigmagnr": [0.23199999332427979, 0.2770000100135803, 0.07699999958276749],
        "magzpsci": [26.360347747802734, 26.35443878173828, 26.164260864257812],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [14.35973511234515, 18.167110771136397, 16.005616394386976],
        "dcmagerr": [0.02263767934691149, 0.07816924152753131, 0.030620034981926652],
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
        "not_updated": [True, True, True],
        "trajectory_id": [-1.0, -1.0, -1.0],
    }
)

# - expected outputs

trajectory_df_expected_1 = pd.DataFrame(
    {
        "provisional designation": [
            "K21H00A",
            "K21H00A",
            "K21H00A",
            "K21H00A",
            "K21H00A",
        ],
        "ref_epoch": [
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
        ],
        "a": [
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
        ],
        "e": [
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
        ],
        "i": [
            1.607049951428,
            1.607049951428,
            1.607049951428,
            1.607049951428,
            1.607049951428,
        ],
        "long. node": [
            37.54350205425,
            37.54350205425,
            37.54350205425,
            37.54350205425,
            37.54350205425,
        ],
        "arg. peric": [
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
        ],
        "mean anomaly": [
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True, True],
        "trajectory_id": [0, 0, 0, 0, 0],
        "ra": [232.2341868, 229.1117136, 225.6399955, 224.1634648, 223.6981941],
        "dec": [-19.3694842, -18.7584283, -17.98425, -17.6336513, -17.5222626],
        "ssnamenr": ["64580", "64580", "64580", "64580", "64580"],
        "jd": [
            2459329.7716204,
            2459345.8568634,
            2459363.834375,
            2459373.7345139,
            2459377.7514468,
        ],
        "fid": [2.0, 1.0, 2.0, 2.0, 2.0],
        "nid": [1575.0, 1591.0, 1609.0, 1619.0, 1623.0],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aaxkiar",
            "ZTF21abausam",
            "ZTF21abctzom",
            "ZTF21abexdou",
            "ZTF21abftjdf",
        ],
        "candid": [
            1.575271621215015e18,
            1.591356862315015e18,
            1.609334372615015e18,
            1.619234511615015e18,
            1.623251441615015e18,
        ],
        "magpsf": [
            19.092945098876953,
            19.17802619934082,
            19.020505905151367,
            19.378360748291016,
            19.393381118774414,
        ],
        "sigmapsf": [
            0.2158745676279068,
            0.0965801477432251,
            0.13174483180046082,
            0.18420521914958954,
            0.15704740583896637,
        ],
        "magnr": [
            19.410999298095703,
            19.062000274658203,
            20.928998947143555,
            22.014999389648438,
            18.89900016784668,
        ],
        "sigmagnr": [
            0.023000000044703484,
            0.03400000184774399,
            0.07000000029802322,
            0.2240000069141388,
            0.019999999552965164,
        ],
        "magzpsci": [
            26.123945236206055,
            26.182025909423828,
            26.267505645751953,
            26.200359344482422,
            26.21238136291504,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t"],
        "dcmag": [
            18.420662169461323,
            18.288246458485204,
            18.846686864667113,
            19.280371183840067,
            18.326972606767193,
        ],
        "dcmagerr": [
            0.11670594902127972,
            0.04661359940750083,
            0.11273170545876375,
            0.16941500452233074,
            0.060128034429116364,
        ],
    }
)

old_observation_expected_1 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

trajectory_df_expected_2 = pd.DataFrame(
    {
        "ra": [179.1879857, 179.2238741, 180.570757, 180.5827225],
        "dec": [64.4537652, 64.3186296, 59.4718195, 59.3651274],
        "ssnamenr": ["2017SE19", "2017SE19", "2017SE19", "2017SE19"],
        "jd": [2459276.7421759, 2459276.8492708, 2459280.7750231, 2459280.8664931],
        "fid": [1, 2, 2, 1],
        "nid": [1522, 1522, 1526, 1526],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": ["ZTF21aanyvka", "ZTF21aaoadpx", "ZTF21aaomjlk", "ZTF21aaopcpj"],
        "candid": [
            1522242175915015017,
            1522349275915015009,
            1526275020515015007,
            1526366490515015007,
        ],
        "magpsf": [
            18.811309814453125,
            18.166519165039062,
            18.269437789916992,
            18.94061851501465,
        ],
        "sigmapsf": [
            0.09543465077877045,
            0.06866215914487839,
            0.07619858533143997,
            0.07713817805051804,
        ],
        "magnr": [
            22.988000869750977,
            22.492000579833984,
            22.566999435424805,
            21.913000106811523,
        ],
        "sigmagnr": [
            0.3479999899864197,
            0.18199999630451202,
            0.28200000524520874,
            0.09200000017881393,
        ],
        "magzpsci": [
            26.342309951782227,
            26.28152084350586,
            26.31043815612793,
            26.413618087768555,
        ],
        "isdiffpos": ["t", "t", "t", "t"],
        "dcmag": [
            18.788736186167718,
            18.146615338868997,
            18.249552076041237,
            18.877713861153353,
        ],
        "dcmagerr": [
            0.0937448233135806,
            0.06749592086393852,
            0.07499052693624493,
            0.07297997798239418,
        ],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True],
        "trajectory_id": [0, 0, 0, 0],
    }
)

old_observation_expected_2 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

trajectory_df_expected_3 = pd.DataFrame(
    {
        "ra": [
            179.1879857,
            179.2238741,
            180.570757,
            180.5827225,
            181.8514115,
            182.2518899,
            182.2517747,
            181.931075,
        ],
        "dec": [
            64.4537652,
            64.3186296,
            59.4718195,
            59.3651274,
            47.8395695,
            36.9173521,
            36.9113943,
            45.9650565,
        ],
        "ssnamenr": [
            "2017SE19",
            "2017SE19",
            "2017SE19",
            "2017SE19",
            "2017SE19",
            "2017SE19",
            "2017SE19",
            "2017SE19",
        ],
        "jd": [
            2459276.7421759,
            2459276.8492708,
            2459280.7750231,
            2459280.8664931,
            2459291.781875,
            2459304.7972569,
            2459304.8051852,
            2459293.804456,
        ],
        "fid": [1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0, 1.0],
        "nid": [1522.0, 1522.0, 1526.0, 1526.0, 1537.0, 1550.0, 1550.0, 1539.0],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanyvka",
            "ZTF21aaoadpx",
            "ZTF21aaomjlk",
            "ZTF21aaopcpj",
            "ZTF21aapqwag",
            "ZTF21aareokk",
            "ZTF21aarerdi",
            "ZTF21aaqikoo",
        ],
        "candid": [
            1.522242175915015e18,
            1.522349275915015e18,
            1.526275020515015e18,
            1.526366490515015e18,
            1.537281874715015e18,
            1.550297251015015e18,
            1.550305185215015e18,
            1.539304453115015e18,
        ],
        "magpsf": [
            18.811309814453125,
            18.166519165039062,
            18.269437789916992,
            18.94061851501465,
            19.183595657348633,
            19.162599563598633,
            19.02241325378418,
            19.371646881103516,
        ],
        "sigmapsf": [
            0.09543465077877045,
            0.06866215914487839,
            0.07619858533143997,
            0.07713817805051804,
            0.07974370568990707,
            0.16024233400821686,
            0.12882009148597717,
            0.1383635401725769,
        ],
        "magnr": [
            22.988000869750977,
            22.492000579833984,
            22.566999435424805,
            21.913000106811523,
            22.934999465942383,
            23.09600067138672,
            22.722999572753906,
            23.24799919128418,
        ],
        "sigmagnr": [
            0.3479999899864197,
            0.18199999630451202,
            0.28200000524520874,
            0.09200000017881393,
            0.2639999985694885,
            0.2720000147819519,
            0.2070000022649765,
            0.33500000834465027,
        ],
        "magzpsci": [
            26.342309951782227,
            26.28152084350586,
            26.31043815612793,
            26.413618087768555,
            26.379596710205078,
            26.19659996032715,
            26.209413528442383,
            26.335647583007812,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.788736186167718,
            18.146615338868997,
            18.249552076041237,
            18.877713861153353,
            19.15146773195843,
            19.13186950523745,
            18.984898693049793,
            19.34179712858365,
        ],
        "dcmagerr": [
            0.0937448233135806,
            0.06749592086393852,
            0.07499052693624493,
            0.07297997798239418,
            0.0778003211595225,
            0.1559553421506885,
            0.12464350904855288,
            0.13491757573154542,
        ],
        "provisional designation": [
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00A",
            -1.0,
            -1.0,
            -1.0,
        ],
        "ref_epoch": [
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True, True, True, True, True],
        "trajectory_id": [0, 0, 0, 0, 0, 1, 1, 1],
    }
)

old_observation_expected_3 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

trajectory_df_expected_4 = pd.DataFrame(
    {
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
        "not_updated": [True, True, True],
        "trajectory_id": [0, 0, 0],
        "ra": [150.0755966, 150.0461002, 150.2767428],
        "dec": [29.657104, 29.658911, 29.6432911],
        "ssnamenr": ["107951", "107951", "107951"],
        "jd": [2459275.7066204, 2459275.8239583, 2459274.8828472],
        "fid": [1.0, 2.0, 2.0],
        "nid": [1521.0, 1521.0, 1520.0],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantyqu", "ZTF21aanvhpk", "ZTF21aanrpmx"],
        "candid": [1.521206625615015e18, 1.521323955615015e18, 1.520382840715015e18],
        "magpsf": [19.61456871032715, 19.14607048034668, 18.91179847717285],
        "sigmapsf": [0.17709490656852722, 0.1350758671760559, 0.16078680753707886],
        "magnr": [22.579999923706055, 22.739999771118164, 22.88599967956543],
        "sigmagnr": [0.33799999952316284, 0.3149999976158142, 0.2849999964237213],
        "magzpsci": [26.359567642211914, 26.265071868896484, 26.24679946899414],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [19.548137703415094, 19.10678402261543, 18.883507138530334],
        "dcmagerr": [0.1677876844765026, 0.13075569292812592, 0.1568226716835336],
    }
)

old_observation_expected_4 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

trajectory_df_expected_5 = pd.DataFrame(
    {
        "ra": [150.0755966, 150.0461002],
        "dec": [29.657104, 29.658911],
        "ssnamenr": ["107951", "107951"],
        "jd": [2459275.7066204, 2459275.8239583],
        "fid": [1, 2],
        "nid": [1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantyqu", "ZTF21aanvhpk"],
        "candid": [1521206625615015004, 1521323955615015004],
        "magpsf": [19.61456871032715, 19.14607048034668],
        "sigmapsf": [0.17709490656852722, 0.1350758671760559],
        "magnr": [22.579999923706055, 22.739999771118164],
        "sigmagnr": [0.33799999952316284, 0.3149999976158142],
        "magzpsci": [26.359567642211914, 26.265071868896484],
        "isdiffpos": ["t", "t"],
        "dcmag": [19.548137703415094, 19.10678402261543],
        "dcmagerr": [0.1677876844765026, 0.13075569292812592],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [0, 0],
    }
)

old_observation_expected_5 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

old_observation_expected_6 = pd.DataFrame(
    {
        "ra": [109.6396459, 95.2193295, 253.3348862],
        "dec": [25.9449035, 26.6148543, -17.4185314],
        "ssnamenr": ["104", "10207", "968"],
        "jd": [2459275.6721065, 2459275.7482407, 2459275.9837384],
        "fid": [1, 2, 1],
        "nid": [1521, 1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantoba", "ZTF21aanumhy", "ZTF21aanwlbu"],
        "candid": [1521172102915015000, 1521248243515015012, 1521483732815015002],
        "magpsf": [13.17834758758545, 18.19043731689453, 16.02326011657715],
        "sigmapsf": [0.02265007793903351, 0.0796399712562561, 0.031096111983060837],
        "magnr": [22.445999145507812, 22.268999099731445, 20.648000717163086],
        "sigmagnr": [0.23199999332427979, 0.2770000100135803, 0.07699999958276749],
        "magzpsci": [26.360347747802734, 26.35443878173828, 26.164260864257812],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [14.35973511234515, 18.167110771136397, 16.005616394386976],
        "dcmagerr": [0.02263767934691149, 0.07816924152753131, 0.030620034981926652],
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
        "not_updated": [True, True, True],
        "trajectory_id": [-1.0, -1.0, -1.0],
    }
)

trajectory_df_expected_6 = pd.DataFrame(
    {
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True, True, True],
        "trajectory_id": [0, 1, 2, 0, 1, 2],
        "ra": [
            109.6370802,
            95.1293755,
            253.099651,
            109.6396459,
            95.2193295,
            253.3348862,
        ],
        "dec": [
            25.9631427,
            26.6712457,
            -17.4600157,
            25.9449035,
            26.6148543,
            -17.4185314,
        ],
        "ssnamenr": ["104", "10207", "968", "104", "10207", "968"],
        "jd": [
            2459274.66625,
            2459274.7565741,
            2459274.9812963,
            2459275.6721065,
            2459275.7482407,
            2459275.9837384,
        ],
        "fid": [1.0, 2.0, 1.0, 1.0, 2.0, 1.0],
        "nid": [1520.0, 1520.0, 1520.0, 1521.0, 1521.0, 1521.0],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanqmdh",
            "ZTF21aanqxgh",
            "ZTF21aanrvcs",
            "ZTF21aantoba",
            "ZTF21aanumhy",
            "ZTF21aanwlbu",
        ],
        "candid": [
            1.520166251615015e18,
            1.520256574615015e18,
            1.520481292815015e18,
            1.521172102915015e18,
            1.521248243515015e18,
            1.521483732815015e18,
        ],
        "magpsf": [
            13.194306373596191,
            18.275035858154297,
            16.058544158935547,
            13.17834758758545,
            18.19043731689453,
            16.02326011657715,
        ],
        "sigmapsf": [
            0.017068419605493546,
            0.12942494451999664,
            0.037365127354860306,
            0.02265007793903351,
            0.0796399712562561,
            0.031096111983060837,
        ],
        "magnr": [
            22.93899917602539,
            22.70599937438965,
            22.2450008392334,
            22.445999145507812,
            22.268999099731445,
            20.648000717163086,
        ],
        "sigmagnr": [
            0.3580000102519989,
            0.3610000014305115,
            0.257999986410141,
            0.23199999332427979,
            0.2770000100135803,
            0.07699999958276749,
        ],
        "magzpsci": [
            26.317306518554688,
            26.312036514282227,
            26.140544891357422,
            26.360347747802734,
            26.35443878173828,
            26.164260864257812,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t"],
        "dcmag": [
            14.31691743145683,
            18.257456472779257,
            16.0542382758845,
            14.35973511234515,
            18.167110771136397,
            16.005616394386976,
        ],
        "dcmagerr": [
            0.01706278616994172,
            0.12747819103055866,
            0.03723124251898085,
            0.02263767934691149,
            0.07816924152753131,
            0.030620034981926652,
        ],
    }
)

test_time_window = pd.DataFrame(
    {
        "trajectory_id": [0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6],
        "jd": [0, 10, 0, 1, 10, 0, 2, 2, 0, 9, 0, 1, 2, 6, 0, 1, 0, 1, 2],
        "nid": [0, 10, 0, 1, 10, 0, 2, 2, 0, 9, 0, 1, 2, 6, 0, 1, 0, 1, 2],
        "a": [
            -1.0,
            -1.0,
            1,
            1,
            1,
            -1.0,
            -1.0,
            -1.0,
            2,
            2,
            3,
            3,
            3,
            3,
            -1.0,
            -1.0,
            2,
            2,
            2,
        ],
    }
)

old_traj_expected = pd.DataFrame(
    {
        "trajectory_id": [6, 6, 6],
        "jd": [0, 1, 2],
        "nid": [0, 1, 2],
        "a": [2.0, 2.0, 2.0],
    }
)

keep_traj_expected = pd.DataFrame(
    {
        "trajectory_id": [0, 0, 1, 1, 1, 3, 3, 4, 4, 4, 4],
        "jd": [0, 10, 0, 1, 10, 0, 9, 0, 1, 2, 6],
        "nid": [0, 10, 0, 1, 10, 0, 9, 0, 1, 2, 6],
        "a": [-1.0, -1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0],
    }
)

trajectory_sample = pd.DataFrame(
    {
        "ra": [
            180.8801523,
            177.5296323,
            177.2496744,
            178.1829226,
            178.9264723,
            176.154299,
            179.312505,
            176.2823594,
            179.0375741,
            179.0456036,
            183.5866864,
            183.5972838,
            184.0653758,
            184.0810831,
            177.2582025,
            187.5032364,
            187.4923078,
            186.3767104,
            186.9486747,
            176.2011908,
            209.4181042,
            203.3497447,
            198.3799109,
            204.603046,
            200.5551092,
            203.3361293,
            205.4440385,
            198.8852864,
            199.2478811,
            199.9684341,
            199.4597799,
            206.2751422,
            199.2408958,
            199.7045296,
            198.4136717,
            203.7583491,
            201.2351661,
            208.4549852,
            200.243764,
            206.2707565,
            187.0108506,
            186.5485178,
            186.0330402,
            188.4401674,
            186.2203797,
            189.2524853,
            189.2576624,
            186.0703073,
            186.0324126,
            191.9783927,
            191.984062,
            192.4384847,
            185.9885404,
            195.6309858,
            187.738982,
            195.9789426,
            195.9837656,
            185.9900718,
            186.5448519,
            186.3666441,
            239.3579632,
            233.7092035,
            232.969768,
            230.9591717,
            230.936293,
            230.5361168,
            230.1822834,
            229.0339148,
            228.7762909,
            228.5521677,
            234.9086814,
            231.3843206,
            227.8804844,
            235.8577128,
            227.874058,
            237.784429,
            236.7758723,
            240.2301478,
            235.8733855,
            236.7572494,
            141.3100473,
            130.0543739,
            130.0542314,
            130.04997,
            129.9232788,
            129.870475,
            129.8807292,
            131.0043347,
            131.4574516,
            132.1486376,
            132.5454012,
            141.9782606,
            133.3704816,
            134.5469131,
            135.0566001,
            142.6658974,
            139.36293,
            140.0176583,
            131.4687796,
            130.3120568,
        ],
        "dec": [
            6.1739254,
            7.0134225,
            7.0436816,
            6.9051259,
            6.7393856,
            6.60782,
            6.6403427,
            6.9459491,
            4.140222,
            4.1347604,
            5.1844347,
            5.1803383,
            4.9879437,
            4.9816581,
            7.0430552,
            3.3575127,
            3.3632449,
            3.9434484,
            3.6538323,
            6.8795799,
            -13.4824868,
            -10.4302951,
            -7.5098977,
            -11.0706285,
            -8.9358983,
            -10.4235176,
            -11.4937939,
            -7.4138523,
            -8.1667122,
            -8.6009891,
            -8.2984063,
            -11.9082676,
            -8.162544,
            -8.4458117,
            -7.3722627,
            -10.6406019,
            -9.3113609,
            -12.9916974,
            -8.7599442,
            -11.9061388,
            -9.1283975,
            -8.5872784,
            -7.053292,
            -10.4405296,
            -8.0966139,
            -11.0701403,
            -11.0737153,
            -7.7766181,
            -7.0561955,
            -12.8754344,
            -12.8785879,
            -13.1452162,
            -7.4703454,
            -14.7726495,
            -6.3734723,
            -14.9206494,
            -14.9225411,
            -7.4761896,
            -6.592165,
            -8.3342494,
            -16.1321166,
            -15.5410575,
            -15.4877918,
            -15.3923507,
            -15.3917401,
            -15.3857485,
            -15.3859542,
            -15.4419623,
            -15.4748978,
            -15.5152113,
            -15.6418087,
            -15.4047432,
            -16.0304387,
            -15.7316201,
            -15.9350587,
            -15.9371173,
            -15.8256827,
            -16.2779733,
            -15.7330995,
            -15.8238043,
            21.8114436,
            29.7187935,
            29.718708,
            29.7157123,
            29.5897934,
            29.5182225,
            28.7194283,
            27.4814939,
            27.1325294,
            26.6527311,
            26.3959144,
            21.4910327,
            25.8933908,
            25.2241429,
            24.9462947,
            21.1623531,
            22.7549833,
            22.4355391,
            27.1236805,
            29.8828986,
        ],
        "ssnamenr": [
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
        ],
        "jd": [
            2459304.8028125,
            2459321.7913079,
            2459323.8165162,
            2459317.70875,
            2459313.7140972,
            2459342.7341204,
            2459311.8094097,
            2459334.6896296,
            2459369.6833681,
            2459369.7277546,
            2459293.794838,
            2459293.753831,
            2459291.8504167,
            2459291.7891204,
            2459323.7555208,
            2459275.8832755,
            2459275.9433681,
            2459281.7878356,
            2459278.924537,
            2459336.7573727,
            2459290.899213,
            2459323.7727199,
            2459362.752963,
            2459317.8169444,
            2459338.7946991,
            2459323.8359259,
            2459313.8371991,
            2459379.7114236,
            2459348.7307407,
            2459342.7731944,
            2459346.7947338,
            2459309.814456,
            2459348.7943056,
            2459344.7725579,
            2459370.7699074,
            2459321.8128704,
            2459334.7130208,
            2459297.8783796,
            2459340.8359491,
            2459309.8354977,
            2459334.7111458,
            2459338.7528819,
            2459353.7289236,
            2459325.8284722,
            2459342.7741319,
            2459321.7747917,
            2459321.751875,
            2459345.6727431,
            2459353.6903472,
            2459309.7959606,
            2459309.7730903,
            2459307.8366088,
            2459348.7525579,
            2459292.8559491,
            2459370.7694444,
            2459290.856088,
            2459290.8292593,
            2459348.6905903,
            2459361.7115625,
            2459340.7735069,
            2459325.9621644,
            2459353.8109491,
            2459356.8744329,
            2459365.7932176,
            2459365.8979398,
            2459367.8769792,
            2459369.7312269,
            2459376.7723032,
            2459378.7520023,
            2459380.7102894,
            2459348.8711343,
            2459363.7937731,
            2459394.7104051,
            2459344.8775694,
            2459392.7514236,
            2459335.8997222,
            2459340.8147685,
            2459312.898588,
            2459344.8136343,
            2459340.8956481,
            2459344.7057986,
            2459278.6831134,
            2459278.6845255,
            2459278.7355324,
            2459280.7561806,
            2459281.8256019,
            2459291.7173958,
            2459303.6953588,
            2459306.7149884,
            2459310.6967245,
            2459312.7582407,
            2459346.7064931,
            2459316.6763773,
            2459321.6851968,
            2459323.704375,
            2459348.7350231,
            2459338.6765625,
            2459340.7414468,
            2459306.7885764,
            2459275.674456,
        ],
        "fid": [
            2,
            2,
            2,
            2,
            2,
            1,
            2,
            1,
            2,
            1,
            1,
            2,
            2,
            1,
            1,
            2,
            1,
            2,
            2,
            1,
            1,
            1,
            2,
            2,
            1,
            2,
            2,
            2,
            1,
            2,
            2,
            1,
            2,
            1,
            2,
            2,
            1,
            2,
            1,
            1,
            1,
            2,
            1,
            1,
            2,
            2,
            1,
            1,
            2,
            1,
            2,
            2,
            1,
            2,
            2,
            2,
            1,
            2,
            2,
            2,
            2,
            2,
            2,
            1,
            2,
            2,
            1,
            2,
            2,
            2,
            1,
            1,
            1,
            2,
            1,
            1,
            2,
            2,
            1,
            1,
            2,
            2,
            2,
            1,
            2,
            1,
            2,
            1,
            2,
            2,
            2,
            2,
            2,
            1,
            2,
            1,
            1,
            2,
            1,
            1,
        ],
        "nid": [
            1550,
            1567,
            1569,
            1563,
            1559,
            1588,
            1557,
            1580,
            1615,
            1615,
            1539,
            1539,
            1537,
            1537,
            1569,
            1521,
            1521,
            1527,
            1524,
            1582,
            1536,
            1569,
            1608,
            1563,
            1584,
            1569,
            1559,
            1625,
            1594,
            1588,
            1592,
            1555,
            1594,
            1590,
            1616,
            1567,
            1580,
            1543,
            1586,
            1555,
            1580,
            1584,
            1599,
            1571,
            1588,
            1567,
            1567,
            1591,
            1599,
            1555,
            1555,
            1553,
            1594,
            1538,
            1616,
            1536,
            1536,
            1594,
            1607,
            1586,
            1571,
            1599,
            1602,
            1611,
            1611,
            1613,
            1615,
            1622,
            1624,
            1626,
            1594,
            1609,
            1640,
            1590,
            1638,
            1581,
            1586,
            1558,
            1590,
            1586,
            1590,
            1524,
            1524,
            1524,
            1526,
            1527,
            1537,
            1549,
            1552,
            1556,
            1558,
            1592,
            1562,
            1567,
            1569,
            1594,
            1584,
            1586,
            1552,
            1521,
        ],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aarepjo",
            "ZTF21aawbmfj",
            "ZTF21aawniei",
            "ZTF21aavcdld",
            "ZTF21aatoeep",
            "ZTF21aazvwko",
            "ZTF21aatbwml",
            "ZTF21aaxsqpk",
            "ZTF21abdvyuq",
            "ZTF21abdxdhl",
            "ZTF21aaqiejw",
            "ZTF21aaqhqnb",
            "ZTF21aapsrit",
            "ZTF21aapqytw",
            "ZTF21aawmqyz",
            "ZTF21aanwdeb",
            "ZTF21aanwjdn",
            "ZTF21aaougpm",
            "ZTF21aaogaac",
            "ZTF21aaydsjy",
            "ZTF21aapkhlz",
            "ZTF21aawmwuc",
            "ZTF21abcpppa",
            "ZTF21aavenxc",
            "ZTF21aayqefs",
            "ZTF21aawnwze",
            "ZTF21aatqrst",
            "ZTF21abgfhvt",
            "ZTF21abbgjxh",
            "ZTF21aazwwsj",
            "ZTF21abazvpl",
            "ZTF21aasqkef",
            "ZTF21abbiqxc",
            "ZTF21abalusd",
            "ZTF21abeewfz",
            "ZTF21aawclsl",
            "ZTF21aaxtdao",
            "ZTF21aaqqbty",
            "ZTF21aazldxs",
            "ZTF21aasqsod",
            "ZTF21aaxtavs",
            "ZTF21aaypcfe",
            "ZTF21abbyqre",
            "ZTF21aawzpqd",
            "ZTF21aazwwpk",
            "ZTF21aawaybc",
            "ZTF21aawadcn",
            "ZTF21abaqzwk",
            "ZTF21abbyfph",
            "ZTF21aasqcaq",
            "ZTF21aaspgnr",
            "ZTF21aasaapx",
            "ZTF21abbhcds",
            "ZTF21aaqbvsl",
            "ZTF21abeeuyq",
            "ZTF21aapiyjj",
            "ZTF21aaphxdz",
            "ZTF21abbevzt",
            "ZTF21abcmcsw",
            "ZTF21aazjmiz",
            "ZTF21aaxbmjo",
            "ZTF21abbzlal",
            "ZTF21abcgfjy",
            "ZTF21abdbqax",
            "ZTF21abdczxf",
            "ZTF21abdnruv",
            "ZTF21abdxfxh",
            "ZTF21abfnjha",
            "ZTF21abfznom",
            "ZTF21abgliyv",
            "ZTF21abbkmgm",
            "ZTF21abctobj",
            "ZTF21abiiprc",
            "ZTF21abaotof",
            "ZTF21abidohz",
            "ZTF21aaxyvtd",
            "ZTF21aazkqzl",
            "ZTF21aatldwm",
            "ZTF21abamrne",
            "ZTF21aazlytw",
            "ZTF21abajfeb",
            "ZTF21aaoclbm",
            "ZTF21aaoclbm",
            "ZTF21aaodgxk",
            "ZTF21aaolord",
            "ZTF21aaoveqs",
            "ZTF21aapootj",
            "ZTF21aaqxyrc",
            "ZTF21aarlttl",
            "ZTF21aastkxs",
            "ZTF21aatjdml",
            "ZTF21abaypaq",
            "ZTF21aauoypu",
            "ZTF21aavxqvh",
            "ZTF21aawlufp",
            "ZTF21abbgcrj",
            "ZTF21aaymwbb",
            "ZTF21aazinqy",
            "ZTF21aaropag",
            "ZTF20aclpank",
        ],
        "candid": [
            1550302813315015002,
            1567291305815015018,
            1569316515815015019,
            1563208745915015034,
            1559214095415015017,
            1588234126315015024,
            1557309405415015024,
            1580189626315015014,
            1615183362115015010,
            1615227752115015017,
            1539294834215015019,
            1539253834215015026,
            1537350414215015030,
            1537289124215015016,
            1569255525815015014,
            1521383271815015009,
            1521443361815015002,
            1527287832015015029,
            1524424532315015006,
            1582257376315015030,
            1536399211115015009,
            1569272712115015016,
            1608252965015015015,
            1563316942315015021,
            1584294694715015000,
            1569335922115015016,
            1559337191815015026,
            1625211425115015014,
            1594230743215015004,
            1588273194515015023,
            1592294734515015016,
            1555314450015015002,
            1594294304515015005,
            1590272554515015015,
            1616269905015015009,
            1567312872115015032,
            1580213024215015019,
            1543378371015015004,
            1586335944415015010,
            1555335491315015002,
            1580211144215015009,
            1584252884415015027,
            1599228926315015002,
            1571328472415015005,
            1588274134415015007,
            1567274792215015016,
            1567251872215015019,
            1591172746315015019,
            1599190346315015001,
            1555295960315015000,
            1555273090315015003,
            1553336601415015011,
            1594252556315015026,
            1538355945115015017,
            1616269445715015005,
            1536356085115015024,
            1536329255115015018,
            1594190596315015031,
            1607211566015015009,
            1586273504415015011,
            1571462164715015003,
            1599310944015015019,
            1602374434115015004,
            1611293213215015007,
            1611397934515015012,
            1613376973215015006,
            1615231223315015004,
            1622272303615015008,
            1624252003615015015,
            1626210283615015079,
            1594371133715015019,
            1609293774515015003,
            1640210403715015012,
            1590377563615015028,
            1638251423715015007,
            1581399724515015003,
            1586314763315015027,
            1558398584215015004,
            1590313633615015029,
            1586395643315015025,
            1590205794815015021,
            1524183111415015013,
            1524184525215015007,
            1524235535215015003,
            1526256181415015015,
            1527325605215015011,
            1537217395515015006,
            1549195353315015011,
            1552214983315015027,
            1556196724615015013,
            1558258244615015013,
            1592206496215015004,
            1562176372815015008,
            1567185192515015008,
            1569204372615015002,
            1594235026315015014,
            1584176560315015021,
            1586241440315015014,
            1552288573315015009,
            1521174451515015019,
        ],
        "magpsf": [
            18.16050148010254,
            18.784912109375,
            19.461193084716797,
            18.621198654174805,
            18.964542388916016,
            19.726045608520508,
            18.917972564697266,
            19.629337310791016,
            19.819753646850586,
            20.327407836914062,
            18.61440086364746,
            18.00200653076172,
            17.978425979614258,
            18.70786476135254,
            19.724464416503906,
            18.80974769592285,
            19.129016876220703,
            18.30741310119629,
            18.309383392333984,
            20.198789596557617,
            19.204242706298828,
            18.656694412231445,
            19.142784118652344,
            18.321063995361328,
            19.409656524658203,
            18.365034103393555,
            18.50041389465332,
            19.651634216308594,
            19.721988677978516,
            19.101137161254883,
            18.771387100219727,
            18.667316436767578,
            18.85565948486328,
            19.478546142578125,
            19.41177749633789,
            18.018444061279297,
            18.901935577392578,
            18.875383377075195,
            19.079631805419922,
            18.730152130126953,
            19.471435546875,
            18.687870025634766,
            19.894933700561523,
            19.213397979736328,
            19.528350830078125,
            18.61668586730957,
            19.362348556518555,
            19.657224655151367,
            19.23882293701172,
            18.898710250854492,
            18.274375915527344,
            18.92976188659668,
            19.962953567504883,
            18.937763214111328,
            19.376014709472656,
            18.91219711303711,
            19.540496826171875,
            19.029064178466797,
            19.61917495727539,
            18.966806411743164,
            18.31865882873535,
            17.55437469482422,
            17.493623733520508,
            18.174449920654297,
            18.09038543701172,
            17.732297897338867,
            18.213428497314453,
            18.63913917541504,
            18.153682708740234,
            18.394041061401367,
            18.144115447998047,
            18.17262077331543,
            19.76862907409668,
            17.465614318847656,
            18.842065811157227,
            18.10329818725586,
            17.95139503479004,
            18.39837646484375,
            18.292007446289062,
            18.471073150634766,
            19.620988845825195,
            18.05362892150879,
            18.024885177612305,
            18.849946975708008,
            18.161867141723633,
            18.806217193603516,
            18.629243850708008,
            19.20088005065918,
            18.684677124023438,
            19.054309844970703,
            19.012123107910156,
            19.33477020263672,
            18.91602897644043,
            19.674766540527344,
            19.09544563293457,
            20.13256072998047,
            19.820457458496094,
            19.502416610717773,
            19.505033493041992,
            18.697317123413086,
        ],
        "sigmapsf": [
            0.08086217194795609,
            0.10333321988582611,
            0.12432822585105896,
            0.0690094605088234,
            0.11114966869354248,
            0.11514615267515182,
            0.11507633328437805,
            0.12553229928016663,
            0.14449118077754974,
            0.19334548711776733,
            0.06743238866329193,
            0.07984911650419235,
            0.04475726559758186,
            0.07892462611198425,
            0.18304443359375,
            0.11266020685434341,
            0.21246781945228577,
            0.06773529946804047,
            0.06490179896354675,
            0.17240846157073975,
            0.09527900815010071,
            0.0837320014834404,
            0.15481868386268616,
            0.06432870775461197,
            0.11632395535707474,
            0.05988134816288948,
            0.0680500790476799,
            0.15114709734916687,
            0.14940446615219116,
            0.09450526535511017,
            0.07781684398651123,
            0.09233693033456802,
            0.08076968789100647,
            0.12606967985630035,
            0.14525116980075836,
            0.05351139232516289,
            0.07985306531190872,
            0.12600380182266235,
            0.09354324638843536,
            0.08365997672080994,
            0.13612638413906097,
            0.07286768406629562,
            0.2142745405435562,
            0.1374446004629135,
            0.11322065442800522,
            0.08303889632225037,
            0.11597646027803421,
            0.13433687388896942,
            0.10422319918870926,
            0.10974860936403275,
            0.058592259883880615,
            0.09524000436067581,
            0.18964269757270813,
            0.1132965087890625,
            0.15997228026390076,
            0.10844775289297104,
            0.18111419677734375,
            0.08225247263908386,
            0.1806689202785492,
            0.08678941428661346,
            0.06458517909049988,
            0.05453339219093323,
            0.05520128458738327,
            0.06031213328242302,
            0.0700724646449089,
            0.05910727381706238,
            0.0716085433959961,
            0.06671624630689621,
            0.059239231050014496,
            0.10783270001411438,
            0.06748528778553009,
            0.06872479617595673,
            0.18406693637371063,
            0.04366064444184303,
            0.09892421960830688,
            0.1230313628911972,
            0.05659736320376396,
            0.07645241171121597,
            0.06001603975892067,
            0.08190277963876724,
            0.16915172338485718,
            0.05649499222636223,
            0.06032877042889595,
            0.1050485223531723,
            0.0712265744805336,
            0.10293182730674744,
            0.1137363389134407,
            0.1189168319106102,
            0.06506755948066711,
            0.10056870430707932,
            0.08264419436454773,
            0.1294383853673935,
            0.08439051359891891,
            0.15384674072265625,
            0.11327838152647018,
            0.1961180865764618,
            0.18113191425800323,
            0.13044734299182892,
            0.15962624549865723,
            0.07393377274274826,
        ],
        "magnr": [
            19.083999633789062,
            22.716999053955078,
            22.55900001525879,
            20.795000076293945,
            22.52400016784668,
            22.347000122070312,
            22.0310001373291,
            22.53999900817871,
            19.357999801635742,
            22.27899932861328,
            19.68199920654297,
            22.457000732421875,
            22.72599983215332,
            23.163000106811523,
            21.906999588012695,
            20.820999145507812,
            22.650999069213867,
            22.244998931884766,
            21.27199935913086,
            22.427000045776367,
            22.374000549316406,
            22.60300064086914,
            21.5989990234375,
            22.333999633789062,
            22.413999557495117,
            20.966999053955078,
            21.597999572753906,
            21.39299964904785,
            22.51799964904785,
            22.645000457763672,
            22.322999954223633,
            21.281999588012695,
            22.461999893188477,
            22.542999267578125,
            21.999000549316406,
            22.256999969482422,
            22.261999130249023,
            19.31800079345703,
            20.43600082397461,
            22.46500015258789,
            22.128000259399414,
            21.413000106811523,
            22.135000228881836,
            22.334999084472656,
            22.430999755859375,
            22.235000610351562,
            22.208999633789062,
            22.05900001525879,
            22.530000686645508,
            21.30500030517578,
            21.854000091552734,
            21.95599937438965,
            22.225000381469727,
            22.320999145507812,
            22.253999710083008,
            20.01300048828125,
            21.104999542236328,
            22.17099952697754,
            22.21299934387207,
            21.996999740600586,
            22.26799964904785,
            22.666000366210938,
            22.68400001525879,
            22.062999725341797,
            22.433000564575195,
            22.341999053955078,
            22.29400062561035,
            22.204999923706055,
            22.374000549316406,
            22.67099952697754,
            15.880000114440918,
            22.121000289916992,
            22.035999298095703,
            18.93899917602539,
            22.17300033569336,
            22.37299919128418,
            21.145999908447266,
            21.058000564575195,
            21.70400047302246,
            18.79400062561035,
            22.823999404907227,
            23.052000045776367,
            22.93400001525879,
            23.29199981689453,
            20.230998992919922,
            21.714000701904297,
            22.618000030517578,
            22.246000289916992,
            22.923999786376953,
            22.027999877929688,
            18.923999786376953,
            21.802000045776367,
            23.118999481201172,
            23.302000045776367,
            22.89699935913086,
            20.732999801635742,
            22.9950008392334,
            22.948999404907227,
            22.93400001525879,
            23.326000213623047,
        ],
        "sigmagnr": [
            0.032999999821186066,
            0.3400000035762787,
            0.27399998903274536,
            0.0860000029206276,
            0.3610000014305115,
            0.3490000069141388,
            0.25600001215934753,
            0.35499998927116394,
            0.03700000047683716,
            0.28600001335144043,
            0.027000000700354576,
            0.2919999957084656,
            0.2939999997615814,
            0.33399999141693115,
            0.1850000023841858,
            0.0689999982714653,
            0.18199999630451202,
            0.21899999678134918,
            0.11999999731779099,
            0.30399999022483826,
            0.3540000021457672,
            0.34200000762939453,
            0.19099999964237213,
            0.3059999942779541,
            0.2709999978542328,
            0.0860000029206276,
            0.20000000298023224,
            0.15399999916553497,
            0.36000001430511475,
            0.3370000123977661,
            0.24500000476837158,
            0.14499999582767487,
            0.2930000126361847,
            0.2930000126361847,
            0.2280000001192093,
            0.26499998569488525,
            0.2919999957084656,
            0.10199999809265137,
            0.08399999886751175,
            0.3149999976158142,
            0.33799999952316284,
            0.1340000033378601,
            0.35499998927116394,
            0.3230000138282776,
            0.3479999899864197,
            0.32899999618530273,
            0.35899999737739563,
            0.34599998593330383,
            0.3479999899864197,
            0.12999999523162842,
            0.3059999942779541,
            0.22300000488758087,
            0.3499999940395355,
            0.3490000069141388,
            0.3400000035762787,
            0.04800000041723251,
            0.2160000056028366,
            0.296999990940094,
            0.2879999876022339,
            0.23399999737739563,
            0.36000001430511475,
            0.35899999737739563,
            0.3149999976158142,
            0.33899998664855957,
            0.29100000858306885,
            0.3529999852180481,
            0.3089999854564667,
            0.21199999749660492,
            0.25200000405311584,
            0.3269999921321869,
            0.014999999664723873,
            0.3440000116825104,
            0.30300000309944153,
            0.020999999716877937,
            0.289000004529953,
            0.2840000092983246,
            0.11100000143051147,
            0.11900000274181366,
            0.16599999368190765,
            0.023000000044703484,
            0.3190000057220459,
            0.29600000381469727,
            0.3529999852180481,
            0.3240000009536743,
            0.05999999865889549,
            0.14399999380111694,
            0.3330000042915344,
            0.19900000095367432,
            0.23499999940395355,
            0.11800000071525574,
            0.017999999225139618,
            0.10400000214576721,
            0.3479999899864197,
            0.31299999356269836,
            0.3100000023841858,
            0.039000000804662704,
            0.34299999475479126,
            0.32600000500679016,
            0.33799999952316284,
            0.3149999976158142,
        ],
        "magzpsci": [
            26.253501892089844,
            26.252912521362305,
            26.25119400024414,
            26.264198303222656,
            26.106542587280273,
            26.2220458984375,
            26.25397300720215,
            26.256336212158203,
            26.28575325012207,
            26.191408157348633,
            26.401399612426758,
            26.398006439208984,
            26.39542579650879,
            26.36386489868164,
            26.350465774536133,
            26.328746795654297,
            26.323017120361328,
            26.274412155151367,
            26.366382598876953,
            26.24979019165039,
            26.36224365234375,
            26.171695709228516,
            26.2587833404541,
            26.290063858032227,
            26.260656356811523,
            26.23203468322754,
            26.232412338256836,
            26.12663459777832,
            26.16598892211914,
            26.203136444091797,
            26.18838882446289,
            26.1433162689209,
            26.211660385131836,
            26.22754669189453,
            26.20577621459961,
            26.22044563293457,
            26.26893424987793,
            26.176382064819336,
            26.25063133239746,
            26.211153030395508,
            26.290435791015625,
            26.283870697021484,
            26.17693328857422,
            26.227397918701172,
            26.256349563598633,
            26.275684356689453,
            26.21034812927246,
            26.154224395751953,
            26.130823135375977,
            26.050710678100586,
            25.99737548828125,
            26.026762008666992,
            26.175952911376953,
            26.086763381958008,
            26.078014373779297,
            26.152196884155273,
            26.18449592590332,
            26.137065887451172,
            26.152175903320312,
            26.271806716918945,
            26.271657943725586,
            26.340373992919922,
            26.332624435424805,
            26.091449737548828,
            26.085384368896484,
            26.09329605102539,
            26.152427673339844,
            26.256139755249023,
            26.272682189941406,
            25.364042282104492,
            26.118114471435547,
            26.28261947631836,
            25.881629943847656,
            26.18361473083496,
            26.107065200805664,
            25.79429817199707,
            26.227394104003906,
            26.3803768157959,
            26.11200714111328,
            26.159074783325195,
            25.998987197875977,
            26.085628509521484,
            26.25388526916504,
            26.311946868896484,
            26.085866928100586,
            26.341217041015625,
            25.764244079589844,
            26.313880920410156,
            26.269678115844727,
            26.278310775756836,
            26.288122177124023,
            26.002769470214844,
            26.284029006958008,
            26.28776741027832,
            26.27944564819336,
            26.128559112548828,
            26.082456588745117,
            25.950416564941406,
            26.190034866333008,
            26.339317321777344,
        ],
        "isdiffpos": [
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
        ],
        "dcmag": [
            17.76783280480246,
            18.755679678598938,
            19.39901616256605,
            18.482374870626792,
            18.917775632575022,
            19.624188020566926,
            18.856789666224117,
            19.552858757463646,
            18.81842733939189,
            20.140903169777012,
            18.289645516672593,
            17.98610860012757,
            17.966233733264126,
            18.69069807935427,
            19.590944419761854,
            18.65868337340721,
            19.087390112966823,
            18.278889269191215,
            18.246083438010622,
            20.058760801594893,
            19.149055361258107,
            18.624185271271976,
            19.033708596682768,
            18.294805953934322,
            19.339570416871037,
            18.266785457924424,
            18.43717051908699,
            19.42636972530173,
            19.630271272859524,
            19.0576660057392,
            18.727640436397664,
            18.557570008357693,
            18.814889136972784,
            19.41012836174113,
            19.309919805904492,
            17.99566374890629,
            18.85135658984227,
            18.281240840184026,
            18.78890672963249,
            18.692159168523318,
            19.37849536993412,
            18.60369556205516,
            19.74733889178654,
            19.14837669345671,
            19.454678050823333,
            18.578624001938245,
            19.27802465133069,
            19.526341187341696,
            19.18058260623176,
            18.75611874428951,
            18.22370589969651,
            18.848808818319803,
            19.818005524958497,
            18.88197791514201,
            19.28779586964235,
            18.542036063857086,
            19.28149902508548,
            18.962870305436596,
            19.51302466578901,
            18.90195934460992,
            18.290367441034405,
            17.54518954743289,
            17.485017726524497,
            18.137608582143738,
            18.066952351616017,
            17.714064247786574,
            18.18414289812551,
            18.598515973974507,
            18.131597587070804,
            18.3462086346708,
            15.566964347685644,
            18.14328187980044,
            19.58306928658731,
            17.197566352122813,
            18.782023065809685,
            18.06915700775924,
            17.89315460439296,
            18.316484258627867,
            18.236422169883976,
            17.794163857121106,
            19.550085397316874,
            18.04075982361215,
            18.012914247607046,
            18.831730013835152,
            17.98491575010349,
            18.735124022968844,
            18.586007576181125,
            19.136437661679956,
            18.6629118726918,
            18.986500197722187,
            18.221400053448725,
            19.199737724971506,
            18.893822702609853,
            19.63569273097211,
            19.063317674176368,
            19.56330147874166,
            19.749869557460826,
            19.442856152441284,
            19.45399749840128,
            18.682336681603708,
        ],
        "dcmagerr": [
            0.05720545288607908,
            0.10099287930264715,
            0.11839464639747001,
            0.06159763614185044,
            0.10754602785251247,
            0.1093941932476433,
            0.10967166609213494,
            0.11945976376452162,
            0.0616244606909508,
            0.16897035177885342,
            0.05048445841654089,
            0.07880283195356998,
            0.04437907501007706,
            0.07786303248185897,
            0.16327283927167002,
            0.09843565193382021,
            0.2045906178899214,
            0.06622288066147894,
            0.061602154509014066,
            0.1559472456673834,
            0.0922408307095141,
            0.08188588142240137,
            0.14120608387990802,
            0.06321587703210074,
            0.11036027489006309,
            0.05520431338663941,
            0.0651892987848807,
            0.12617080146327359,
            0.14036464461743087,
            0.09175446916703653,
            0.07536738186768448,
            0.08461591237210413,
            0.07853883803694249,
            0.11971534578191664,
            0.13381097432679626,
            0.052688420462661645,
            0.07736856733234368,
            0.08463050992604566,
            0.07423911311947673,
            0.08150610398286012,
            0.12799834936740512,
            0.0681687651028096,
            0.1924049880375731,
            0.130809584329541,
            0.10822827509364774,
            0.08097537764264111,
            0.11061241359160415,
            0.12539632301995615,
            0.10043802965443813,
            0.09756234965107563,
            0.05763499950770862,
            0.08983744213358438,
            0.1716103110788238,
            0.10903245053904131,
            0.1498558598561757,
            0.07835486510624162,
            0.14986019640229173,
            0.07935624606605265,
            0.16602265165404598,
            0.08287554886708423,
            0.06360163143439777,
            0.05415849992009089,
            0.05482190372006695,
            0.05938686945404236,
            0.06885721440429553,
            0.058419464274054284,
            0.07018625810376314,
            0.06473602365240233,
            0.05826777043618555,
            0.1041432334067552,
            0.01498491596378753,
            0.06751833944211874,
            0.16228806003952048,
            0.03441714925133719,
            0.0948846570754786,
            0.11954651499377979,
            0.053953754960224636,
            0.07142323447579049,
            0.05761949098654056,
            0.04518498878212762,
            0.15973642770799235,
            0.05593815301327354,
            0.05979267619428926,
            0.1034412444356978,
            0.06118383306579501,
            0.09683891371853652,
            0.11006655338436314,
            0.11264929018180053,
            0.06394648325269814,
            0.09474953538780832,
            0.04096748545826492,
            0.11494628072775898,
            0.08298164509294753,
            0.1488203491267954,
            0.11034629719600583,
            0.11718067468191141,
            0.1710981428080136,
            0.12470423352430447,
            0.15308528055773027,
            0.07304831368748005,
        ],
    }
)

trajectory_sample_2 = pd.DataFrame(
    {
        "ra": [
            251.7524292,
            255.7670507,
            258.8328397,
            260.4098597,
            261.1618098,
            261.1653787,
            261.4823923,
            261.4974453,
            262.8265616,
            263.0573988,
            263.0437751,
            262.9947469,
            262.9919092,
            262.7891757,
            262.2231129,
            261.8181227,
            261.5276968,
            260.850303,
            260.8343066,
            259.8458154,
            259.2111807,
            259.1955657,
            259.1953397,
            258.7510019,
            258.741083,
            258.2797994,
            258.2737536,
            257.8099535,
            257.3216502,
            256.8520963,
            256.3732258,
            256.3659298,
            255.9068966,
            255.4243588,
            254.9745357,
            254.5593688,
            254.5352718,
            253.3283433,
            252.9821052,
            252.9739772,
        ],
        "dec": [
            -18.6364371,
            -18.4989623,
            -18.1739112,
            -17.880881,
            -17.686997,
            -17.6859217,
            -17.5876298,
            -17.5824284,
            -16.8949672,
            -16.4439832,
            -16.3145206,
            -16.1837111,
            -16.1796083,
            -15.9197258,
            -15.5294343,
            -15.3346564,
            -15.214951,
            -14.9785789,
            -14.9738932,
            -14.6993151,
            -14.5525839,
            -14.5493996,
            -14.5493562,
            -14.4579551,
            -14.4561171,
            -14.369898,
            -14.3688627,
            -14.2903089,
            -14.2159453,
            -14.1520687,
            -14.0947549,
            -14.0939624,
            -14.0465265,
            -14.0050399,
            -13.9743641,
            -13.9534956,
            -13.9526023,
            -13.9441507,
            -13.9600792,
            -13.9604684,
        ],
        "ssnamenr": [
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
        ],
        "jd": [
            2459280.9420949,
            2459292.9425579,
            2459303.9599306,
            2459310.9610995,
            2459314.959294,
            2459314.9809259,
            2459316.8795602,
            2459316.9799653,
            2459328.856713,
            2459335.93,
            2459337.9102199,
            2459339.8979398,
            2459339.9602431,
            2459343.897963,
            2459349.8767245,
            2459352.9435185,
            2459354.8759722,
            2459358.8365625,
            2459358.9178356,
            2459363.8968981,
            2459366.8139005,
            2459366.8796412,
            2459366.8805787,
            2459368.8363426,
            2459368.8768981,
            2459370.8545833,
            2459370.8787963,
            2459372.8331019,
            2459374.8640741,
            2459376.8145023,
            2459378.808287,
            2459378.8371296,
            2459380.7725116,
            2459382.8368519,
            2459384.816713,
            2459386.7093866,
            2459386.8145602,
            2459392.8348843,
            2459394.7926505,
            2459394.8371065,
        ],
        "fid": [
            2,
            1,
            2,
            1,
            2,
            1,
            1,
            2,
            1,
            1,
            1,
            1,
            2,
            1,
            1,
            1,
            1,
            2,
            1,
            2,
            1,
            2,
            2,
            1,
            2,
            2,
            1,
            2,
            1,
            2,
            2,
            1,
            1,
            2,
            2,
            2,
            1,
            2,
            2,
            1,
        ],
        "nid": [
            1526,
            1538,
            1549,
            1556,
            1560,
            1560,
            1562,
            1562,
            1574,
            1581,
            1583,
            1585,
            1585,
            1589,
            1595,
            1598,
            1600,
            1604,
            1604,
            1609,
            1612,
            1612,
            1612,
            1614,
            1614,
            1616,
            1616,
            1618,
            1620,
            1622,
            1624,
            1624,
            1626,
            1628,
            1630,
            1632,
            1632,
            1638,
            1640,
            1640,
        ],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aaoqaif",
            "ZTF21aaqedea",
            "ZTF21aaraaae",
            "ZTF21aasxdjq",
            "ZTF21aaubnmk",
            "ZTF21aaubuxp",
            "ZTF21aauvskc",
            "ZTF21aauztyu",
            "ZTF21aaxijyg",
            "ZTF21aaxzboc",
            "ZTF21aaylsgp",
            "ZTF21aazeywe",
            "ZTF21aazgfae",
            "ZTF21abahzau",
            "ZTF21abbsunp",
            "ZTF21abbxqjy",
            "ZTF21abccmxj",
            "ZTF21abciqdn",
            "ZTF21abcjait",
            "ZTF21abcusmr",
            "ZTF21abdgvzi",
            "ZTF21abdicyw",
            "ZTF21abdicyw",
            "ZTF21abdtbjr",
            "ZTF21abdtwsz",
            "ZTF21abegqyz",
            "ZTF21abehfrh",
            "ZTF21abeupta",
            "ZTF21abfdwil",
            "ZTF21abfoiyq",
            "ZTF21abgawrt",
            "ZTF21abgblei",
            "ZTF21abgluwj",
            "ZTF21abgxpaa",
            "ZTF21abhfzfd",
            "ZTF21abhsill",
            "ZTF21abhsubu",
            "ZTF21abiecpy",
            "ZTF21abikrdr",
            "ZTF21abiltta",
        ],
        "candid": [
            1526442091915015023,
            1538442552215015018,
            1549459933015015008,
            1556461092815015024,
            1560459292515015025,
            1560480922515015043,
            1562379562515015025,
            1562479962515015031,
            1574356713815015026,
            1581430003815015016,
            1583410213815015010,
            1585397933815015005,
            1585460243815015005,
            1589397963715015059,
            1595376724015015012,
            1598443514015015004,
            1600375974115015000,
            1604336565815015025,
            1604417835815015015,
            1609396896315015032,
            1612313906215015011,
            1612379646215015019,
            1612380575115015014,
            1614336345115015010,
            1614376895115015009,
            1616354585015015008,
            1616378795015015006,
            1618333105015015000,
            1620364075515015001,
            1622314505215015016,
            1624308285315015014,
            1624337125315015018,
            1626272515315015010,
            1628336855615015017,
            1630316715615015014,
            1632209385715015007,
            1632314565715015010,
            1638334886015015018,
            1640292656015015016,
            1640337106015015008,
        ],
        "magpsf": [
            18.036869049072266,
            18.525136947631836,
            17.514747619628906,
            17.973377227783203,
            17.221111297607422,
            17.895639419555664,
            17.808406829833984,
            17.16434097290039,
            17.4180965423584,
            17.229183197021484,
            17.09563636779785,
            17.189735412597656,
            16.607458114624023,
            16.981061935424805,
            16.95501136779785,
            16.738494873046875,
            16.78156852722168,
            15.995867729187012,
            16.625547409057617,
            15.931930541992188,
            16.455678939819336,
            15.868266105651855,
            15.809646606445312,
            16.335847854614258,
            15.704656600952148,
            15.75794792175293,
            16.22144889831543,
            15.544684410095215,
            16.162494659423828,
            15.64391803741455,
            15.64637279510498,
            16.289222717285156,
            16.305313110351562,
            15.67836856842041,
            15.816125869750977,
            15.80380630493164,
            16.390533447265625,
            15.926766395568848,
            15.952705383300781,
            16.516693115234375,
        ],
        "sigmapsf": [
            0.0768224373459816,
            0.10321882367134094,
            0.0766848623752594,
            0.08624500781297684,
            0.03459253907203674,
            0.04582305625081062,
            0.05549671873450279,
            0.03571411594748497,
            0.06782419979572296,
            0.07883951812982559,
            0.0556395947933197,
            0.03936946764588356,
            0.029921529814600945,
            0.046503305435180664,
            0.03344561532139778,
            0.03773140162229538,
            0.05104396864771843,
            0.03277841955423355,
            0.04006878286600113,
            0.026836523786187172,
            0.0384971983730793,
            0.038393110036849976,
            0.03329050913453102,
            0.03619929030537605,
            0.030167296528816223,
            0.04390547797083855,
            0.03744559735059738,
            0.04168780893087387,
            0.03943997621536255,
            0.04122317582368851,
            0.038666702806949615,
            0.037398818880319595,
            0.05574681609869003,
            0.039540596306324005,
            0.03717188909649849,
            0.029090767726302147,
            0.04275164008140564,
            0.04727723076939583,
            0.04890663921833038,
            0.05484451726078987,
        ],
        "magnr": [
            21.43400001525879,
            21.722999572753906,
            19.895999908447266,
            20.559999465942383,
            20.823999404907227,
            19.08500099182129,
            18.731000900268555,
            20.310998916625977,
            20.031999588012695,
            17.954999923706055,
            19.89699935913086,
            21.16900062561035,
            17.464000701904297,
            20.85099983215332,
            20.98200035095215,
            20.99799919128418,
            19.6510009765625,
            22.136999130249023,
            22.240999221801758,
            20.84600067138672,
            21.14299964904785,
            22.655000686645508,
            20.312999725341797,
            20.0939998626709,
            20.961999893188477,
            22.01799964904785,
            20.236000061035156,
            19.37299919128418,
            22.469999313354492,
            21.50200080871582,
            22.1299991607666,
            22.266000747680664,
            17.423999786376953,
            22.860000610351562,
            19.553998947143555,
            21.185998916625977,
            20.889999389648438,
            23.393999099731445,
            19.06800079345703,
            22.591999053955078,
        ],
        "sigmagnr": [
            0.12999999523162842,
            0.1679999977350235,
            0.04699999839067459,
            0.07999999821186066,
            0.14900000393390656,
            0.02800000086426735,
            0.03200000151991844,
            0.09099999815225601,
            0.07999999821186066,
            0.017999999225139618,
            0.057999998331069946,
            0.16899999976158142,
            0.023000000044703484,
            0.10499999672174454,
            0.08799999952316284,
            0.10899999737739563,
            0.03500000014901161,
            0.13199999928474426,
            0.210999995470047,
            0.04500000178813934,
            0.06300000101327896,
            0.25,
            0.04800000041723251,
            0.09099999815225601,
            0.050999999046325684,
            0.12200000137090683,
            0.07999999821186066,
            0.024000000208616257,
            0.296999990940094,
            0.11500000208616257,
            0.16099999845027924,
            0.34700000286102295,
            0.014000000432133675,
            0.24799999594688416,
            0.026000000536441803,
            0.050999999046325684,
            0.10100000351667404,
            0.3580000102519989,
            0.014000000432133675,
            0.3449999988079071,
        ],
        "magzpsci": [
            26.115869522094727,
            26.05913543701172,
            26.209747314453125,
            26.23337745666504,
            26.42911148071289,
            26.25864028930664,
            26.086406707763672,
            26.417341232299805,
            26.071096420288086,
            25.784183502197266,
            26.114635467529297,
            26.15373420715332,
            26.344457626342773,
            26.07006072998047,
            26.28801155090332,
            26.206493377685547,
            26.29056739807129,
            26.240867614746094,
            26.24454689025879,
            26.23293113708496,
            26.044677734375,
            26.1292667388916,
            26.132646560668945,
            26.089847564697266,
            26.122657775878906,
            26.24494743347168,
            26.187448501586914,
            24.989683151245117,
            26.214494705200195,
            26.218917846679688,
            26.232372283935547,
            26.280221939086914,
            25.195314407348633,
            25.99736976623535,
            26.084125518798828,
            26.107805252075195,
            26.218534469604492,
            26.065765380859375,
            25.861705780029297,
            25.8046932220459,
        ],
        "isdiffpos": [
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
        ],
        "dcmag": [
            17.98319732320105,
            18.45454892653741,
            17.393188949412988,
            17.86943998889616,
            17.187522884646366,
            17.565417069624004,
            17.344836056833373,
            17.113074780033852,
            17.30111478684247,
            16.565172771274014,
            17.000119194959492,
            17.15766571789453,
            16.22201714298219,
            16.94286201265401,
            16.92782967955456,
            16.714804141052824,
            16.704612563261236,
            15.991958037232244,
            16.618934362835816,
            15.9197828990098,
            16.437092239385645,
            15.865873642753552,
            15.790262673720381,
            16.29433379319891,
            15.694844545279295,
            15.75445630839871,
            16.19132673947491,
            15.445041990701364,
            16.158895471360275,
            15.638743295277646,
            15.643497055323726,
            16.284630677938715,
            15.547224735042246,
            15.676490342207698,
            15.775502598264826,
            15.794935769000386,
            16.371707642356615,
            15.925410413765999,
            15.866110972762892,
            16.51020041326505,
        ],
        "dcmagerr": [
            0.07338552404940367,
            0.09729802343671755,
            0.06874291924348738,
            0.07871121273919436,
            0.03384450411518058,
            0.03459437778009251,
            0.037879957514163114,
            0.03432451774474552,
            0.06144224704500239,
            0.043555643980421936,
            0.051187443431163646,
            0.03853879467577054,
            0.022077217126680527,
            0.045042121244155,
            0.03269117375134044,
            0.036991907554593216,
            0.04761153244226201,
            0.03266404428664542,
            0.0398460770117155,
            0.0265426621530148,
            0.037858878739993336,
            0.03831255442850794,
            0.03271246723929445,
            0.03500814978597125,
            0.0298994163655786,
            0.04376626230353461,
            0.03648672454084371,
            0.03809044023440725,
            0.03932173696803908,
            0.04103081258218728,
            0.03856677496867637,
            0.037269762438517276,
            0.028610731531166125,
            0.03947458111844519,
            0.03581951312116638,
            0.028857046426422665,
            0.04205260469097008,
            0.04722033697486204,
            0.045170268572920204,
            0.05455631613825157,
        ],
    }
)

if __name__ == "__main__":  # pragma: no cover
    exit()

import pandas as pd
import numpy as np

# Intra night association testing

# intra_night_separation_association testing

intra_sep_left_expected = pd.DataFrame(
    {
        "ra": [
            100.000,
            100.000,
            100.003,
            100.003,
            100.007,
            100.007,
            14.000,
            14.000,
            14.003,
            14.003,
            14.007,
            14.007,
        ],
        "dec": [
            8.000,
            8.000,
            8.002,
            8.002,
            8.005,
            8.005,
            16.000,
            16.000,
            15.998,
            15.998,
            15.992,
            15.992,
        ],
        "candid": [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6],
        "traj": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
    }
)

intra_sep_right_expected = pd.DataFrame(
    {
        "ra": [
            100.003,
            100.007,
            100.000,
            100.007,
            100.000,
            100.003,
            14.003,
            14.007,
            14.000,
            14.007,
            14.000,
            14.003,
        ],
        "dec": [
            8.002,
            8.005,
            8.000,
            8.005,
            8.000,
            8.002,
            15.998,
            15.992,
            16.000,
            15.992,
            16.000,
            15.998,
        ],
        "candid": [2, 3, 1, 3, 1, 2, 5, 6, 4, 6, 4, 5],
        "traj": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
    }
)

# compute_diff_mag testing

same_fid_left_expected1 = pd.DataFrame(
    {
        "ra": [
            100.000,
            100.000,
            100.003,
            100.003,
            100.007,
            100.007,
            100.001,
            100.001,
            100.003,
            100.003,
            100.008,
            100.008,
        ],
        "dec": [
            12.000,
            12.000,
            11.998,
            11.998,
            11.994,
            11.994,
            11.994,
            11.994,
            11.998,
            11.998,
            12.002,
            12.002,
        ],
        "jd": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "dcmag": [
            17.00,
            17.00,
            17.05,
            17.05,
            17.09,
            17.09,
            15.00,
            15.00,
            15.07,
            15.07,
            15.10,
            15.10,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
        "candid": [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6],
        "traj": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
    }
)


same_fid_right_expected1 = pd.DataFrame(
    {
        "ra": [
            100.003,
            100.007,
            100.000,
            100.007,
            100.000,
            100.003,
            100.003,
            100.008,
            100.001,
            100.008,
            100.001,
            100.003,
        ],
        "dec": [
            11.998,
            11.994,
            12.000,
            11.994,
            12.000,
            11.998,
            11.998,
            12.002,
            11.994,
            12.002,
            11.994,
            11.998,
        ],
        "jd": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "dcmag": [
            17.05,
            17.09,
            17.00,
            17.09,
            17.00,
            17.05,
            15.07,
            15.10,
            15.00,
            15.10,
            15.00,
            15.07,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
        "candid": [2, 3, 1, 3, 1, 2, 5, 6, 4, 6, 4, 5],
        "traj": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2],
    }
)


same_fid_left_expected2 = pd.DataFrame(
    {
        "ra": [100.0, 99.0, 99.8, 100.2, 100.7, 100.5],
        "dec": [12.0, 11.8, 11.2, 12.3, 11.7, 11.5],
        "jd": [1.05, 1.08, 1.09, 2.50, 2.60, 2.70],
        "dcmag": [15.00, 17.00, 16.00, 16.04, 17.03, 15.06],
        "fid": [1, 1, 1, 1, 1, 1],
        "candid": [1, 2, 3, 4, 5, 6],
        "traj": [1, 2, 3, 3, 2, 1],
    }
)


same_fid_right_expected2 = pd.DataFrame(
    {
        "ra": [100.5, 100.7, 100.2, 99.8, 99.0, 100.0],
        "dec": [11.5, 11.7, 12.3, 11.2, 11.8, 12.0],
        "jd": [2.70, 2.60, 2.50, 1.09, 1.08, 1.05],
        "dcmag": [15.06, 17.03, 16.04, 16.00, 17.00, 15.00],
        "fid": [1, 1, 1, 1, 1, 1],
        "candid": [6, 5, 4, 3, 2, 1],
        "traj": [1, 2, 3, 3, 2, 1],
    }
)


# intra_night_association testing

intra_night_test_traj = pd.DataFrame(
    {
        "ra": [
            106.305259,
            106.141905,
            169.860467,
            106.303285,
            106.141138,
            169.856885,
            106.140906,
            106.302386,
            106.140840,
            106.302364,
            169.833666,
            169.829712,
            169.829656,
        ],
        "dec": [
            18.176682,
            15.241181,
            15.206360,
            18.177874,
            15.239999,
            15.210309,
            15.239506,
            18.178404,
            15.239482,
            18.178424,
            15.236048,
            15.240389,
            15.240490,
        ],
        "dcmag": [
            0.066603,
            0.018517,
            0.038709,
            0.089385,
            0.020256,
            0.044030,
            0.021575,
            0.042095,
            0.023033,
            0.046602,
            0.032183,
            0.026171,
            0.025890,
        ],
        "ssnamenr": [
            3866,
            3051,
            19743,
            3866,
            3051,
            19743,
            3051,
            3866,
            3051,
            3866,
            19743,
            19743,
            19743,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2],
        "candid": [
            1520166712915015010,
            1520166711415015012,
            1520220641415015001,
            1520227401615015011,
            1520227400315015018,
            1520239140315015026,
            1520254695615015016,
            1520255162915015021,
            1520255630315015010,
            1520255631615015014,
            1520359440315015016,
            1520379906015015006,
            1520380381415015018,
        ],
        "jd": [
            2459274.666713,
            2459274.666713,
            2459274.7206481,
            2459274.7274074,
            2459274.7274074,
            2459274.7391435,
            2459274.7546991,
            2459274.755162,
            2459274.7556366,
            2459274.7556366,
            2459274.8594444,
            2459274.8799074,
            2459274.8803819,
        ],
    }
)

intra_night_left = pd.DataFrame(
    {
        "ra": [
            106.140906,
            106.302386,
            169.829712,
            106.141905,
            106.305259,
            169.860467,
            106.141138,
            106.303285,
            169.856885,
            169.833666,
        ],
        "dec": [
            15.239506,
            18.178404,
            15.240389,
            15.241181,
            18.176682,
            15.20636,
            15.239999,
            18.177874,
            15.210309,
            15.236048,
        ],
        "dcmag": [
            0.021575,
            0.042095,
            0.026171,
            0.018517,
            0.066603,
            0.038709,
            0.020256,
            0.089385,
            0.04403,
            0.032183,
        ],
        "ssnamenr": [3051, 3866, 19743, 3051, 3866, 19743, 3051, 3866, 19743, 19743],
        "fid": [2, 2, 2, 1, 1, 1, 1, 1, 1, 2],
        "candid": [
            1520254695615015016,
            1520255162915015021,
            1520379906015015006,
            1520166711415015012,
            1520166712915015010,
            1520220641415015001,
            1520227400315015018,
            1520227401615015011,
            1520239140315015026,
            1520359440315015016,
        ],
        "jd": [
            2459274.754699,
            2459274.755162,
            2459274.879907,
            2459274.666713,
            2459274.666713,
            2459274.720648,
            2459274.727407,
            2459274.727407,
            2459274.739144,
            2459274.859444,
        ],
    }
)

intra_night_right = pd.DataFrame(
    {
        "ra": [
            106.14084,
            106.302364,
            169.829656,
            106.141138,
            106.303285,
            169.856885,
            106.140906,
            106.302386,
            169.833666,
            169.829712,
        ],
        "dec": [
            15.239482,
            18.178424,
            15.24049,
            15.239999,
            18.177874,
            15.210309,
            15.239506,
            18.178404,
            15.236048,
            15.240389,
        ],
        "dcmag": [
            0.023033,
            0.046602,
            0.02589,
            0.020256,
            0.089385,
            0.04403,
            0.021575,
            0.042095,
            0.032183,
            0.026171,
        ],
        "ssnamenr": [3051, 3866, 19743, 3051, 3866, 19743, 3051, 3866, 19743, 19743],
        "fid": [2, 2, 2, 1, 1, 1, 2, 2, 2, 2],
        "candid": [
            1520255630315015010,
            1520255631615015014,
            1520380381415015018,
            1520227400315015018,
            1520227401615015011,
            1520239140315015026,
            1520254695615015016,
            1520255162915015021,
            1520359440315015016,
            1520379906015015006,
        ],
        "jd": [
            2459274.755637,
            2459274.755637,
            2459274.880382,
            2459274.727407,
            2459274.727407,
            2459274.739144,
            2459274.754699,
            2459274.755162,
            2459274.859444,
            2459274.879907,
        ],
    }
)


# Night to night association testing

# Cone search association testing

# Association that match the angle criterion
cone_search_two_last_observation_sample = pd.DataFrame(
    {
        "ra": [1, 2, 4, 5, 5, 6, 1, 2],
        "dec": [8, 7, 1, 2, 4, 8, 1, 1],
        "jd": [1, 2, 1, 2, 1, 2, 1, 2],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17],
        "trajectory_id": [20, 20, 21, 21, 22, 22, 23, 23],
    }
)

traj_assoc_sample = pd.DataFrame(
    {
        "ra": [2, 5, 6, 2],
        "dec": [7, 2, 8, 1],
        "jd": [2, 2, 2, 2],
        "candid": [11, 13, 15, 17],
        "trajectory_id": [20, 21, 22, 23],
    }
)

new_obs_assoc_sample = pd.DataFrame(
    {
        "ra": [3, 6, 7, 3],
        "dec": [6, 3, 9, 1],
        "jd": [3, 3, 3, 3],
        "candid": [18, 19, 20, 21],
        "trajectory_id": [30, 31, 32, 33],
    }
)

left_cone_search_expected = pd.DataFrame(
    {
        "ra": [2, 5, 6, 2],
        "dec": [7, 2, 8, 1],
        "jd": [2, 2, 2, 2],
        "candid": [11, 13, 15, 17],
        "trajectory_id": [20, 21, 22, 23],
    }
)

right_cone_search_expected = pd.DataFrame(
    {
        "ra": [3, 6, 7, 3],
        "dec": [6, 3, 9, 1],
        "jd": [3, 3, 3, 3],
        "candid": [18, 19, 20, 21],
        "tmp_traj": [30, 31, 32, 33],
        "trajectory_id": [20, 21, 22, 23],
    }
)

# Association that not match the angle criterion
false_cone_search_two_last_observation_sample = pd.DataFrame(
    {
        "ra": [2, 3, 8, 9, 7, 8],
        "dec": [1, 2, 2, 3, 5, 6],
        "jd": [1, 2, 1, 2, 1, 2],
        "candid": [10, 11, 12, 13, 14, 15],
        "trajectory_id": [20, 20, 21, 21, 22, 22],
    }
)

false_traj_assoc_sample = pd.DataFrame(
    {
        "ra": [3, 9, 8],
        "dec": [2, 3, 6],
        "jd": [2, 2, 2],
        "candid": [11, 13, 15],
        "trajectory_id": [20, 21, 22],
    }
)

false_new_obs_assoc_sample = pd.DataFrame(
    {
        "ra": [4, 8, 7],
        "dec": [1, 5, 7],
        "jd": [3, 3, 3],
        "candid": [16, 17, 18],
        "trajectory_id": [30, 31, 32],
    }
)

# Night to night trajectory association testing

night_to_night_two_last_sample = pd.DataFrame(
    {
        "ra": [1, 2, 5, 6, 10, 11, 1, 2, 7, 7, 1, 8],
        "dec": [1, 2, 1, 1, 1, 1, 6, 7, 7, 8, 11, 6],
        "dcmag": [13, 13.05, 15, 15.08, 17, 17.03, 16, 16.04, 17, 17.1, 14, 18],
        "fid": [1, 2, 1, 1, 2, 2, 1, 2, 2, 2, 1, 1],
        "jd": [1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5],
    }
)

night_to_night_new_observation = pd.DataFrame(
    {
        "ra": [3, 7, 10.5, 2, 3, 4, 11, 8],
        "dec": [3, 2, 2, 8, 7, 9, 9, 9],
        "dcmag": [13.1, 15.13, 17.06, 16.07, 16.05, 15, 18, 18.5],
        "fid": [2, 1, 1, 1, 2, 1, 2, 2],
        "jd": [3, 3, 3, 3, 3, 3, 3, 3],
        "candid": [22, 23, 24, 25, 26, 27, 28, 29],
    }
)

night_to_night_traj_assoc_left_expected = pd.DataFrame(
    {
        "trajectory_id": [0, 1, 3, 3],
        "ra": [2, 6, 2, 2],
        "dec": [2, 1, 7, 7],
        "dcmag": [13.05, 15.08, 16.04, 16.04],
        "fid": [2, 1, 2, 2],
        "jd": [2, 2, 2, 2],
        "candid": [11, 13, 17, 17],
    }
)

night_to_night_traj_assoc_right_expected = pd.DataFrame(
    {
        "ra": [3.0, 7, 3, 2],
        "dec": [3, 2, 7, 8],
        "dcmag": [13.10, 15.13, 16.05, 16.07],
        "fid": [2, 1, 2, 1],
        "jd": [3, 3, 3, 3],
        "candid": [22, 23, 26, 25],
        "trajectory_id": [0, 1, 3, 3],
    }
)


# trajectory associations testing

trajectory_df_sample = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10],
        "dec": [1, 2, 3, 12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3],
        "dcmag": [
            12.02,
            12.05,
            12.3,
            15,
            15.1,
            15.23,
            13,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16,
            16.4,
            16.7,
        ],
        "fid": [1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
        "trajectory_id": [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5],
    }
)

traj_next_night_sample = pd.DataFrame(
    {
        "ra": [4, 5, 1, 1, 8, 7, 13, 13],
        "dec": [4, 5, 9, 8, 7, 8, 1, 2],
        "dcmag": [12.4, 12.52, 15.94, 15.47, 17.31, 17.43, 16.21, 16.28],
        "fid": [1, 1, 2, 1, 1, 1, 2, 2],
        "nid": [4, 4, 4, 4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.1, 4.2, 4.1, 4.2],
        "candid": [25, 26, 27, 28, 29, 30, 31, 32],
        "trajectory_id": [10, 10, 11, 11, 12, 12, 13, 13],
    }
)

new_observations_sample = pd.DataFrame(
    {
        "ra": [5, 5, 10, 9, 13],
        "dec": [1, 10, 4, 10, 11],
        "dcmag": [13.42, 17.5, 16.82, 15.86, 16.49],
        "fid": [2, 2, 1, 2, 1],
        "nid": [4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.2, 4.2, 4.3],
        "candid": [33, 34, 35, 36, 37],
    }
)

trajectory_df_expected = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 4, 5, 8, 7, 10],
        "dec": [1, 2, 3, 12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 4, 5, 7, 8, 4],
        "dcmag": [
            12.02,
            12.05,
            12.30,
            15.00,
            15.10,
            15.23,
            13.00,
            12.60,
            12.75,
            17.02,
            17.15,
            17.27,
            16.00,
            16.40,
            16.70,
            12.40,
            12.52,
            17.31,
            17.43,
            16.82,
        ],
        "fid": [1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 4, 4],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.1,
            4.2,
            4.1,
            4.2,
            4.2,
        ],
        "candid": [
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            29,
            30,
            35,
        ],
        "trajectory_id": [
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            3.0,
            3.0,
            3.0,
            4.0,
            4.0,
            4.0,
            5.0,
            5.0,
            5.0,
            1.0,
            1.0,
            4.0,
            4.0,
            5.0,
        ],
    }
)

traj_next_night_expected = pd.DataFrame(
    {
        "ra": [1, 1, 13, 13],
        "dec": [9, 8, 1, 2],
        "dcmag": [15.94, 15.47, 16.21, 16.28],
        "fid": [2, 1, 2, 2],
        "nid": [4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2],
        "candid": [27, 28, 31, 32],
        "trajectory_id": [11, 11, 13, 13],
    }
)

new_observations_expected = pd.DataFrame(
    {
        "ra": [5, 5, 9, 13],
        "dec": [1, 10, 10, 11],
        "dcmag": [13.42, 17.50, 15.86, 16.49],
        "fid": [2, 2, 2, 1],
        "nid": [4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.2, 4.3],
        "candid": [33, 34, 36, 37],
    }
)

trajectory_df_expected2 = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 4, 5, 8, 7],
        "dec": [1, 2, 3, 12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 4, 5, 7, 8],
        "dcmag": [
            12.02,
            12.05,
            12.30,
            15.00,
            15.10,
            15.23,
            13.00,
            12.60,
            12.75,
            17.02,
            17.15,
            17.27,
            16.00,
            16.40,
            16.70,
            12.40,
            12.52,
            17.31,
            17.43,
        ],
        "fid": [1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 4],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.1,
            4.2,
            4.1,
            4.2,
        ],
        "candid": [
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            29,
            30,
        ],
        "trajectory_id": [
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            3.0,
            3.0,
            3.0,
            4.0,
            4.0,
            4.0,
            5.0,
            5.0,
            5.0,
            1.0,
            1.0,
            4.0,
            4.0,
        ],
    }
)

trajectory_df_expected_empty = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 10],
        "dec": [1, 2, 3, 12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 4],
        "dcmag": [
            12.02,
            12.05,
            12.30,
            15.00,
            15.10,
            15.23,
            13.00,
            12.60,
            12.75,
            17.02,
            17.15,
            17.27,
            16.00,
            16.40,
            16.70,
            16.82,
        ],
        "fid": [1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.2,
        ],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 35],
        "trajectory_id": [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5],
    }
)

expected_trajectory_first_report = {
    "list of updated trajectories": [1.0, 4.0, 5.0],
    "all nid report": [
        {
            "old nid": 3,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        }
    ],
}


expected_trajectory_second_report = {
    "list of updated trajectories": [5.0],
    "all nid report": [
        {
            "old nid": 3,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        }
    ],
}

expected_trajectory_third_report = {
    "list of updated trajectories": [],
    "all nid report": [
        {
            "old nid": 3,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "trajectories_to_new_observation_report": {},
        }
    ],
}

# tracklets and observations associations testing

track_and_obs_trajectory_df_sample = pd.DataFrame(
    {
        "ra": [1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10],
        "dec": [12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3],
        "dcmag": [
            15,
            15.1,
            15.23,
            13,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16,
            16.4,
            16.7,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
        "candid": [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
        "trajectory_id": [2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5],
    }
)

track_and_obs_traj_next_night_sample = pd.DataFrame(
    {
        "ra": [2, 3, 7, 8],
        "dec": [2, 3, 1, 2],
        "dcmag": [15.74, 15.47, 16.21, 16.28],
        "fid": [2, 1, 2, 2],
        "nid": [4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2],
        "candid": [27, 28, 31, 32],
        "trajectory_id": [11, 11, 13, 13],
    }
)

track_and_obs_old_observations_sample = pd.DataFrame(
    {
        "ra": [1, 1, 4, 3, 6, 7, 9],
        "dec": [1, 5, 1, 5, 1, 7, 5],
        "dcmag": [15.52, 16.32, 14.96, 16.28, 16.03, 18.52, 17.68],
        "fid": [2, 1, 2, 2, 2, 1, 1],
        "nid": [2, 1, 3, 3, 3, 3, 3],
        "jd": [2.1, 1.2, 3.1, 3.2, 3.1, 3.2, 3.1],
        "candid": [33, 34, 35, 36, 37, 38, 39],
    }
)

track_and_obs_new_observations_sample = pd.DataFrame(
    {
        "ra": [2, 4, 6, 5, 10],
        "dec": [9, 6, 3, 10, 4],
        "dcmag": [15.52, 16.32, 14.96, 18.52, 17.99],
        "fid": [2, 1, 2, 1, 2],
        "nid": [4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.1],
        "candid": [40, 41, 42, 43, 44],
    }
)

track_and_obs_trajectory_df_expected = pd.DataFrame(
    {
        "ra": [
            1,
            2,
            2,
            6,
            7,
            8,
            6,
            7,
            8,
            9,
            10,
            10,
            3,
            9,
            4,
            10,
            1,
            2,
            2,
            3,
            7,
            8,
            6,
            1,
        ],
        "dec": [
            12,
            11,
            10,
            12,
            12,
            12,
            6,
            5,
            6,
            1,
            2,
            3,
            5,
            5,
            6,
            4,
            5,
            9,
            2,
            3,
            1,
            2,
            1,
            1,
        ],
        "dcmag": [
            15.00,
            15.10,
            15.23,
            13.00,
            12.60,
            12.75,
            17.02,
            17.15,
            17.27,
            16.00,
            16.40,
            16.70,
            16.28,
            17.68,
            16.32,
            17.99,
            16.32,
            15.52,
            15.74,
            15.47,
            16.21,
            16.28,
            16.03,
            15.52,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 3, 3, 4, 4, 1, 4, 4, 4, 4, 4, 3, 2],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            3.2,
            3.1,
            4.2,
            4.1,
            1.2,
            4.1,
            4.1,
            4.2,
            4.1,
            4.2,
            3.1,
            2.1,
        ],
        "candid": [
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            36,
            39,
            41,
            44,
            34,
            40,
            27,
            28,
            31,
            32,
            37,
            33,
        ],
        "trajectory_id": [
            2,
            2,
            2,
            3,
            3,
            3,
            4,
            4,
            4,
            5,
            5,
            5,
            6,
            7,
            6,
            7,
            8,
            8,
            11,
            11,
            13,
            13,
            13,
            11,
        ],
    }
)

track_and_obs_old_observations_expected = pd.DataFrame(
    {
        "ra": [4, 7, 6, 5],
        "dec": [1, 7, 3, 10],
        "dcmag": [14.96, 18.52, 14.96, 18.52],
        "fid": [2, 1, 2, 1],
        "nid": [3, 3, 4, 4],
        "jd": [3.1, 3.2, 4.1, 4.2],
        "candid": [35, 38, 42, 43],
    }
)


track_and_obs_trajectory_df_expected2 = pd.DataFrame(
    {
        "ra": [1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 3, 9, 4, 10, 1, 2],
        "dec": [12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 5, 5, 6, 4, 5, 9],
        "dcmag": [
            15,
            15.1,
            15.23,
            13,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16,
            16.4,
            16.7,
            16.28,
            17.68,
            16.32,
            17.99,
            16.32,
            15.52,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 3, 3, 4, 4, 1, 4],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 3.2, 3.1, 4.2, 4.1, 1.2, 4.1],
        "candid": [
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            36,
            39,
            41,
            44,
            34,
            40,
        ],
        "trajectory_id": [2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 7, 6, 7, 8, 8],
    }
)

track_and_obs_old_observations_expected2 = pd.DataFrame(
    {
        "ra": [1, 4, 6, 7, 6, 5],
        "dec": [1, 1, 1, 7, 3, 10],
        "dcmag": [15.52, 14.96, 16.03, 18.52, 14.96, 18.52],
        "fid": [2, 2, 2, 1, 2, 1],
        "nid": [2, 3, 3, 3, 4, 4],
        "jd": [2.1, 3.1, 3.1, 3.2, 4.1, 4.2],
        "candid": [33, 35, 37, 38, 42, 43],
    }
)

track_and_obs_trajectory_df_expected3 = pd.DataFrame(
    {
        "ra": [3, 9, 4, 10, 1, 2, 2, 3, 7, 8, 6, 1],
        "dec": [5, 5, 6, 4, 5, 9, 2, 3, 1, 2, 1, 1],
        "dcmag": [
            16.28,
            17.68,
            16.32,
            17.99,
            16.32,
            15.52,
            15.74,
            15.47,
            16.21,
            16.28,
            16.03,
            15.52,
        ],
        "fid": [2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 2],
        "nid": [3, 3, 4, 4, 1, 4, 4, 4, 4, 4, 3, 2],
        "jd": [3.2, 3.1, 4.2, 4.1, 1.2, 4.1, 4.1, 4.2, 4.1, 4.2, 3.1, 2.1],
        "candid": [36, 39, 41, 44, 34, 40, 27, 28, 31, 32, 37, 33],
        "trajectory_id": [6, 7, 6, 7, 8, 8, 11, 11, 13, 13, 13, 11],
    }
)

track_and_obs_trajectory_df_expected4 = pd.DataFrame(
    {
        "ra": [1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 2, 3, 7, 8],
        "dec": [12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 2, 3, 1, 2],
        "dcmag": [
            15,
            15.1,
            15.23,
            13,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16,
            16.4,
            16.7,
            15.74,
            15.47,
            16.21,
            16.28,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 4],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4.1, 4.2, 4.1, 4.2],
        "candid": [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 27, 28, 31, 32],
        "trajectory_id": [2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 11, 11, 13, 13],
    }
)

track_and_obs_old_observations_expected3 = pd.DataFrame(
    {
        "ra": [2, 4, 6, 5, 10],
        "dec": [9, 6, 3, 10, 4],
        "dcmag": [15.52, 16.32, 14.96, 18.52, 17.99],
        "fid": [2, 1, 2, 1, 2],
        "nid": [4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.1],
        "candid": [40, 41, 42, 43, 44],
    }
)

track_and_obs_trajectory_df_expected5 = pd.DataFrame(
    {
        "ra": [1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 2, 3, 7, 8, 6, 1],
        "dec": [12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 2, 3, 1, 2, 1, 1],
        "dcmag": [
            15,
            15.1,
            15.23,
            13,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16,
            16.4,
            16.7,
            15.74,
            15.47,
            16.21,
            16.28,
            16.03,
            15.52,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 4, 3, 2],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4.1, 4.2, 4.1, 4.2, 3.1, 2.1],
        "candid": [
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            27,
            28,
            31,
            32,
            37,
            33,
        ],
        "trajectory_id": [2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 11, 11, 13, 13, 13, 11],
    }
)

track_and_obs_old_observations_expected4 = pd.DataFrame(
    {
        "ra": [1, 4, 3, 7, 9],
        "dec": [5, 1, 5, 7, 5],
        "dcmag": [16.32, 14.96, 16.28, 18.52, 17.68],
        "fid": [1, 2, 2, 1, 1],
        "nid": [1, 3, 3, 3, 3],
        "jd": [1.2, 3.1, 3.2, 3.2, 3.1],
        "candid": [34, 35, 36, 38, 39],
    }
)

expected_traj_obs_report = {
    "list of updated trajectories": [6.0, 7.0, 8.0, 11.0, 13.0],
    "all nid report": [
        {
            "old nid": 3,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
    ],
}

expected_traj_obs_report2 = {
    "list of updated trajectories": [6.0, 7.0, 8.0],
    "all nid report": [
        {
            "old nid": 3,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
    ],
}


expected_traj_obs_report3 = {
    "list of updated trajectories": [6.0, 7.0, 8.0, 11.0, 13.0],
    "all nid report": [
        {
            "old nid": 3,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
    ],
}

expected_traj_obs_report4 = {
    "list of updated trajectories": [11.0, 13.0],
    "all nid report": [
        {
            "old nid": 3,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
            "old observation to new observation report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
    ],
}

# Night to night association testing

night_night_trajectory_sample = pd.DataFrame(
    {
        "ra": [1, 2, 3, 6, 7, 8, 11, 12, 13],
        "dec": [1, 2, 3, 1, 1, 2, 3, 4, 5],
        "dcmag": [12, 12.2, 12.4, 15, 15.4, 15.5, 13, 13.1, 13.2],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3],
        "jd": [1, 2, 3, 1, 2, 3, 1, 2, 3],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17, 18],
        "trajectory_id": [1, 1, 1, 2, 2, 2, 3, 3, 3],
    }
)

night_to_night_old_obs = pd.DataFrame(
    {
        "ra": [15, 7],
        "dec": [1, 7],
        "dcmag": [14, 16],
        "fid": [1, 2],
        "nid": [3, 2],
        "jd": [3, 2],
        "candid": [19, 29],
    }
)

night_to_night_new_obs = pd.DataFrame(
    {
        "ra": [4, 5, 1, 2, 12, 11, 16, 9, 17],
        "dec": [4, 5, 7, 8, 6, 7, 1, 3, 10],
        "dcmag": [12.5, 12.7, 17.2, 17.26, 13.32, 13.28, 14.12, 15.8, 15.21],
        "fid": [1, 1, 2, 2, 2, 2, 1, 1, 2],
        "nid": [4, 4, 4, 4, 4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.1, 4.2, 4.2, 4.1, 4.2],
        "candid": [20, 21, 22, 23, 24, 25, 26, 27, 28],
        "ssnamenr": [1, 1, 2, 2, 3, 3, 4, 5, 6],
    }
)


night_to_night_trajectory_df_expected = pd.DataFrame(
    {
        "ra": [1, 2, 3, 6, 7, 8, 11, 12, 13, 4, 5, 9, 15, 16, 1, 12, 2, 11],
        "dec": [1, 2, 3, 1, 1, 2, 3, 4, 5, 4, 5, 3, 1, 1, 7, 6, 8, 7],
        "dcmag": [
            12.00,
            12.20,
            12.40,
            15.00,
            15.40,
            15.50,
            13.00,
            13.10,
            13.20,
            12.50,
            12.70,
            15.80,
            14.00,
            14.12,
            17.20,
            13.32,
            17.26,
            13.28,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2, 2],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 3, 4, 4, 4, 4, 4],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.1,
            4.2,
            4.1,
            3.0,
            4.2,
            4.1,
            4.1,
            4.2,
            4.2,
        ],
        "candid": [
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            20,
            21,
            27,
            19,
            26,
            22,
            24,
            23,
            25,
        ],
        "trajectory_id": [1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 1, 2, 7, 7, 5, 6, 5, 6],
        "ssnamenr": [
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            np.nan,
            1,
            1,
            5,
            np.nan,
            4,
            2,
            3,
            2,
            3,
        ],
    }
)

night_to_night_old_observation_expected = pd.DataFrame(
    {
        "ra": [7, 17],
        "dec": [7, 10],
        "dcmag": [16.00, 15.21],
        "fid": [2, 2],
        "nid": [2, 4],
        "jd": [2.0, 4.2],
        "candid": [29, 28],
        "ssnamenr": [np.nan, 6.0],
    }
)


night_to_night_trajectory_df_expected2 = pd.DataFrame(
    {
        "ra": [15, 16, 4, 1, 12, 5, 2, 11],
        "dec": [1, 1, 4, 7, 6, 5, 8, 7],
        "dcmag": [14.00, 14.12, 12.50, 17.20, 13.32, 12.70, 17.26, 13.28],
        "fid": [1, 1, 1, 2, 2, 1, 2, 2],
        "nid": [3, 4, 4, 4, 4, 4, 4, 4],
        "jd": [3.0, 4.2, 4.1, 4.1, 4.1, 4.2, 4.2, 4.2],
        "candid": [19, 26, 20, 22, 24, 21, 23, 25],
        "trajectory_id": [7, 7, 4, 5, 6, 4, 5, 6],
        "ssnamenr": [np.nan, 4.0, 1, 2, 3, 1, 2, 3],
    }
)

night_to_night_old_observation_expected2 = pd.DataFrame(
    {
        "ra": [7, 9, 17],
        "dec": [7, 3, 10],
        "dcmag": [16.00, 15.80, 15.21],
        "fid": [2, 1, 2],
        "nid": [2, 4, 4],
        "jd": [2.0, 4.1, 4.2],
        "candid": [29, 27, 28],
        "ssnamenr": [np.nan, 5.0, 6.0],
    }
)


night_to_night_new_obs2 = pd.DataFrame(
    {
        "ra": [4, 5, 1, 2, 12, 11, 16, 9, 17],
        "dec": [4, 5, 7, 8, 6, 7, 1, 3, 10],
        "dcmag": [12.5, 17.7, 17.2, 13.26, 13.32, 18.28, 14.12, 15.8, 15.21],
        "fid": [1, 1, 2, 2, 2, 2, 1, 1, 2],
        "nid": [4, 4, 4, 4, 4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.1, 4.2, 4.2, 4.1, 4.2],
        "candid": [20, 21, 22, 23, 24, 25, 26, 27, 28],
    }
)


night_to_night_trajectory_df_expected3 = pd.DataFrame(
    {
        "ra": [
            1.0,
            2.0,
            3.0,
            6.0,
            7.0,
            8.0,
            11.0,
            12.0,
            13.0,
            4.0,
            9.0,
            15.0,
            16.0,
            7.0,
            5.0,
        ],
        "dec": [
            1.0,
            2.0,
            3.0,
            1.0,
            1.0,
            2.0,
            3.0,
            4.0,
            5.0,
            4.0,
            3.0,
            1.0,
            1.0,
            7.0,
            5.0,
        ],
        "dcmag": [
            12.00,
            12.20,
            12.40,
            15.00,
            15.40,
            15.50,
            13.00,
            13.10,
            13.20,
            12.50,
            15.80,
            14.00,
            14.12,
            16.00,
            17.70,
        ],
        "fid": [
            1.0,
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            2.0,
            2.0,
            1.0,
            1.0,
            1.0,
            1.0,
            2.0,
            1.0,
        ],
        "nid": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.0,
            4.0,
            3.0,
            4.0,
            2.0,
            4.0,
        ],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.1,
            4.1,
            3.0,
            4.2,
            2.0,
            4.2,
        ],
        "candid": [10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 27, 19, 26, 29, 21],
        "trajectory_id": [1, 1, 1, 2, 2, 2, 3, 3, 3, 1, 2, 4, 4, 5, 5],
    }
)

night_to_night_old_observation_expected3 = pd.DataFrame(
    {
        "ra": [1, 2, 12, 11, 17],
        "dec": [7, 8, 6, 7, 10],
        "dcmag": [17.20, 13.26, 13.32, 18.28, 15.21],
        "fid": [2, 2, 2, 2, 2],
        "nid": [4, 4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2, 4.2],
        "candid": [22, 23, 24, 25, 28],
    }
)

inter_night_report1 = {
    "nid of the next night": 4,
    "intra night report": {
        "number of separation association": 6,
        "number of association filtered by magnitude": 0,
        "association metrics": {
            "precision": 100.0,
            "recall": 100.0,
            "True Positif": 3,
            "False Positif": 0,
            "False Negatif": 0,
            "total real association": 3,
        },
        "number of intra night tracklets": 3,
    },
    "trajectory association report": {
        "list of updated trajectories": [1.0, 2.0],
        "all nid report": [
            {
                "old nid": 3,
                "trajectories_to_tracklets_report": {
                    "number of inter night separation based association": 2,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 1,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "trajectories_to_new_observation_report": {
                    "number of inter night separation based association": 1,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
            }
        ],
    },
    "tracklets and observation association report": {
        "list of updated trajectories": [5.0, 6.0, 7.0],
        "all nid report": [
            {
                "old nid": 3,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 1,
                    "number of inter night magnitude filtered association": 0,
                    "metrics": {},
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
            {
                "old nid": 2,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "metrics": {},
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
        ],
    },
}

inter_night_report2 = {
    "nid of the next night": 4,
    "intra night report": {
        "number of separation association": 6,
        "number of association filtered by magnitude": 0,
        "association metrics": {},
        "number of intra night tracklets": 3,
    },
    "trajectory association report": {
        "list of updated trajectories": [],
        "all nid report": [],
    },
    "tracklets and observation association report": {
        "list of updated trajectories": [4.0, 5.0, 6.0, 7.0],
        "all nid report": [
            {
                "old nid": 3,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 1,
                    "number of inter night magnitude filtered association": 0,
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
            {
                "old nid": 2,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
        ],
    },
}

inter_night_report3 = {
    "nid of the next night": 4,
    "intra night report": {
        "number of separation association": 6,
        "number of association filtered by magnitude": 6,
        "association metrics": {},
        "number of intra night tracklets": 0,
    },
    "trajectory association report": {
        "list of updated trajectories": [1.0, 2.0],
        "all nid report": [
            {
                "old nid": 3,
                "trajectories_to_tracklets_report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "trajectories_to_new_observation_report": {
                    "number of inter night separation based association": 3,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 1,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
            }
        ],
    },
    "tracklets and observation association report": {
        "list of updated trajectories": [4.0, 5.0],
        "all nid report": [
            {
                "old nid": 3,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 1,
                    "number of inter night magnitude filtered association": 0,
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
            {
                "old nid": 2,
                "old observation to tracklets report": {
                    "number of inter night separation based association": 0,
                    "number of inter night magnitude filtered association": 0,
                    "number of inter night angle filtered association": 0,
                    "number of duplicated association": 0,
                    "metrics": {},
                },
                "old observation to new observation report": {
                    "number of inter night separation based association": 1,
                    "number of inter night magnitude filtered association": 0,
                    "number of duplicated association": 0,
                    "number of inter night angle filtered association": 0,
                },
            },
        ],
    },
}


# Trajectory and tracklets association test

trajectories_sample_1 = pd.DataFrame(
    {
        "ra": [1, 2, 3, 5, 6, 6, 1, 2, 3, 7, 8, 8, 9, 10, 11, 11],
        "dec": [1, 2, 3, 1, 1, 2, 7, 7, 7, 4, 5, 6, 1, 1, 1, 2],
        "dcmag": [
            12,
            12.02,
            12.04,
            13,
            13.02,
            13.04,
            14,
            14.02,
            14.04,
            15.04,
            15.06,
            15.07,
            16.02,
            16.04,
            16.06,
            16.07,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2],
        "jd": [
            0.1,
            0.2,
            0.3,
            1.1,
            1.2,
            1.3,
            2.1,
            2.2,
            2.3,
            1.1,
            1.2,
            1.3,
            1.1,
            1.2,
            1.3,
            2.1,
        ],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
        "trajectory_id": [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4],
    }
)

tracklets_sample_1 = pd.DataFrame(
    {
        "ra": [4, 5, 8, 8, 11, 11, 11, 7, 8],
        "dec": [4, 5, 7, 8, 3, 4, 5, 3, 3],
        "dcmag": [12.06, 12.07, 15.08, 15.09, 16.08, 16.09, 16.11, 17.01, 17.02],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.1, 3.2, 3.1, 3.2, 3.1, 3.2, 3.3, 3.4, 3.5],
        "candid": [16, 17, 18, 19, 20, 21, 22, 23, 24],
        "trajectory_id": [10, 10, 11, 11, 12, 12, 12, 13, 13],
    }
)

# - test with duplicates

trajectories_sample_2 = pd.DataFrame(
    {
        "ra": [2, 3, 4, 10, 11, 12, 10, 11, 12, 3, 4, 5, 3, 4, 5],
        "dec": [3, 3, 3, 6, 6, 6, 2, 2, 2, 8, 8, 8, 10, 10, 10],
        "dcmag": [
            12,
            12.02,
            12.04,
            13.05,
            13.06,
            13.07,
            14.01,
            14.02,
            14.03,
            15.03,
            15.03,
            15.03,
            15.03,
            15.03,
            15.03,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
        "jd": [
            0.1,
            0.2,
            0.3,
            0.3,
            0.4,
            0.5,
            0.1,
            0.2,
            0.3,
            0.3,
            0.4,
            0.5,
            0.1,
            0.2,
            0.3,
        ],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],
        "trajectory_id": [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4],
    }
)

tracklets_sample_2 = pd.DataFrame(
    {
        "ra": [5, 6, 5, 6, 13, 14, 13, 14, 13, 14, 5, 6, 6, 7],
        "dec": [4, 4, 2, 2, 7, 7, 5, 5, 2, 2, 3, 3, 9, 9],
        "dcmag": [
            12.06,
            12.07,
            12.06,
            12.07,
            13.08,
            13.09,
            13.03,
            13.04,
            14.03,
            14.04,
            12.06,
            12.07,
            15.03,
            15.03,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.1, 3.2, 3.1, 3.2, 3.1, 3.2, 3.1, 3.2, 3.1, 3.2, 3.1, 3.2, 3.1, 3.2],
        "candid": [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
        "trajectory_id": [10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16],
    }
)

# - expected outputs

trajectories_expected_1 = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 2, 6, 7, 8, 6, 7, 8, 9, 10, 10, 4, 5, 8, 7],
        "dec": [1, 2, 3, 12, 11, 10, 12, 12, 12, 6, 5, 6, 1, 2, 3, 4, 5, 7, 8],
        "dcmag": [
            12.02,
            12.05,
            12.3,
            15.0,
            15.1,
            15.23,
            13.0,
            12.6,
            12.75,
            17.02,
            17.15,
            17.27,
            16.0,
            16.4,
            16.7,
            12.4,
            12.52,
            17.31,
            17.43,
        ],
        "fid": [1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1],
        "nid": [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 4, 4, 4],
        "jd": [
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            1.0,
            2.0,
            3.0,
            4.1,
            4.2,
            4.1,
            4.2,
        ],
        "candid": [
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            21,
            22,
            23,
            24,
            25,
            26,
            29,
            30,
        ],
        "trajectory_id": [
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            3.0,
            3.0,
            3.0,
            4.0,
            4.0,
            4.0,
            5.0,
            5.0,
            5.0,
            1.0,
            1.0,
            4.0,
            4.0,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            True,
            True,
            True,
            True,
            True,
            True,
            False,
            False,
            False,
            True,
            True,
            True,
            False,
            False,
            False,
            False,
        ],
    }
)

tracklets_expected_1 = pd.DataFrame(
    {
        "ra": [1, 1, 13, 13],
        "dec": [9, 8, 1, 2],
        "dcmag": [15.94, 15.47, 16.21, 16.28],
        "fid": [2, 1, 2, 2],
        "nid": [4, 4, 4, 4],
        "jd": [4.1, 4.2, 4.1, 4.2],
        "candid": [27, 28, 31, 32],
        "trajectory_id": [11, 11, 13, 13],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

trajectories_expected_2 = pd.DataFrame(
    {
        "ra": [
            1,
            2,
            3,
            5,
            6,
            6,
            1,
            2,
            3,
            7,
            8,
            8,
            9,
            10,
            11,
            11,
            11,
            11,
            11,
            8,
            8,
            4,
            5,
        ],
        "dec": [1, 2, 3, 1, 1, 2, 7, 7, 7, 4, 5, 6, 1, 1, 1, 2, 3, 4, 5, 7, 8, 4, 5],
        "dcmag": [
            12.0,
            12.02,
            12.04,
            13.0,
            13.02,
            13.04,
            14.0,
            14.02,
            14.04,
            15.04,
            15.06,
            15.07,
            16.02,
            16.04,
            16.06,
            16.07,
            16.08,
            16.09,
            16.11,
            15.08,
            15.09,
            12.06,
            12.07,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 0, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3],
        "jd": [
            0.1,
            0.2,
            0.3,
            1.1,
            1.2,
            1.3,
            2.1,
            2.2,
            2.3,
            1.1,
            1.2,
            1.3,
            1.1,
            1.2,
            1.3,
            2.1,
            3.1,
            3.2,
            3.3,
            3.1,
            3.2,
            3.1,
            3.2,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            20,
            21,
            22,
            18,
            19,
            16,
            17,
        ],
        "trajectory_id": [
            0.0,
            0.0,
            0.0,
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            3.0,
            3.0,
            3.0,
            4.0,
            4.0,
            4.0,
            4.0,
            4.0,
            4.0,
            4.0,
            3.0,
            3.0,
            0.0,
            0.0,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            True,
            True,
            True,
            True,
            True,
            True,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

tracklets_expected_2 = pd.DataFrame(
    {
        "ra": [7, 8],
        "dec": [3, 3],
        "dcmag": [17.01, 17.02],
        "fid": [1, 1],
        "nid": [3, 3],
        "jd": [3.4, 3.5],
        "candid": [23, 24],
        "trajectory_id": [13, 13],
        "provisional designation": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
    }
)

traj_and_track_assoc_report_expected = {
    "updated trajectories": [0.0, 3.0, 4.0],
    "all nid_report": [
        {
            "old nid": 2,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
    ],
}

trajectories_expected_3 = pd.DataFrame(
    {
        "ra": [
            2,
            3,
            4,
            10,
            11,
            12,
            10,
            11,
            12,
            3,
            4,
            5,
            3,
            4,
            5,
            2,
            3,
            4,
            2,
            3,
            4,
            10,
            11,
            12,
            5,
            6,
            5,
            6,
            13,
            14,
            5,
            6,
            13,
            14,
            13,
            14,
            6,
            7,
            6,
            7,
        ],
        "dec": [
            3,
            3,
            3,
            6,
            6,
            6,
            2,
            2,
            2,
            8,
            8,
            8,
            10,
            10,
            10,
            3,
            3,
            3,
            3,
            3,
            3,
            6,
            6,
            6,
            4,
            4,
            2,
            2,
            7,
            7,
            3,
            3,
            5,
            5,
            2,
            2,
            9,
            9,
            9,
            9,
        ],
        "dcmag": [
            12.0,
            12.02,
            12.04,
            13.05,
            13.06,
            13.07,
            14.01,
            14.02,
            14.03,
            15.03,
            15.03,
            15.03,
            15.03,
            15.03,
            15.03,
            12.0,
            12.02,
            12.04,
            12.0,
            12.02,
            12.04,
            13.05,
            13.06,
            13.07,
            12.06,
            12.07,
            12.06,
            12.07,
            13.08,
            13.09,
            12.06,
            12.07,
            13.03,
            13.04,
            14.03,
            14.04,
            15.03,
            15.03,
            15.03,
            15.03,
        ],
        "fid": [
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
        ],
        "nid": [
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            0,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
            3,
        ],
        "jd": [
            0.1,
            0.2,
            0.3,
            0.3,
            0.4,
            0.5,
            0.1,
            0.2,
            0.3,
            0.3,
            0.4,
            0.5,
            0.1,
            0.2,
            0.3,
            0.1,
            0.2,
            0.3,
            0.1,
            0.2,
            0.3,
            0.3,
            0.4,
            0.5,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
            3.1,
            3.2,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            0,
            1,
            2,
            0,
            1,
            2,
            3,
            4,
            5,
            16,
            17,
            18,
            19,
            20,
            21,
            26,
            27,
            22,
            23,
            24,
            25,
            28,
            29,
            28,
            29,
        ],
        "trajectory_id": [
            0.0,
            0.0,
            0.0,
            1.0,
            1.0,
            1.0,
            2.0,
            2.0,
            2.0,
            3.0,
            3.0,
            3.0,
            4.0,
            4.0,
            4.0,
            5.0,
            5.0,
            5.0,
            6.0,
            6.0,
            6.0,
            7.0,
            7.0,
            7.0,
            5.0,
            5.0,
            6.0,
            6.0,
            7.0,
            7.0,
            0.0,
            0.0,
            1.0,
            1.0,
            2.0,
            2.0,
            3.0,
            3.0,
            4.0,
            4.0,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)


# Trajectories and new observations associations

trajectories_sample_3 = pd.DataFrame(
    {
        "ra": [1, 2, 3, 1, 2, 3, 7, 8, 9, 11, 12, 13, 15, 15, 15, 16, 17, 17],
        "dec": [1, 1, 1, 7, 7, 7, 3, 4, 5, 9, 9, 9, 2, 3, 4, 8, 8, 7],
        "dcmag": [
            11,
            11.01,
            11.02,
            12.01,
            12.01,
            12.02,
            13,
            13.02,
            13.03,
            14,
            14.02,
            14.03,
            15.01,
            15.01,
            15.02,
            16.04,
            16.05,
            16.06,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 1, 0, 1, 1, 0, 1, 2, 0, 2, 2, 0, 0, 0, 0, 1, 1],
        "jd": [
            0.1,
            0.2,
            1.3,
            0.1,
            1.1,
            1.2,
            0.1,
            1.1,
            2.3,
            0.0,
            2.2,
            2.4,
            0.0,
            0.1,
            0.2,
            0.1,
            1.1,
            1.2,
        ],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17],
        "trajectory_id": [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5],
    }
)

new_observations_sample_1 = pd.DataFrame(
    {
        "ra": [4, 1, 3, 6, 6, 10, 15, 17],
        "dec": [1, 5, 4, 2, 8, 6, 5, 6],
        "dcmag": [11.03, 14.52, 17.84, 14.12, 16.25, 13.04, 15.03, 16.07],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.1, 3.1, 3.2, 3.3, 3.4, 3.4, 3.4, 3.5],
        "candid": [18, 16, 20, 21, 22, 23, 24, 25],
    }
)

# - test with duplicates

trajectories_sample_4 = pd.DataFrame(
    {
        "ra": [2, 3, 4, 10, 11, 11, 17, 18, 19, 2, 3, 4],
        "dec": [2, 2, 2, 6, 6, 5, 5, 4, 3, 7, 7, 7],
        "dcmag": [
            11,
            11.01,
            11.02,
            12.01,
            12.01,
            12.02,
            13,
            13.02,
            13.03,
            14,
            14.02,
            14.03,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 1, 1, 0, 0, 0, 0, 1, 2, 0, 2, 2],
        "jd": [0.1, 1.2, 1.3, 0.1, 0.1, 0.2, 0.1, 1.1, 2.3, 0.0, 2.2, 2.4],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
        "trajectory_id": [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3],
    }
)

new_observations_sample_2 = pd.DataFrame(
    {
        "ra": [5, 5, 5, 6, 10, 12, 11, 12, 15, 18, 19, 20],
        "dec": [1, 2, 3, 5, 4, 4, 3, 1, 7, 3, 2, 2],
        "dcmag": [
            11.03,
            11.04,
            11.02,
            14.12,
            12.05,
            12.04,
            15.03,
            16.07,
            15.21,
            13.04,
            13.05,
            13.06,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.1, 3.1, 3.2, 3.3, 3.4, 3.4, 3.4, 3.5, 3.5, 3.4, 3.2, 3.1],
        "candid": [18, 16, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
    }
)

trajectories_sample_5 = pd.DataFrame(
    {
        "ra": [
            3,
            4,
            5,
            3,
            4,
            5,
            8,
            8,
            8,
            11,
            11,
            11,
            13,
            13,
            13,
            17,
            18,
            19,
            17,
            18,
            19,
        ],
        "dec": [3, 3, 3, 5, 5, 5, 1, 2, 3, 2, 3, 4, 2, 3, 4, 3, 3, 3, 5, 5, 5],
        "dcmag": [
            11,
            11.01,
            11.02,
            11,
            11.01,
            11.02,
            15.23,
            15.24,
            15.25,
            12.01,
            12.01,
            12.02,
            12.01,
            12.01,
            12.02,
            13,
            13.02,
            13.03,
            13,
            13.02,
            13.03,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 1, 0, 1, 1, 0, 2, 2, 0, 1, 2, 0, 0, 1, 0, 1, 2, 0, 2, 2],
        "jd": [
            0.1,
            0.2,
            1.3,
            0.1,
            1.1,
            1.2,
            0.1,
            2.1,
            2.3,
            0.0,
            1.2,
            2.4,
            0.1,
            0.2,
            1.3,
            0.2,
            1.1,
            2.3,
            0.1,
            2.4,
            2.5,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
        ],
        "trajectory_id": [
            0,
            0,
            0,
            1,
            1,
            1,
            2,
            2,
            2,
            3,
            3,
            3,
            4,
            4,
            4,
            5,
            5,
            5,
            6,
            6,
            6,
        ],
    }
)

new_observations_sample_3 = pd.DataFrame(
    {
        "ra": [6, 8, 12, 20, 4],
        "dec": [4, 4, 5, 4, 7],
        "dcmag": [11.03, 15.29, 12.02, 13.12, 17.85],
        "fid": [1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3],
        "jd": [3.1, 3.1, 3.2, 3.3, 3.5],
        "candid": [21, 22, 23, 24, 25],
    }
)

# - expected outputs

trajectories_expected_4 = pd.DataFrame(
    {
        "ra": [
            1,
            2,
            3,
            1,
            2,
            3,
            7,
            8,
            9,
            11,
            12,
            13,
            15,
            15,
            15,
            16,
            17,
            17,
            10,
            4,
            17,
            15,
        ],
        "dec": [1, 1, 1, 7, 7, 7, 3, 4, 5, 9, 9, 9, 2, 3, 4, 8, 8, 7, 6, 1, 6, 5],
        "dcmag": [
            11.0,
            11.01,
            11.02,
            12.01,
            12.01,
            12.02,
            13.0,
            13.02,
            13.03,
            14.0,
            14.02,
            14.03,
            15.01,
            15.01,
            15.02,
            16.04,
            16.05,
            16.06,
            13.04,
            11.03,
            16.07,
            15.03,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 1, 0, 1, 1, 0, 1, 2, 0, 2, 2, 0, 0, 0, 0, 1, 1, 3, 3, 3, 3],
        "jd": [
            0.1,
            0.2,
            1.3,
            0.1,
            1.1,
            1.2,
            0.1,
            1.1,
            2.3,
            0.0,
            2.2,
            2.4,
            0.0,
            0.1,
            0.2,
            0.1,
            1.1,
            1.2,
            3.4,
            3.1,
            3.5,
            3.4,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            23,
            18,
            25,
            24,
        ],
        "trajectory_id": [
            0,
            0,
            0,
            1,
            1,
            1,
            2,
            2,
            2,
            3,
            3,
            3,
            4,
            4,
            4,
            5,
            5,
            5,
            2,
            0,
            5,
            4,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            True,
            True,
            True,
            False,
            False,
            False,
            True,
            True,
            True,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

new_observations_expected_1 = pd.DataFrame(
    {
        "ra": [1, 3, 6, 6],
        "dec": [5, 4, 2, 8],
        "dcmag": [14.52, 17.84, 14.12, 16.25],
        "fid": [1, 1, 1, 1],
        "nid": [3, 3, 3, 3],
        "jd": [3.1, 3.2, 3.3, 3.4],
        "candid": [16, 20, 21, 22],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

expected_traj_obs_report_1 = {
    "traj to obs report": [
        {
            "old nid": 2,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 5,
                "number of inter night magnitude filtered association": 3,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
    ],
    "updated trajectories": [0.0, 2.0, 4.0, 5.0],
}


trajectories_expected_5 = pd.DataFrame(
    {
        "ra": [
            2,
            3,
            4,
            10,
            11,
            11,
            17,
            18,
            19,
            2,
            3,
            4,
            17,
            18,
            19,
            20,
            19,
            2,
            3,
            4,
            2,
            3,
            4,
            5,
            5,
            5,
            10,
            11,
            11,
            12,
            10,
        ],
        "dec": [
            2,
            2,
            2,
            6,
            6,
            5,
            5,
            4,
            3,
            7,
            7,
            7,
            5,
            4,
            3,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            3,
            1,
            6,
            6,
            5,
            4,
            4,
        ],
        "dcmag": [
            11.0,
            11.01,
            11.02,
            12.01,
            12.01,
            12.02,
            13.0,
            13.02,
            13.03,
            14.0,
            14.02,
            14.03,
            13.0,
            13.02,
            13.03,
            13.06,
            13.05,
            11.0,
            11.01,
            11.02,
            11.0,
            11.01,
            11.02,
            11.04,
            11.02,
            11.03,
            12.01,
            12.01,
            12.02,
            12.04,
            12.05,
        ],
        "fid": [
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
        ],
        "nid": [
            0,
            1,
            1,
            0,
            0,
            0,
            0,
            1,
            2,
            0,
            2,
            2,
            0,
            1,
            2,
            3,
            3,
            0,
            1,
            1,
            0,
            1,
            1,
            3,
            3,
            3,
            0,
            0,
            0,
            3,
            3,
        ],
        "jd": [
            0.1,
            1.2,
            1.3,
            0.1,
            0.1,
            0.2,
            0.1,
            1.1,
            2.3,
            0.0,
            2.2,
            2.4,
            0.1,
            1.1,
            2.3,
            3.1,
            3.2,
            0.1,
            1.2,
            1.3,
            0.1,
            1.2,
            1.3,
            3.1,
            3.2,
            3.1,
            0.1,
            0.1,
            0.2,
            3.4,
            3.4,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            6,
            7,
            8,
            29,
            28,
            0,
            1,
            2,
            0,
            1,
            2,
            16,
            20,
            18,
            3,
            4,
            5,
            23,
            22,
        ],
        "trajectory_id": [
            0,
            0,
            0,
            1,
            1,
            1,
            2,
            2,
            2,
            3,
            3,
            3,
            4,
            4,
            4,
            4,
            2,
            5,
            5,
            5,
            6,
            6,
            6,
            5,
            6,
            0,
            7,
            7,
            7,
            7,
            1,
        ],
        "ref_epoch": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            True,
            True,
            True,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

new_observations_expected_2 = pd.DataFrame(
    {
        "ra": [6, 11, 12, 15, 18],
        "dec": [5, 3, 1, 7, 3],
        "dcmag": [14.12, 15.03, 16.07, 15.21, 13.04],
        "fid": [1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3],
        "jd": [3.3, 3.4, 3.5, 3.5, 3.4],
        "candid": [21, 24, 25, 26, 27],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
    }
)

expected_traj_obs_report_2 = {
    "traj to obs report": [
        {
            "old nid": 2,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 1,
                "number of duplicated association": 1,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 2,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 5,
                "number of inter night magnitude filtered association": 3,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 1,
                "metrics": {},
            },
        },
    ],
    "updated trajectories": [0, 1, 2, 4, 5, 6, 7],
}


trajectories_expected_6 = pd.DataFrame(
    {
        "ra": [
            3,
            4,
            5,
            3,
            4,
            5,
            8,
            8,
            8,
            11,
            11,
            11,
            13,
            13,
            13,
            17,
            18,
            19,
            17,
            18,
            19,
            8,
            12,
            20,
            20,
            6,
            6,
        ],
        "dec": [
            3,
            3,
            3,
            5,
            5,
            5,
            1,
            2,
            3,
            2,
            3,
            4,
            2,
            3,
            4,
            3,
            3,
            3,
            5,
            5,
            5,
            4,
            5,
            4,
            4,
            4,
            4,
        ],
        "dcmag": [
            11.0,
            11.01,
            11.02,
            11.0,
            11.01,
            11.02,
            15.23,
            15.24,
            15.25,
            12.01,
            12.01,
            12.02,
            12.01,
            12.01,
            12.02,
            13.0,
            13.02,
            13.03,
            13.0,
            13.02,
            13.03,
            15.29,
            12.02,
            13.12,
            13.12,
            11.03,
            11.03,
        ],
        "fid": [
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
            1,
        ],
        "nid": [
            0,
            0,
            1,
            0,
            1,
            1,
            0,
            2,
            2,
            0,
            1,
            2,
            0,
            0,
            1,
            0,
            1,
            2,
            0,
            2,
            2,
            3,
            3,
            3,
            3,
            3,
            3,
        ],
        "jd": [
            0.1,
            0.2,
            1.3,
            0.1,
            1.1,
            1.2,
            0.1,
            2.1,
            2.3,
            0.0,
            1.2,
            2.4,
            0.1,
            0.2,
            1.3,
            0.2,
            1.1,
            2.3,
            0.1,
            2.4,
            2.5,
            3.1,
            3.2,
            3.3,
            3.3,
            3.1,
            3.1,
        ],
        "candid": [
            0,
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12,
            13,
            14,
            15,
            16,
            17,
            18,
            19,
            20,
            22,
            23,
            24,
            24,
            21,
            21,
        ],
        "trajectory_id": [
            0,
            0,
            0,
            1,
            1,
            1,
            2,
            2,
            2,
            3,
            3,
            3,
            4,
            4,
            4,
            5,
            5,
            5,
            6,
            6,
            6,
            2,
            3,
            5,
            6,
            0,
            1,
        ],
        "ref_epoch": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            True,
            True,
            True,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

new_observations_expected_3 = pd.DataFrame(
    {
        "ra": [4],
        "dec": [7],
        "dcmag": [17.85],
        "fid": [1],
        "nid": [3],
        "jd": [3.5],
        "candid": [25],
        "ref_epoch": [-1.0],
        "provisional designation": [-1.0],
        "a": [-1.0],
        "e": [-1.0],
        "i": [-1.0],
        "long. node": [-1.0],
        "arg. peric": [-1.0],
        "mean anomaly": [-1.0],
        "rms_a": [-1.0],
        "rms_e": [-1.0],
        "rms_i": [-1.0],
        "rms_long. node": [-1.0],
        "rms_arg. peric": [-1.0],
        "rms_mean anomaly": [-1.0],
    }
)

expected_traj_obs_report_3 = {
    "traj to obs report": [
        {
            "old nid": 2,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 4,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "trajectories_to_new_observation_report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
    ],
    "updated trajectories": [0.0, 1.0, 2.0, 3.0, 5.0, 6.0],
}


# Tracklets and old observations associations


tracklets_sample_3 = pd.DataFrame(
    {
        "ra": [2, 3, 4, 5, 7, 8, 10, 11, 11, 12, 5, 6],
        "dec": [2, 3, 6, 6, 7, 7, 5, 6, 3, 3, 1, 2],
        "dcmag": [
            11,
            11.01,
            12.02,
            12.03,
            13.0,
            13.02,
            14.05,
            14.6,
            15.01,
            15.03,
            16.04,
            16.06,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.0, 3.1, 3.0, 3.1, 3.0, 3.1, 3.0, 3.1, 3.0, 3.1, 3.0, 3.1],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5],
    }
)

old_observations_sample_1 = pd.DataFrame(
    {
        "ra": [1, 1, 3, 7, 9, 10],
        "dec": [1, 4, 6, 3, 4, 3],
        "dcmag": [11.01, 17.23, 12.02, 16.21, 14.04, 15.02],
        "fid": [1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 1, 1, 2, 2],
        "jd": [0.1, 0.2, 1.2, 1.5, 2.4, 2.7],
        "candid": [12, 13, 14, 15, 16, 17],
    }
)

# - with duplicates

tracklets_sample_4 = pd.DataFrame(
    {
        "ra": [4, 5, 4, 5, 6, 7, 11, 11, 13, 13],
        "dec": [2, 2, 4, 4, 8, 8, 4, 3, 4, 3],
        "dcmag": [10.01, 10.2, 10.04, 10.05, 12.03, 12.06, 14.01, 14.05, 14.02, 14.06],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3],
        "jd": [3.0, 3.1, 3.0, 3.1, 3.0, 3.1, 3.0, 3.1, 3.0, 3.1],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4],
    }
)

old_observations_sample_2 = pd.DataFrame(
    {
        "ra": [3, 3, 2, 8, 12],
        "dec": [3, 5, 7, 4, 5],
        "dcmag": [10.0, 10.03, 15.42, 18.01, 14.02],
        "fid": [1, 1, 1, 1, 1],
        "nid": [0, 0, 1, 2, 1],
        "jd": [0.0, 0.2, 1.1, 2.3, 1.5],
        "candid": [10, 11, 12, 13, 14],
    }
)

tracklets_sample_5 = pd.DataFrame(
    {
        "ra": [3, 4, 12, 12, 5, 6],
        "dec": [2, 2, 4, 3, 6, 5],
        "dcmag": [10.01, 10.03, 11.02, 11.04, 14.06, 14.08],
        "fid": [1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3],
        "jd": [3.0, 3.1, 3.0, 3.1, 3.0, 3.1],
        "candid": [0, 1, 2, 3, 4, 5],
        "trajectory_id": [0, 0, 1, 1, 2, 2],
    }
)

old_observations_sample_3 = pd.DataFrame(
    {
        "ra": [2, 2, 4, 5, 11, 13],
        "dec": [1, 3, 6, 7, 5, 5],
        "dcmag": [10.04, 10.06, 14.04, 14.06, 11.06, 11.02],
        "fid": [1, 1, 1, 1, 1, 1],
        "nid": [0, 0, 0, 2, 1, 1],
        "jd": [0.0, 0.1, 0.3, 2.1, 1.2, 1.3],
        "candid": [6, 7, 8, 9, 10, 11],
    }
)

# - expected outputs

tracklets_obs_expected_1 = pd.DataFrame(
    {
        "ra": [2, 3, 4, 5, 7, 8, 10, 11, 11, 12, 5, 6, 9, 10, 3, 1],
        "dec": [2, 3, 6, 6, 7, 7, 5, 6, 3, 3, 1, 2, 4, 3, 6, 1],
        "dcmag": [
            11.0,
            11.01,
            12.02,
            12.03,
            13.0,
            13.02,
            14.05,
            14.6,
            15.01,
            15.03,
            16.04,
            16.06,
            14.04,
            15.02,
            12.02,
            11.01,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 1, 0],
        "jd": [
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            2.4,
            2.7,
            1.2,
            0.1,
        ],
        "candid": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 14, 12],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 3, 4, 1, 0],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            True,
            True,
            False,
            False,
            False,
            False,
            True,
            True,
            False,
            False,
            False,
            False,
        ],
    }
)

old_obs_expected_1 = pd.DataFrame(
    {
        "ra": [1, 7],
        "dec": [4, 3],
        "dcmag": [17.23, 16.21],
        "fid": [1, 1],
        "nid": [0, 1],
        "jd": [0.2, 1.5],
        "candid": [13, 15],
        "provisional designation": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
    }
)

track_and_obs_report_expected_1 = {
    "track and obs report": [
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 1,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "old observation to tracklets report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 2,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
    ],
    "updated tracklets": [0.0, 1.0, 3.0, 4.0],
}

tracklets_obs_expected_2 = pd.DataFrame(
    {
        "ra": [
            4.0,
            5.0,
            4.0,
            5.0,
            6.0,
            7.0,
            11.0,
            11.0,
            13.0,
            13.0,
            12.0,
            12.0,
            4.0,
            5.0,
            3.0,
            3.0,
            3.0,
        ],
        "dec": [
            2.0,
            2.0,
            4.0,
            4.0,
            8.0,
            8.0,
            4.0,
            3.0,
            4.0,
            3.0,
            5.0,
            5.0,
            4.0,
            4.0,
            5.0,
            3.0,
            3.0,
        ],
        "dcmag": [
            10.01,
            10.2,
            10.04,
            10.05,
            12.03,
            12.06,
            14.01,
            14.05,
            14.02,
            14.06,
            14.02,
            14.02,
            10.04,
            10.05,
            10.03,
            10.0,
            10.0,
        ],
        "fid": [
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
        ],
        "nid": [
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            1.0,
            1.0,
            3.0,
            3.0,
            0.0,
            0.0,
            0.0,
        ],
        "jd": [
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            1.5,
            1.5,
            3.0,
            3.1,
            0.2,
            0.0,
            0.0,
        ],
        "candid": [
            0.0,
            1.0,
            2.0,
            3.0,
            4.0,
            5.0,
            6.0,
            7.0,
            8.0,
            9.0,
            14.0,
            14.0,
            2.0,
            3.0,
            11.0,
            10.0,
            10.0,
        ],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 3, 4, 5, 5, 5, 0, 1],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            True,
            True,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

old_obs_expected_2 = pd.DataFrame(
    {
        "ra": [2, 8],
        "dec": [7, 4],
        "dcmag": [15.42, 18.01],
        "fid": [1, 1],
        "nid": [1, 2],
        "jd": [1.1, 2.3],
        "candid": [12, 13],
        "provisional designation": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
    }
)

track_and_obs_report_expected_2 = {
    "track and obs report": [
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 0,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "old observation to tracklets report": {
                "number of inter night separation based association": 5,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 1,
                "number of duplicated association": 1,
                "metrics": {},
            },
        },
    ],
    "updated tracklets": [0.0, 1.0, 3.0, 4.0, 5.0],
}


tracklets_obs_expected_3 = pd.DataFrame(
    {
        "ra": [
            3.0,
            4.0,
            12.0,
            12.0,
            5.0,
            6.0,
            5.0,
            12.0,
            12.0,
            13.0,
            11.0,
            3.0,
            4.0,
            2.0,
            2.0,
        ],
        "dec": [
            2.0,
            2.0,
            4.0,
            3.0,
            6.0,
            5.0,
            7.0,
            4.0,
            3.0,
            5.0,
            5.0,
            2.0,
            2.0,
            3.0,
            1.0,
        ],
        "dcmag": [
            10.01,
            10.03,
            11.02,
            11.04,
            14.06,
            14.08,
            14.06,
            11.02,
            11.04,
            11.02,
            11.06,
            10.01,
            10.03,
            10.06,
            10.04,
        ],
        "fid": [
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
        ],
        "nid": [
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            3.0,
            2.0,
            3.0,
            3.0,
            1.0,
            1.0,
            3.0,
            3.0,
            0.0,
            0.0,
        ],
        "jd": [
            3.0,
            3.1,
            3.0,
            3.1,
            3.0,
            3.1,
            2.1,
            3.0,
            3.1,
            1.3,
            1.2,
            3.0,
            3.1,
            0.1,
            0.0,
        ],
        "candid": [
            0.0,
            1.0,
            2.0,
            3.0,
            4.0,
            5.0,
            9.0,
            2.0,
            3.0,
            11.0,
            10.0,
            0.0,
            1.0,
            7.0,
            6.0,
        ],
        "trajectory_id": [0, 0, 1, 1, 2, 2, 2, 3, 3, 3, 1, 4, 4, 4, 0],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
        ],
    }
)

old_obs_expected_3 = pd.DataFrame(
    {
        "ra": [4],
        "dec": [6],
        "dcmag": [14.04],
        "fid": [1],
        "nid": [0],
        "jd": [0.3],
        "candid": [8],
        "provisional designation": [-1.0],
        "a": [-1.0],
        "e": [-1.0],
        "i": [-1.0],
        "long. node": [-1.0],
        "arg. peric": [-1.0],
        "mean anomaly": [-1.0],
        "rms_a": [-1.0],
        "rms_e": [-1.0],
        "rms_i": [-1.0],
        "rms_long. node": [-1.0],
        "rms_arg. peric": [-1.0],
        "rms_mean anomaly": [-1.0],
    }
)

track_and_obs_report_expected_3 = {
    "track and obs report": [
        {
            "old nid": 2,
            "old observation to tracklets report": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {},
            },
        },
        {
            "old nid": 1,
            "old observation to tracklets report": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 1,
                "metrics": {},
            },
        },
        {
            "old nid": 0,
            "old observation to tracklets report": {
                "number of inter night separation based association": 3,
                "number of inter night magnitude filtered association": 1,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 1,
                "metrics": {},
            },
        },
    ],
    "updated tracklets": [0.0, 1.0, 2.0, 3.0, 4.0],
}


# old observations with new observations associations test

old_observations_sample_4 = pd.DataFrame(
    {
        "ra": [1, 5, 2, 8, 11, 15],
        "dec": [1, 5, 9, 10, 5, 2],
        "dcmag": [11.01, 15.23, 12.02, 16.21, 14.04, 15.02],
        "fid": [1, 1, 1, 1, 1, 1],
        "nid": [2, 2, 1, 2, 0, 1],
        "jd": [2.1, 2.2, 1.2, 2.5, 0.4, 1.7],
        "candid": [0, 1, 2, 3, 4, 5],
    }
)

new_observation_sample_4 = pd.DataFrame(
    {
        "ra": [2, 3, 6, 7, 13, 17],
        "dec": [2, 8, 5, 2, 8, 6],
        "dcmag": [11.01, 12.08, 15.22, 16.21, 14.04, 15.02],
        "fid": [1, 1, 1, 1, 1, 1],
        "nid": [3, 3, 3, 3, 3, 3],
        "jd": [3.1, 3.2, 3.2, 3.5, 3.4, 3.7],
        "candid": [6, 7, 8, 9, 10, 11],
    }
)

# - expected outputs

new_trajectory = pd.DataFrame(
    {
        "ra": [1, 5, 2, 6, 2, 3, 11, 13],
        "dec": [1, 5, 2, 5, 9, 8, 5, 8],
        "dcmag": [11.01, 15.23, 11.01, 15.22, 12.02, 12.08, 14.04, 14.04],
        "fid": [1, 1, 1, 1, 1, 1, 1, 1],
        "nid": [2, 2, 3, 3, 1, 3, 0, 3],
        "jd": [2.1, 2.2, 3.1, 3.2, 1.2, 3.2, 0.4, 3.4],
        "candid": [0, 1, 6, 8, 2, 7, 4, 10],
        "trajectory_id": [0, 1, 0, 1, 2, 2, 3, 3],
    }
)

remaining_old_obs = pd.DataFrame(
    {
        "ra": [8, 15],
        "dec": [10, 2],
        "dcmag": [16.21, 15.02],
        "fid": [1, 1],
        "nid": [2, 1],
        "jd": [2.5, 1.7],
        "candid": [3, 5],
    }
)

remaining_new_obs = pd.DataFrame(
    {
        "ra": [7, 17],
        "dec": [2, 6],
        "dcmag": [16.21, 15.02],
        "fid": [1, 1],
        "nid": [3, 3],
        "jd": [3.5, 3.7],
        "candid": [9, 11],
    }
)

expected_obs_report = {
    "new trajectories": [0.0, 1.0, 2.0, 3.0],
    "all nid report": [
        {
            "old nid": 2,
            "observation associations": {
                "number of inter night separation based association": 2,
                "number of inter night magnitude filtered association": 0,
                "metrics": {},
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 1,
            "observation associations": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "metrics": {},
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
        {
            "old nid": 0,
            "observation associations": {
                "number of inter night separation based association": 1,
                "number of inter night magnitude filtered association": 0,
                "metrics": {},
                "number of duplicated association": 0,
                "number of inter night angle filtered association": 0,
            },
        },
    ],
}

# Test OrbFit

orbfit_samples = pd.DataFrame(
    {
        "ra": [
            81.9573635,
            90.2196466,
            90.9775852,
            92.1435109,
            95.3013857,
            232.2341868,
            231.1129767,
            231.0902895,
            229.1117136,
            225.6399955,
            225.1320369,
            224.1494043,
            224.1634648,
            223.6981941,
            222.8868291,
        ],
        "dec": [
            17.8940455,
            19.557214,
            19.6537084,
            19.7877896,
            20.0710622,
            -19.3694842,
            -18.6551774,
            -18.6566602,
            -18.7584283,
            -17.98425,
            -19.042805,
            -19.1458152,
            -17.6336513,
            -17.5222626,
            -19.3963402,
        ],
        "dcmag": [
            19.020416610644606,
            19.277157763192974,
            19.58262478343493,
            19.47009613328474,
            19.45875219190675,
            18.420662169461323,
            19.515643038956597,
            19.103981755075086,
            18.288246458485204,
            18.846686864667113,
            19.715124628473514,
            19.522913764553984,
            19.280371183840067,
            18.326972606767193,
            20.113162330613832,
        ],
        "fid": [2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 2, 1],
        "jd": [
            2459276.6515856,
            2459301.6557755,
            2459303.6663194,
            2459306.7054051,
            2459314.6574421,
            2459329.7716204,
            2459342.8558449,
            2459342.9366435,
            2459345.8568634,
            2459363.834375,
            2459365.7932176,
            2459370.7529051,
            2459373.7345139,
            2459377.7514468,
            2459379.689537,
        ],
        "trajectory_id": [2, 2, 2, 2, 2, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0],
    }
)

# - expected outputs

orbfit_output = pd.DataFrame(
    {
        "trajectory_id": [0, 1, 2],
        "provisional designation": ["K21J00A", "K21H00B", "K21E00C"],
        "ref_epoch": [2459365.748243189, 2459345.797868819, 2459303.631433099],
        "a": [2.251437705296581, 3.146290451465606, 2.53276408981958],
        "e": [0.125535937703596, 0.092386374483295, 0.21979650706685],
        "i": [6.4643575931745, 1.607049951428, 6.530453217436],
        "long. node": [50.5348303205253, 37.54350205425, 150.4841279350065],
        "arg. peric": [210.5960462174106, 166.8803952053398, 250.4271290562264],
        "mean anomaly": [342.871124394792, 22.3686256246004, 52.2712276077339],
        "rms_a": [0.00136864, -1.0, 0.141996],
        "rms_e": [0.00222514, -1.0, 0.014428],
        "rms_i": [0.0354767, -1.0, 0.0562678],
        "rms_long. node": [0.00670637, -1.0, 0.555542],
        "rms_arg. peric": [1.13426, -1.0, 10.4839],
        "rms_mean anomaly": [0.787228, -1.0, 9.93615],
    }
)

# Test orbit_elem_dataframe - expected outputs

orb_elem_output = pd.DataFrame(
    {
        "trajectory_id": [0],
        "provisional designation": ["K21E00A"],
        "ref_epoch": [2459274.810893373],
        "a": [1.5834346988159376],
        "e": [0.613572037782866],
        "i": [5.9442185803697],
        "long. node": [343.795980283847],
        "arg. peric": [270.1932521117385],
        "mean anomaly": [333.9568546371023],
        "rms_a": [-1],
        "rms_e": [-1],
        "rms_i": [-1],
        "rms_long. node": [-1],
        "rms_arg. peric": [-1],
        "rms_mean anomaly": [-1],
    }
)

# Test compute_orbit_elem - expected outputs

compute_orbit_elem_output = pd.DataFrame(
    {
        "ra": [
            81.9573635,
            90.2196466,
            90.9775852,
            92.1435109,
            95.3013857,
            232.2341868,
            229.1117136,
            225.6399955,
            224.1634648,
            223.6981941,
            231.1129767,
            231.0902895,
            225.1320369,
            224.1494043,
            222.8868291,
        ],
        "dec": [
            17.8940455,
            19.557214,
            19.6537084,
            19.7877896,
            20.0710622,
            -19.3694842,
            -18.7584283,
            -17.98425,
            -17.6336513,
            -17.5222626,
            -18.6551774,
            -18.6566602,
            -19.042805,
            -19.1458152,
            -19.3963402,
        ],
        "dcmag": [
            19.020416610644606,
            19.277157763192974,
            19.58262478343493,
            19.47009613328474,
            19.45875219190675,
            18.420662169461323,
            18.288246458485204,
            18.846686864667113,
            19.280371183840067,
            18.326972606767193,
            19.515643038956597,
            19.103981755075086,
            19.715124628473514,
            19.522913764553984,
            20.113162330613832,
        ],
        "fid": [2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1],
        "jd": [
            2459276.6515856,
            2459301.6557755,
            2459303.6663194,
            2459306.7054051,
            2459314.6574421,
            2459329.7716204,
            2459345.8568634,
            2459363.834375,
            2459373.7345139,
            2459377.7514468,
            2459342.8558449,
            2459342.9366435,
            2459365.7932176,
            2459370.7529051,
            2459379.689537,
        ],
        "trajectory_id": [2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
        "provisional designation": [
            "K21E00C",
            "K21E00C",
            "K21E00C",
            "K21E00C",
            "K21E00C",
            "K21H00B",
            "K21H00B",
            "K21H00B",
            "K21H00B",
            "K21H00B",
            "K21J00A",
            "K21J00A",
            "K21J00A",
            "K21J00A",
            "K21J00A",
        ],
        "ref_epoch": [
            2459303.631433099,
            2459303.631433099,
            2459303.631433099,
            2459303.631433099,
            2459303.631433099,
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
            2459365.748243189,
            2459365.748243189,
            2459365.748243189,
            2459365.748243189,
            2459365.748243189,
        ],
        "a": [
            2.53276408981958,
            2.53276408981958,
            2.53276408981958,
            2.53276408981958,
            2.53276408981958,
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
            2.251437705296581,
            2.251437705296581,
            2.251437705296581,
            2.251437705296581,
            2.251437705296581,
        ],
        "e": [
            0.21979650706685,
            0.21979650706685,
            0.21979650706685,
            0.21979650706685,
            0.21979650706685,
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
            0.125535937703596,
            0.125535937703596,
            0.125535937703596,
            0.125535937703596,
            0.125535937703596,
        ],
        "i": [
            6.530453217436,
            6.530453217436,
            6.530453217436,
            6.530453217436,
            6.530453217436,
            1.607049951428,
            1.607049951428,
            1.607049951428,
            1.607049951428,
            1.607049951428,
            6.4643575931745,
            6.4643575931745,
            6.4643575931745,
            6.4643575931745,
            6.4643575931745,
        ],
        "long. node": [
            150.4841279350065,
            150.4841279350065,
            150.4841279350065,
            150.4841279350065,
            150.4841279350065,
            37.54350205425,
            37.54350205425,
            37.54350205425,
            37.54350205425,
            37.54350205425,
            50.5348303205253,
            50.5348303205253,
            50.5348303205253,
            50.5348303205253,
            50.5348303205253,
        ],
        "<NAME>": [
            250.4271290562264,
            250.4271290562264,
            250.4271290562264,
            250.4271290562264,
            250.4271290562264,
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
            210.5960462174106,
            210.5960462174106,
            210.5960462174106,
            210.5960462174106,
            210.5960462174106,
        ],
        "mean anomaly": [
            52.2712276077339,
            52.2712276077339,
            52.2712276077339,
            52.2712276077339,
            52.2712276077339,
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
            342.871124394792,
            342.871124394792,
            342.871124394792,
            342.871124394792,
            342.871124394792,
        ],
        "rms_a": [
            0.141996,
            0.141996,
            0.141996,
            0.141996,
            0.141996,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            0.00136864,
            0.00136864,
            0.00136864,
            0.00136864,
            0.00136864,
        ],
        "rms_e": [
            0.014428,
            0.014428,
            0.014428,
            0.014428,
            0.014428,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            0.00222514,
            0.00222514,
            0.00222514,
            0.00222514,
            0.00222514,
        ],
        "rms_i": [
            0.0562678,
            0.0562678,
            0.0562678,
            0.0562678,
            0.0562678,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            0.0354767,
            0.0354767,
            0.0354767,
            0.0354767,
            0.0354767,
        ],
        "rms_long. node": [
            0.555542,
            0.555542,
            0.555542,
            0.555542,
            0.555542,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            0.00670637,
            0.00670637,
            0.00670637,
            0.00670637,
            0.00670637,
        ],
        "rms_arg. peric": [
            10.4839,
            10.4839,
            10.4839,
            10.4839,
            10.4839,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            1.13426,
            1.13426,
            1.13426,
            1.13426,
            1.13426,
        ],
        "rms_mean anomaly": [
            9.93615,
            9.93615,
            9.93615,
            9.93615,
            9.93615,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            0.787228,
            0.787228,
            0.787228,
            0.787228,
            0.787228,
        ],
    }
)

# Test Intra night step for inter_night associations

input_observation = pd.DataFrame(
    {
        "ra": [
            190.3093822,
            192.4757989,
            250.1164907,
            249.0639657,
            328.36068,
            42.1808185,
            42.6036852,
            42.1815458,
            42.5304125,
            42.1822624,
            42.5310979,
            42.1830249,
            42.6053935,
            42.5318612,
            42.6059568,
            42.1837213,
            42.1846499,
            42.606639,
            42.5334801,
            42.185469,
            42.6073259,
            42.5343328,
            42.6079834,
            42.5351813,
            42.1863528,
            42.1871921,
            42.6086452,
            42.6093149,
            42.1881009,
        ],
        "dec": [
            -1.8656935,
            4.0747939,
            -25.1107537,
            -8.4772727,
            -9.3780665,
            24.9404015,
            26.4502336,
            24.9407228,
            23.465135,
            24.9410442,
            23.4653673,
            24.9413411,
            26.4509386,
            23.4655574,
            26.4511729,
            24.9416392,
            24.9420043,
            26.4514583,
            23.4660646,
            24.9423478,
            26.451733,
            23.4662918,
            26.4519922,
            23.4665642,
            24.9426992,
            24.9430564,
            26.4522669,
            26.4525455,
            24.9434112,
        ],
        "jd": [
            2459390.6913889,
            2459390.7134838,
            2459390.7453356,
            2459390.814456,
            2459390.8690972,
            2459390.9629745,
            2459390.9629745,
            2459390.9649769,
            2459390.9649769,
            2459390.9669907,
            2459390.9669907,
            2459390.9689931,
            2459390.9689931,
            2459390.9689931,
            2459390.9710069,
            2459390.9710069,
            2459390.9733912,
            2459390.9733912,
            2459390.9733912,
            2459390.9757523,
            2459390.9757523,
            2459390.9757523,
            2459390.9781134,
            2459390.9781134,
            2459390.9781134,
            2459390.9804745,
            2459390.9804745,
            2459390.9828472,
            2459390.9828472,
        ],
        "fid": [
            1,
            1,
            1,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
            2,
        ],
        "nid": [
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
        ],
        "dcmag": [
            18.314560154790556,
            18.00043889328813,
            18.22956917803643,
            18.671504334026544,
            18.97395169454908,
            17.32167894539666,
            14.18589614910271,
            17.408995803526878,
            17.204864326115214,
            17.295811143089832,
            17.190303194288884,
            17.300278772697972,
            14.200502024176384,
            17.188696167174,
            14.200700388434196,
            17.289626601611015,
            17.349472109274732,
            14.171918091768449,
            17.15134512124073,
            17.42240352052329,
            14.180283722871964,
            17.18776120850724,
            14.19692343234462,
            17.116678387486722,
            17.43911808647409,
            17.406475158998877,
            14.195819077486222,
            14.201333882232895,
            17.42343435989272,
        ],
        "candid": [
            1636191384715015000,
            1636213482115015000,
            1636245332415015004,
            1636314454515015038,
            1636369094215015007,
            1636462971915015003,
            1636462973515015007,
            1636464971915015001,
            1636464970015015029,
            1636466991915015002,
            1636466990015015026,
            1636468991915015002,
            1636468993515015005,
            1636468990015015032,
            1636471003515015005,
            1636471001915015001,
            1636473393015015000,
            1636473394615015007,
            1636473391315015012,
            1636475753015015001,
            1636475754615015004,
            1636475751315015012,
            1636478114615015003,
            1636478111315015007,
            1636478113015015000,
            1636480473015015000,
            1636480474615015006,
            1636482844615015006,
            1636482843015015001,
        ],
        "ssnamenr": [
            "4258",
            "4262",
            "22758",
            "23415",
            "42647",
            "4963",
            "760",
            "4963",
            "1936",
            "4963",
            "1936",
            "4963",
            "760",
            "1936",
            "760",
            "4963",
            "4963",
            "760",
            "1936",
            "4963",
            "760",
            "1936",
            "760",
            "1936",
            "4963",
            "4963",
            "760",
            "760",
            "4963",
        ],
    }
)

input_observation_2 = pd.DataFrame(
    {
        "ra": [190.3093822, 192.4757989, 249.0639657],
        "dec": [-1.8656935, 4.0747939, -8.4772727],
        "jd": [2459390.6913889, 2459390.7134838, 2459390.814456],
        "fid": [1, 1, 2],
        "nid": [1636, 1636, 1636],
        "dcmag": [18.314560154790556, 18.00043889328813, 18.671504334026544],
        "candid": [1636191384715015000, 1636213482115015000, 1636314454515015038],
        "ssnamenr": ["4258", "4262", "23415"],
    }
)

# - expected outputs

tracklets_output = pd.DataFrame(
    {
        "ra": [
            42.5343328,
            42.6086452,
            42.1871921,
            42.1808185,
            42.5304125,
            42.1815458,
            42.6036852,
            42.5310979,
            42.1822624,
            42.6053935,
            42.1830249,
            42.1837213,
            42.5318612,
            42.6059568,
            42.606639,
            42.1846499,
            42.5334801,
            42.185469,
            42.6073259,
            42.1863528,
            42.6079834,
            42.5351813,
            42.6093149,
            42.1881009,
        ],
        "dec": [
            23.4662918,
            26.4522669,
            24.9430564,
            24.9404015,
            23.465135,
            24.9407228,
            26.4502336,
            23.4653673,
            24.9410442,
            26.4509386,
            24.9413411,
            24.9416392,
            23.4655574,
            26.4511729,
            26.4514583,
            24.9420043,
            23.4660646,
            24.9423478,
            26.451733,
            24.9426992,
            26.4519922,
            23.4665642,
            26.4525455,
            24.9434112,
        ],
        "jd": [
            2459390.9757523,
            2459390.9804745,
            2459390.9804745,
            2459390.9629745,
            2459390.9649769,
            2459390.9649769,
            2459390.9629745,
            2459390.9669907,
            2459390.9669907,
            2459390.9689931,
            2459390.9689931,
            2459390.9710069,
            2459390.9689931,
            2459390.9710069,
            2459390.9733912,
            2459390.9733912,
            2459390.9733912,
            2459390.9757523,
            2459390.9757523,
            2459390.9781134,
            2459390.9781134,
            2459390.9781134,
            2459390.9828472,
            2459390.9828472,
        ],
        "fid": [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],
        "nid": [
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
            1636,
        ],
        "dcmag": [
            17.18776120850724,
            14.195819077486222,
            17.406475158998877,
            17.32167894539666,
            17.204864326115214,
            17.408995803526878,
            14.18589614910271,
            17.190303194288884,
            17.295811143089832,
            14.200502024176384,
            17.300278772697972,
            17.289626601611015,
            17.188696167174,
            14.200700388434196,
            14.171918091768449,
            17.349472109274732,
            17.15134512124073,
            17.42240352052329,
            14.180283722871964,
            17.43911808647409,
            14.19692343234462,
            17.116678387486722,
            14.201333882232895,
            17.42343435989272,
        ],
        "candid": [
            1636475751315015012,
            1636480474615015006,
            1636480473015015000,
            1636462971915015003,
            1636464970015015029,
            1636464971915015001,
            1636462973515015007,
            1636466990015015026,
            1636466991915015002,
            1636468993515015005,
            1636468991915015002,
            1636471001915015001,
            1636468990015015032,
            1636471003515015005,
            1636473394615015007,
            1636473393015015000,
            1636473391315015012,
            1636475753015015001,
            1636475754615015004,
            1636478113015015000,
            1636478114615015003,
            1636478111315015007,
            1636482844615015006,
            1636482843015015001,
        ],
        "ssnamenr": [
            "1936",
            "760",
            "4963",
            "4963",
            "1936",
            "4963",
            "760",
            "1936",
            "4963",
            "760",
            "4963",
            "4963",
            "1936",
            "760",
            "760",
            "4963",
            "1936",
            "4963",
            "760",
            "4963",
            "760",
            "1936",
            "760",
            "4963",
        ],
        "trajectory_id": [
            4,
            6,
            3,
            3,
            4,
            3,
            6,
            4,
            3,
            6,
            3,
            3,
            4,
            6,
            6,
            3,
            4,
            3,
            6,
            3,
            6,
            4,
            6,
            3,
        ],
    }
)

remaining_new_obs_output = pd.DataFrame(
    {
        "ra": [190.3093822, 192.4757989, 250.1164907, 249.0639657, 328.36068],
        "dec": [-1.8656935, 4.0747939, -25.1107537, -8.4772727, -9.3780665],
        "jd": [
            2459390.6913889,
            2459390.7134838,
            2459390.7453356,
            2459390.814456,
            2459390.8690972,
        ],
        "fid": [1, 1, 1, 2, 2],
        "nid": [1636, 1636, 1636, 1636, 1636],
        "dcmag": [
            18.314560154790556,
            18.00043889328813,
            18.22956917803643,
            18.671504334026544,
            18.97395169454908,
        ],
        "candid": [
            1636191384715015000,
            1636213482115015000,
            1636245332415015004,
            1636314454515015038,
            1636369094215015007,
        ],
        "ssnamenr": ["4258", "4262", "22758", "23415", "42647"],
    }
)

tracklets_expected_metrics = {
    "number of separation association": 176,
    "number of association filtered by magnitude": 0,
    "association metrics": {
        "precision": 100.0,
        "recall": 100.0,
        "True Positif": 21,
        "False Positif": 0,
        "False Negatif": 0,
        "total real association": 21,
    },
    "number of intra night tracklets": 3,
}


tracklets_output_2 = pd.DataFrame({"trajectory_id": []})

remaining_new_obs_output_2 = pd.DataFrame(
    {
        "ra": [190.3093822, 192.4757989, 249.0639657],
        "dec": [-1.8656935, 4.0747939, -8.4772727],
        "jd": [2459390.6913889, 2459390.7134838, 2459390.814456],
        "fid": [1, 1, 2],
        "nid": [1636, 1636, 1636],
        "dcmag": [18.314560154790556, 18.00043889328813, 18.671504334026544],
        "candid": [1636191384715015000, 1636213482115015000, 1636314454515015038],
        "ssnamenr": ["4258", "4262", "23415"],
    }
)

# Test Trajectories and Tracklets associations Steps in Inter night associations

traj_sample = pd.DataFrame(
    {
        "ra": [
            186.5040008,
            168.6524972,
            167.4181099,
            168.6523934,
            170.4261379,
            170.9717685,
            170.962155,
            167.4075773,
            170.4161533,
            168.643705,
            168.6436267,
            186.4808089,
            173.3796056,
            173.3680826,
        ],
        "dec": [
            44.7314698,
            0.9052992,
            0.7732693,
            0.9053366,
            -6.1125869,
            -13.4971232,
            -13.491155,
            0.7772116,
            -6.1111145,
            0.9088778,
            0.9089254,
            44.7262375,
            7.9868333,
            7.9916832,
        ],
        "jd": [
            2459291.781875,
            2459291.7905556,
            2459291.7910185,
            2459291.7910185,
            2459291.7910185,
            2459291.7926042,
            2459291.835625,
            2459291.836088,
            2459291.836088,
            2459291.836088,
            2459291.8365509,
            2459291.8407176,
            2459291.7905556,
            2459291.8365509,
        ],
        "fid": [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2],
        "nid": [
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
            1537,
        ],
        "candid": [
            1537281870615015004,
            1537290551415015014,
            1537291016115015020,
            1537291016015015008,
            1537291011115015026,
            1537292601415015006,
            1537335621415015029,
            1537336086115015006,
            1537336081115015019,
            1537336086015015011,
            1537336551415015017,
            1537340710615015003,
            1537290555215015014,
            1537336555215015010,
        ],
        "dcmag": [
            18.24371301323446,
            16.743894489172938,
            17.368181071421624,
            16.723799914402477,
            14.332974466763252,
            17.537944743785797,
            16.929160615392856,
            16.83615755653922,
            18.644103030043368,
            16.216850388506607,
            16.240993228516896,
            17.64516573574104,
            17.470940376908793,
            16.761806758388268,
        ],
        "ssnamenr": [
            "99956",
            "3525",
            "5891",
            "3525",
            "99969",
            "10936",
            "10936",
            "5891",
            "99969",
            "3525",
            "3525",
            "99956",
            "1131",
            "1131",
        ],
        "trajectory_id": [4, 2, 3, 2, 5, 0, 0, 3, 5, 2, 2, 4, 1, 1],
        "not_updated": [
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "ref_epoch": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
    }
)

track_sample = pd.DataFrame(
    {
        "ra": [
            116.3740686,
            116.378338,
            167.2025741,
            170.7601106,
            170.7599095,
            167.1931768,
            168.4665006,
            167.1930804,
            162.624763,
            162.6243687,
            162.6237897,
            170.7460899,
            170.745984,
            167.1832584,
            168.4583886,
            162.6115944,
            162.6114272,
            162.6110749,
            203.95862,
            203.9477719,
            173.1350125,
            173.1244823,
        ],
        "dec": [
            46.9331292,
            46.9186626,
            0.8573175,
            -13.3601006,
            -13.3599521,
            0.8608448,
            0.9842065,
            0.860896,
            44.0008725,
            44.0006253,
            44.0002676,
            -13.3511835,
            -13.351098,
            0.8646139,
            0.9875339,
            43.9922395,
            43.9921097,
            43.9918713,
            -6.09188,
            -6.0865106,
            8.0921375,
            8.0965144,
        ],
        "jd": [
            2459292.6814699,
            2459292.7236343,
            2459292.753206,
            2459292.7726042,
            2459292.7735301,
            2459292.7938194,
            2459292.794294,
            2459292.794294,
            2459292.8075116,
            2459292.8084606,
            2459292.8098843,
            2459292.8358912,
            2459292.8363657,
            2459292.8368519,
            2459292.8368519,
            2459292.8411574,
            2459292.8416319,
            2459292.842581,
            2459292.8774421,
            2459292.936794,
            2459292.7956944,
            2459292.8378356,
        ],
        "fid": [1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2],
        "nid": [
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
        ],
        "candid": [
            1538181462815015010,
            1538223632815015014,
            1538253204815015007,
            1538272605615015000,
            1538273530315015016,
            1538293814815015009,
            1538294290315015019,
            1538294290215015013,
            1538307511415015016,
            1538308466015015005,
            1538309884815015004,
            1538335895615015000,
            1538336360315015011,
            1538336850215015012,
            1538336850315015022,
            1538341154815015003,
            1538341636015015009,
            1538342581415015003,
            1538377441515015040,
            1538436791515015047,
            1538295690615015016,
            1538337830615015025,
        ],
        "dcmag": [
            18.75538096440109,
            17.388190194142993,
            16.38345096268365,
            17.407960400594295,
            17.45544077836076,
            17.399079120824545,
            16.882386749897492,
            17.422983631636527,
            17.070684603766836,
            17.018834560517735,
            17.03552357727233,
            16.870491564990747,
            16.890761891765294,
            16.598299027841747,
            16.251481761141033,
            16.31657739361883,
            16.321679024232985,
            16.295972237444545,
            18.96152984542355,
            19.184091428608127,
            17.545962356941715,
            16.776867088160635,
        ],
        "ssnamenr": [
            "99949",
            "99949",
            "5891",
            "10936",
            "10936",
            "5891",
            "3525",
            "5891",
            "29147",
            "29147",
            "29147",
            "10936",
            "10936",
            "5891",
            "3525",
            "29147",
            "29147",
            "29147",
            "99946",
            "99946",
            "1131",
            "1131",
        ],
        "trajectory_id": [
            16,
            16,
            14,
            10,
            10,
            14,
            13,
            14,
            12,
            12,
            12,
            10,
            10,
            14,
            13,
            12,
            12,
            12,
            15,
            15,
            11,
            11,
        ],
        "not_updated": [
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
        ],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "ref_epoch": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
    }
)

# - expected outputs

traj_not_updated_expected = pd.DataFrame(
    {
        "ra": [186.5040008, 170.4261379, 170.4161533, 186.4808089],
        "dec": [44.7314698, -6.1125869, -6.1111145, 44.7262375],
        "jd": [2459291.781875, 2459291.7910185, 2459291.836088, 2459291.8407176],
        "fid": [1, 1, 2, 2],
        "nid": [1537, 1537, 1537, 1537],
        "candid": [
            1537281870615015004,
            1537291011115015026,
            1537336081115015019,
            1537340710615015003,
        ],
        "dcmag": [
            18.24371301323446,
            14.332974466763252,
            18.644103030043368,
            17.64516573574104,
        ],
        "ssnamenr": ["99956", "99969", "99969", "99956"],
        "trajectory_id": [4, 5, 5, 4],
        "not_updated": [True, True, True, True],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

other_track_expected = pd.DataFrame(
    {
        "ra": [116.3740686, 116.378338, 203.95862, 203.9477719],
        "dec": [46.9331292, 46.9186626, -6.09188, -6.0865106],
        "jd": [2459292.6814699, 2459292.7236343, 2459292.8774421, 2459292.936794],
        "fid": [1, 2, 2, 1],
        "nid": [1538, 1538, 1538, 1538],
        "candid": [
            1538181462815015010,
            1538223632815015014,
            1538377441515015040,
            1538436791515015047,
        ],
        "dcmag": [
            18.75538096440109,
            17.388190194142993,
            18.96152984542355,
            19.184091428608127,
        ],
        "ssnamenr": ["99949", "99949", "99946", "99946"],
        "trajectory_id": [16, 16, 15, 15],
        "not_updated": [True, True, True, True],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

track_orb_expected = pd.DataFrame(
    {
        "ra": [
            168.6524972,
            168.6523934,
            168.643705,
            168.6436267,
            168.4665006,
            168.4583886,
            167.4181099,
            167.4075773,
            167.2025741,
            167.1931768,
            167.1930804,
            167.1832584,
            170.9717685,
            170.962155,
            170.7601106,
            170.7599095,
            170.7460899,
            170.745984,
            162.624763,
            162.6243687,
            162.6237897,
            162.6115944,
            162.6114272,
            162.6110749,
        ],
        "dec": [
            0.9052992,
            0.9053366,
            0.9088778,
            0.9089254,
            0.9842065,
            0.9875339,
            0.7732693,
            0.7772116,
            0.8573175,
            0.8608448,
            0.860896,
            0.8646139,
            -13.4971232,
            -13.491155,
            -13.3601006,
            -13.3599521,
            -13.3511835,
            -13.351098,
            44.0008725,
            44.0006253,
            44.0002676,
            43.9922395,
            43.9921097,
            43.9918713,
        ],
        "jd": [
            2459291.7905556,
            2459291.7910185,
            2459291.836088,
            2459291.8365509,
            2459292.794294,
            2459292.8368519,
            2459291.7910185,
            2459291.836088,
            2459292.753206,
            2459292.7938194,
            2459292.794294,
            2459292.8368519,
            2459291.7926042,
            2459291.835625,
            2459292.7726042,
            2459292.7735301,
            2459292.8358912,
            2459292.8363657,
            2459292.8075116,
            2459292.8084606,
            2459292.8098843,
            2459292.8411574,
            2459292.8416319,
            2459292.842581,
        ],
        "fid": [1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 1, 2, 2, 2],
        "nid": [
            1537,
            1537,
            1537,
            1537,
            1538,
            1538,
            1537,
            1537,
            1538,
            1538,
            1538,
            1538,
            1537,
            1537,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
            1538,
        ],
        "candid": [
            1537290551415015014,
            1537291016015015008,
            1537336086015015011,
            1537336551415015017,
            1538294290315015019,
            1538336850315015022,
            1537291016115015020,
            1537336086115015006,
            1538253204815015007,
            1538293814815015009,
            1538294290215015013,
            1538336850215015012,
            1537292601415015006,
            1537335621415015029,
            1538272605615015000,
            1538273530315015016,
            1538335895615015000,
            1538336360315015011,
            1538307511415015016,
            1538308466015015005,
            1538309884815015004,
            1538341154815015003,
            1538341636015015009,
            1538342581415015003,
        ],
        "dcmag": [
            16.743894489172938,
            16.723799914402477,
            16.216850388506607,
            16.240993228516896,
            16.882386749897492,
            16.251481761141033,
            17.368181071421624,
            16.83615755653922,
            16.38345096268365,
            17.399079120824545,
            17.422983631636527,
            16.598299027841747,
            17.537944743785797,
            16.929160615392856,
            17.407960400594295,
            17.45544077836076,
            16.870491564990747,
            16.890761891765294,
            17.070684603766836,
            17.018834560517735,
            17.03552357727233,
            16.31657739361883,
            16.321679024232985,
            16.295972237444545,
        ],
        "ssnamenr": [
            "3525",
            "3525",
            "3525",
            "3525",
            "3525",
            "3525",
            "5891",
            "5891",
            "5891",
            "5891",
            "5891",
            "5891",
            "10936",
            "10936",
            "10936",
            "10936",
            "10936",
            "10936",
            "29147",
            "29147",
            "29147",
            "29147",
            "29147",
            "29147",
        ],
        "trajectory_id": [
            2,
            2,
            2,
            2,
            2,
            2,
            3,
            3,
            3,
            3,
            3,
            3,
            0,
            0,
            0,
            0,
            0,
            0,
            12,
            12,
            12,
            12,
            12,
            12,
        ],
        "not_updated": [
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            False,
            True,
            True,
            True,
            True,
            True,
            True,
        ],
        "provisional designation": [
            "K21F00C",
            "K21F00C",
            "K21F00C",
            "K21F00C",
            "K21F00C",
            "K21F00C",
            "K21F00D",
            "K21F00D",
            "K21F00D",
            "K21F00D",
            "K21F00D",
            "K21F00D",
            "K21F00A",
            "K21F00A",
            "K21F00A",
            "K21F00A",
            "K21F00A",
            "K21F00A",
            "K21F00N",
            "K21F00N",
            "K21F00N",
            "K21F00N",
            "K21F00N",
            "K21F00N",
        ],
        "ref_epoch": [
            2459291.789210112,
            2459291.789210112,
            2459291.789210112,
            2459291.789210112,
            2459291.789210112,
            2459291.789210112,
            2459292.718054266,
            2459292.718054266,
            2459292.718054266,
            2459292.718054266,
            2459292.718054266,
            2459292.718054266,
            2459292.73460517,
            2459292.73460517,
            2459292.73460517,
            2459292.73460517,
            2459292.73460517,
            2459292.73460517,
            2459292.768442255,
            2459292.768442255,
            2459292.768442255,
            2459292.768442255,
            2459292.768442255,
            2459292.768442255,
        ],
        "a": [
            1.559445761719178,
            1.559445761719178,
            1.559445761719178,
            1.559445761719178,
            1.559445761719178,
            1.559445761719178,
            1.4462063804947276,
            1.4462063804947276,
            1.4462063804947276,
            1.4462063804947276,
            1.4462063804947276,
            1.4462063804947276,
            1.9032215831605253,
            1.9032215831605253,
            1.9032215831605253,
            1.9032215831605253,
            1.9032215831605253,
            1.9032215831605253,
            0.873159936610304,
            0.873159936610304,
            0.873159936610304,
            0.873159936610304,
            0.873159936610304,
            0.873159936610304,
        ],
        "e": [
            0.172255774041509,
            0.172255774041509,
            0.172255774041509,
            0.172255774041509,
            0.172255774041509,
            0.172255774041509,
            0.139367571636477,
            0.139367571636477,
            0.139367571636477,
            0.139367571636477,
            0.139367571636477,
            0.139367571636477,
            0.459819088028512,
            0.459819088028512,
            0.459819088028512,
            0.459819088028512,
            0.459819088028512,
            0.459819088028512,
            0.497851080722456,
            0.497851080722456,
            0.497851080722456,
            0.497851080722456,
            0.497851080722456,
            0.497851080722456,
        ],
        "i": [
            1.0220113353982,
            1.0220113353982,
            1.0220113353982,
            1.0220113353982,
            1.0220113353982,
            1.0220113353982,
            0.9180094404804,
            0.9180094404804,
            0.9180094404804,
            0.9180094404804,
            0.9180094404804,
            0.9180094404804,
            6.9612744498974,
            6.9612744498974,
            6.9612744498974,
            6.9612744498974,
            6.9612744498974,
            6.9612744498974,
            24.7196038142678,
            24.7196038142678,
            24.7196038142678,
            24.7196038142678,
            24.7196038142678,
            24.7196038142678,
        ],
        "long. node": [
            288.611992803378,
            288.611992803378,
            288.611992803378,
            288.611992803378,
            288.611992803378,
            288.611992803378,
            269.357956247959,
            269.357956247959,
            269.357956247959,
            269.357956247959,
            269.357956247959,
            269.357956247959,
            212.2493916922841,
            212.2493916922841,
            212.2493916922841,
            212.2493916922841,
            212.2493916922841,
            212.2493916922841,
            178.1160546687316,
            178.1160546687316,
            178.1160546687316,
            178.1160546687316,
            178.1160546687316,
            178.1160546687316,
        ],
        "<NAME>": [
            207.1877577853199,
            207.1877577853199,
            207.1877577853199,
            207.1877577853199,
            207.1877577853199,
            207.1877577853199,
            295.3600175861495,
            295.3600175861495,
            295.3600175861495,
            295.3600175861495,
            295.3600175861495,
            295.3600175861495,
            37.6055931919099,
            37.6055931919099,
            37.6055931919099,
            37.6055931919099,
            37.6055931919099,
            37.6055931919099,
            226.8832404690586,
            226.8832404690586,
            226.8832404690586,
            226.8832404690586,
            226.8832404690586,
            226.8832404690586,
        ],
        "mean anomaly": [
            28.2408416499565,
            28.2408416499565,
            28.2408416499565,
            28.2408416499565,
            28.2408416499565,
            28.2408416499565,
            338.5028638743083,
            338.5028638743083,
            338.5028638743083,
            338.5028638743083,
            338.5028638743083,
            338.5028638743083,
            331.8559386949461,
            331.8559386949461,
            331.8559386949461,
            331.8559386949461,
            331.8559386949461,
            331.8559386949461,
            79.5353878032673,
            79.5353878032673,
            79.5353878032673,
            79.5353878032673,
            79.5353878032673,
            79.5353878032673,
        ],
        "rms_a": [
            0.258929,
            0.258929,
            0.258929,
            0.258929,
            0.258929,
            0.258929,
            0.641555,
            0.641555,
            0.641555,
            0.641555,
            0.641555,
            0.641555,
            2.73653,
            2.73653,
            2.73653,
            2.73653,
            2.73653,
            2.73653,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_e": [
            0.754289,
            0.754289,
            0.754289,
            0.754289,
            0.754289,
            0.754289,
            0.672692,
            0.672692,
            0.672692,
            0.672692,
            0.672692,
            0.672692,
            1.13127,
            1.13127,
            1.13127,
            1.13127,
            1.13127,
            1.13127,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_i": [
            1.62077,
            1.62077,
            1.62077,
            1.62077,
            1.62077,
            1.62077,
            0.228257,
            0.228257,
            0.228257,
            0.228257,
            0.228257,
            0.228257,
            10.1173,
            10.1173,
            10.1173,
            10.1173,
            10.1173,
            10.1173,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_long. node": [
            208.206,
            208.206,
            208.206,
            208.206,
            208.206,
            208.206,
            171.829,
            171.829,
            171.829,
            171.829,
            171.829,
            171.829,
            53.5567,
            53.5567,
            53.5567,
            53.5567,
            53.5567,
            53.5567,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            702.419,
            702.419,
            702.419,
            702.419,
            702.419,
            702.419,
            453.415,
            453.415,
            453.415,
            453.415,
            453.415,
            453.415,
            86.6842,
            86.6842,
            86.6842,
            86.6842,
            86.6842,
            86.6842,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            323.212,
            323.212,
            323.212,
            323.212,
            323.212,
            323.212,
            186.464,
            186.464,
            186.464,
            186.464,
            186.464,
            186.464,
            71.7878,
            71.7878,
            71.7878,
            71.7878,
            71.7878,
            71.7878,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
    }
)

traj_track_metrics_expected = {
    "updated trajectories": [0.0, 1.0, 2.0, 3.0],
    "all nid_report": [
        {
            "old nid": 1537,
            "trajectories_to_tracklets_report": {
                "number of inter night separation based association": 4,
                "number of inter night magnitude filtered association": 0,
                "number of inter night angle filtered association": 0,
                "number of duplicated association": 0,
                "metrics": {
                    "precision": 0.0,
                    "recall": 0.0,
                    "True Positif": 0,
                    "False Positif": 4,
                    "False Negatif": 0,
                    "total real association": 0,
                },
            },
        }
    ],
}

small_traj_expected = pd.DataFrame(
    {
        "ra": [173.3796056, 173.3680826, 173.1350125, 173.1244823],
        "dec": [7.9868333, 7.9916832, 8.0921375, 8.0965144],
        "jd": [2459291.7905556, 2459291.8365509, 2459292.7956944, 2459292.8378356],
        "fid": [1, 2, 1, 2],
        "nid": [1537, 1537, 1538, 1538],
        "candid": [
            1537290555215015014,
            1537336555215015010,
            1538295690615015016,
            1538337830615015025,
        ],
        "dcmag": [
            17.470940376908793,
            16.761806758388268,
            17.545962356941715,
            16.776867088160635,
        ],
        "ssnamenr": ["1131", "1131", "1131", "1131"],
        "trajectory_id": [1, 1, 1, 1],
        "not_updated": [False, False, False, False],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

# Test Trajectories and new observations associations Steps in Inter night associations

traj_sample_2 = pd.DataFrame(
    {
        "ra": [
            113.5161051,
            115.9766909,
            144.8664828,
            144.8664282,
            144.8568979,
            113.5120529,
            113.5119507,
            115.9704401,
            300.575368,
            300.5781883,
            300.5790747,
        ],
        "dec": [
            15.4004424,
            52.362439,
            31.5997876,
            31.5998135,
            31.6001948,
            15.4031158,
            15.4031798,
            52.3384133,
            -4.0623298,
            -4.0616476,
            -4.0614048,
        ],
        "ssnamenr": [
            "28691",
            "99949",
            "99930",
            "99930",
            "99930",
            "28691",
            "28691",
            "99949",
            "3728",
            "3728",
            "3728",
        ],
        "jd": [
            2459276.7106944,
            2459276.713912,
            2459276.7286343,
            2459276.7291088,
            2459276.7775231,
            2459276.7800347,
            2459276.7819329,
            2459276.7856944,
            2459277.0352662,
            2459277.0440509,
            2459277.0469792,
        ],
        "fid": [1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2],
        "nid": [1522, 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1522, 1522],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanyihd",
            "ZTF21aanykrh",
            "ZTF21aanyoyw",
            "ZTF21aanyoyw",
            "ZTF21aanzjrd",
            "ZTF21aanzlqo",
            "ZTF21aanzlqo",
            "ZTF21aanzopx",
            "ZTF21aaobpfj",
            "ZTF21aaobqot",
            "ZTF21aaobqxg",
        ],
        "candid": [
            1522210695615015001,
            1522213910515015003,
            1522228631915015011,
            1522229103015015014,
            1522277521915015006,
            1522280035615015002,
            1522281930315015009,
            1522285690515015012,
            1522535261815015007,
            1522544051815015004,
            1522546971815015005,
        ],
        "magpsf": [
            18.694379806518555,
            18.999000549316406,
            18.895910263061523,
            18.888437271118164,
            18.275619506835938,
            18.254955291748047,
            18.321918487548828,
            17.851123809814453,
            17.91790771484375,
            17.964813232421875,
            17.9420223236084,
        ],
        "sigmapsf": [
            0.08066412061452866,
            0.10815799236297607,
            0.07555245608091354,
            0.0981987938284874,
            0.07174281775951385,
            0.0689801573753357,
            0.07774920016527176,
            0.048972807824611664,
            0.11288779228925705,
            0.08232304453849792,
            0.06886935234069824,
        ],
        "magnr": [
            22.760000228881836,
            22.451000213623047,
            22.798999786376953,
            23.171998977661133,
            23.023000717163086,
            22.624000549316406,
            22.215999603271484,
            22.635000228881836,
            21.895000457763672,
            21.895000457763672,
            16.204999923706055,
        ],
        "sigmagnr": [
            0.31200000643730164,
            0.21400000154972076,
            0.3330000042915344,
            0.34200000762939453,
            0.3330000042915344,
            0.2840000092983246,
            0.22599999606609344,
            0.28200000524520874,
            0.1340000033378601,
            0.1340000033378601,
            0.01600000075995922,
        ],
        "magzpsci": [
            26.38237953186035,
            26.413000106811523,
            26.31390953063965,
            26.340438842773438,
            26.266620635986328,
            26.25095558166504,
            26.057918548583984,
            26.31112289428711,
            26.08490753173828,
            26.115812301635742,
            26.130022048950195,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.670297450941028,
            18.95811945264242,
            18.866195775358634,
            18.867924932665797,
            18.2618987979544,
            18.23528620354176,
            18.28580399353136,
            17.838383673470858,
            17.885221059900132,
            17.93164863680288,
            15.883371362435756,
        ],
        "dcmagerr": [
            0.0791909464641598,
            0.10446100102873071,
            0.07406042965891489,
            0.09657332250639565,
            0.0709652051872327,
            0.06793337306584203,
            0.07556816827015138,
            0.0485131793944022,
            0.10961195779634823,
            0.07994814397430444,
            0.017083043965914837,
        ],
        "trajectory_id": [0, 3, 2, 2, 2, 0, 0, 3, 1, 1, 1],
        "provisional designation": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_arg. peric": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_mean anomaly": [
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
            -1.0,
        ],
        "not_updated": [
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
        ],
    }
)

new_obs_sample = pd.DataFrame(
    {
        "ra": [113.630711, 113.4235261, 208.1300173, 224.2631717, 301.2054266],
        "dec": [18.2657994, 15.4768524, -26.5825343, 4.9952381, -3.9005005],
        "ssnamenr": ["100068", "28691", "99961", "100052", "3728"],
        "jd": [
            2459278.686412,
            2459278.7137269,
            2459278.9394792,
            2459278.9583218,
            2459279.0453935,
        ],
        "fid": [2, 1, 2, 2, 2],
        "nid": [1524, 1524, 1524, 1524, 1524],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aaocqpx",
            "ZTF21aaocytl",
            "ZTF21aaogdtq",
            "ZTF21aaoggor",
            "ZTF21aaogrom",
        ],
        "candid": [
            1524186412915015024,
            1524213721415015086,
            1524439470415015002,
            1524458324715015007,
            1524545391815015002,
        ],
        "magpsf": [
            19.143362045288086,
            18.73301887512207,
            18.811845779418945,
            19.057483673095703,
            18.034717559814453,
        ],
        "sigmapsf": [
            0.10398470610380173,
            0.12779207527637482,
            0.13058899343013763,
            0.11876894533634186,
            0.13105228543281555,
        ],
        "magnr": [
            22.868000030517578,
            18.891000747680664,
            22.079999923706055,
            22.809999465942383,
            20.572999954223633,
        ],
        "sigmagnr": [
            0.3179999887943268,
            0.017999999225139618,
            0.1979999989271164,
            0.27000001072883606,
            0.07999999821186066,
        ],
        "magzpsci": [
            26.325361251831055,
            25.975017547607422,
            26.238845825195312,
            26.357484817504883,
            26.193716049194336,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t"],
        "dcmag": [
            19.110317561887875,
            17.880204964203514,
            18.757883876849455,
            19.026190442703804,
            17.92725547303823,
        ],
        "dcmagerr": [
            0.10131703650885979,
            0.0590784856331265,
            0.12462757904029284,
            0.1156493141389798,
            0.11894163004867943,
        ],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
    }
)

# - expected outputs

other_traj_expected = pd.DataFrame(
    {
        "ra": [115.9766909, 144.8664828, 144.8664282, 144.8568979, 115.9704401],
        "dec": [52.362439, 31.5997876, 31.5998135, 31.6001948, 52.3384133],
        "ssnamenr": ["99949", "99930", "99930", "99930", "99949"],
        "jd": [
            2459276.713912,
            2459276.7286343,
            2459276.7291088,
            2459276.7775231,
            2459276.7856944,
        ],
        "fid": [1, 1, 1, 2, 2],
        "nid": [1522, 1522, 1522, 1522, 1522],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanykrh",
            "ZTF21aanyoyw",
            "ZTF21aanyoyw",
            "ZTF21aanzjrd",
            "ZTF21aanzopx",
        ],
        "candid": [
            1522213910515015003,
            1522228631915015011,
            1522229103015015014,
            1522277521915015006,
            1522285690515015012,
        ],
        "magpsf": [
            18.999000549316406,
            18.895910263061523,
            18.888437271118164,
            18.275619506835938,
            17.851123809814453,
        ],
        "sigmapsf": [
            0.10815799236297607,
            0.07555245608091354,
            0.0981987938284874,
            0.07174281775951385,
            0.048972807824611664,
        ],
        "magnr": [
            22.451000213623047,
            22.798999786376953,
            23.171998977661133,
            23.023000717163086,
            22.635000228881836,
        ],
        "sigmagnr": [
            0.21400000154972076,
            0.3330000042915344,
            0.34200000762939453,
            0.3330000042915344,
            0.28200000524520874,
        ],
        "magzpsci": [
            26.413000106811523,
            26.31390953063965,
            26.340438842773438,
            26.266620635986328,
            26.31112289428711,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t"],
        "dcmag": [
            18.95811945264242,
            18.866195775358634,
            18.867924932665797,
            18.2618987979544,
            17.838383673470858,
        ],
        "dcmagerr": [
            0.10446100102873071,
            0.07406042965891489,
            0.09657332250639565,
            0.0709652051872327,
            0.0485131793944022,
        ],
        "trajectory_id": [3, 2, 2, 2, 3],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True, True],
    }
)

remaining_new_observations_expected = pd.DataFrame(
    {
        "ra": [113.630711, 208.1300173, 224.2631717],
        "dec": [18.2657994, -26.5825343, 4.9952381],
        "ssnamenr": ["100068", "99961", "100052"],
        "jd": [2459278.686412, 2459278.9394792, 2459278.9583218],
        "fid": [2, 2, 2],
        "nid": [1524, 1524, 1524],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aaocqpx", "ZTF21aaogdtq", "ZTF21aaoggor"],
        "candid": [1524186412915015024, 1524439470415015002, 1524458324715015007],
        "magpsf": [19.143362045288086, 18.811845779418945, 19.057483673095703],
        "sigmapsf": [0.10398470610380173, 0.13058899343013763, 0.11876894533634186],
        "magnr": [22.868000030517578, 22.079999923706055, 22.809999465942383],
        "sigmagnr": [0.3179999887943268, 0.1979999989271164, 0.27000001072883606],
        "magzpsci": [26.325361251831055, 26.238845825195312, 26.357484817504883],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [19.110317561887875, 18.757883876849455, 19.026190442703804],
        "dcmagerr": [0.10131703650885979, 0.12462757904029284, 0.1156493141389798],
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
    }
)

traj_orb_expected = pd.DataFrame(
    {
        "ra": [
            113.5161051,
            113.5120529,
            113.5119507,
            113.4235261,
            300.575368,
            300.5781883,
            300.5790747,
            301.2054266,
        ],
        "dec": [
            15.4004424,
            15.4031158,
            15.4031798,
            15.4768524,
            -4.0623298,
            -4.0616476,
            -4.0614048,
            -3.9005005,
        ],
        "ssnamenr": [
            "28691",
            "28691",
            "28691",
            "28691",
            "3728",
            "3728",
            "3728",
            "3728",
        ],
        "jd": [
            2459276.7106944,
            2459276.7800347,
            2459276.7819329,
            2459278.7137269,
            2459277.0352662,
            2459277.0440509,
            2459277.0469792,
            2459279.0453935,
        ],
        "fid": [1, 2, 2, 1, 2, 2, 2, 2],
        "nid": [1522, 1522, 1522, 1524, 1522, 1522, 1522, 1524],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanyihd",
            "ZTF21aanzlqo",
            "ZTF21aanzlqo",
            "ZTF21aaocytl",
            "ZTF21aaobpfj",
            "ZTF21aaobqot",
            "ZTF21aaobqxg",
            "ZTF21aaogrom",
        ],
        "candid": [
            1522210695615015001,
            1522280035615015002,
            1522281930315015009,
            1524213721415015086,
            1522535261815015007,
            1522544051815015004,
            1522546971815015005,
            1524545391815015002,
        ],
        "magpsf": [
            18.694379806518555,
            18.254955291748047,
            18.321918487548828,
            18.73301887512207,
            17.91790771484375,
            17.964813232421875,
            17.9420223236084,
            18.034717559814453,
        ],
        "sigmapsf": [
            0.08066412061452866,
            0.0689801573753357,
            0.07774920016527176,
            0.12779207527637482,
            0.11288779228925705,
            0.08232304453849792,
            0.06886935234069824,
            0.13105228543281555,
        ],
        "magnr": [
            22.760000228881836,
            22.624000549316406,
            22.215999603271484,
            18.891000747680664,
            21.895000457763672,
            21.895000457763672,
            16.204999923706055,
            20.572999954223633,
        ],
        "sigmagnr": [
            0.31200000643730164,
            0.2840000092983246,
            0.22599999606609344,
            0.017999999225139618,
            0.1340000033378601,
            0.1340000033378601,
            0.01600000075995922,
            0.07999999821186066,
        ],
        "magzpsci": [
            26.38237953186035,
            26.25095558166504,
            26.057918548583984,
            25.975017547607422,
            26.08490753173828,
            26.115812301635742,
            26.130022048950195,
            26.193716049194336,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.670297450941028,
            18.23528620354176,
            18.28580399353136,
            17.880204964203514,
            17.885221059900132,
            17.93164863680288,
            15.883371362435756,
            17.92725547303823,
        ],
        "dcmagerr": [
            0.0791909464641598,
            0.06793337306584203,
            0.07556816827015138,
            0.0590784856331265,
            0.10961195779634823,
            0.07994814397430444,
            0.017083043965914837,
            0.11894163004867943,
        ],
        "trajectory_id": [0, 0, 0, 0, 1, 1, 1, 1],
        "provisional designation": [
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00B",
            "K21E00B",
            "K21E00B",
            "K21E00B",
        ],
        "ref_epoch": [
            2459276.73705011,
            2459276.73705011,
            2459276.73705011,
            2459276.73705011,
            2459276.972787451,
            2459276.972787451,
            2459276.972787451,
            2459276.972787451,
        ],
        "a": [
            2.045247924877714,
            2.045247924877714,
            2.045247924877714,
            2.045247924877714,
            3.631373977515124,
            3.631373977515124,
            3.631373977515124,
            3.631373977515124,
        ],
        "e": [
            0.226628667362174,
            0.226628667362174,
            0.226628667362174,
            0.226628667362174,
            0.753720999812878,
            0.753720999812878,
            0.753720999812878,
            0.753720999812878,
        ],
        "i": [
            3.8098742126947,
            3.8098742126947,
            3.8098742126947,
            3.8098742126947,
            6.2640774176343,
            6.2640774176343,
            6.2640774176343,
            6.2640774176343,
        ],
        "long. node": [
            238.666381451279,
            238.666381451279,
            238.666381451279,
            238.666381451279,
            155.9882013723979,
            155.9882013723979,
            155.9882013723979,
            155.9882013723979,
        ],
        "arg. peric": [
            350.3792330754913,
            350.3792330754913,
            350.3792330754913,
            350.3792330754913,
            39.1867174459162,
            39.1867174459162,
            39.1867174459162,
            39.1867174459162,
        ],
        "mean anomaly": [
            292.3984747695732,
            292.3984747695732,
            292.3984747695732,
            292.3984747695732,
            357.1129429971405,
            357.1129429971405,
            357.1129429971405,
            357.1129429971405,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [False, False, False, False, False, False, False, False],
    }
)

# Test Old observations and Tracklets associations Steps in Inter night associations

old_obs_sample = pd.DataFrame(
    {
        "ra": [
            92.0087889,
            103.7587267,
            162.4834896,
            123.8027539,
            103.6863524,
            162.4600928,
            193.0789323,
        ],
        "dec": [
            40.1530657,
            44.5252852,
            15.5037062,
            40.292739,
            28.7771754,
            22.1389033,
            8.1612066,
        ],
        "ssnamenr": ["99920", "100011", "9648", "100040", "100007", "9798", "10141"],
        "jd": [
            2459276.6631134,
            2459276.664537,
            2459276.7584259,
            2459276.7780324,
            2459276.7824074,
            2459276.8375579,
            2459276.8784954,
        ],
        "fid": [2, 2, 1, 2, 2, 2, 2],
        "nid": [1522, 1522, 1522, 1522, 1522, 1522, 1522],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanxtga",
            "ZTF21aanxudg",
            "ZTF21aanzbqo",
            "ZTF21aanzivy",
            "ZTF21aanznau",
            "ZTF21aanzzqg",
            "ZTF21aaoawnr",
        ],
        "candid": [
            1522163111715015006,
            1522164530215015004,
            1522258421415015026,
            1522278032115015001,
            1522282406315015010,
            1522337556115015013,
            1522378495315015001,
        ],
        "magpsf": [
            18.949705123901367,
            19.590517044067383,
            18.48122215270996,
            17.90482521057129,
            19.103891372680664,
            16.557010650634766,
            16.666120529174805,
        ],
        "sigmapsf": [
            0.08777513355016708,
            0.11668884754180908,
            0.09149670600891113,
            0.051000598818063736,
            0.0934842973947525,
            0.03837168961763382,
            0.04247678071260452,
        ],
        "magnr": [
            20.98200035095215,
            22.591999053955078,
            22.698999404907227,
            21.69499969482422,
            22.945999145507812,
            20.839000701904297,
            22.79800033569336,
        ],
        "sigmagnr": [
            0.06199999898672104,
            0.2849999964237213,
            0.23999999463558197,
            0.1080000028014183,
            0.3619999885559082,
            0.039000000804662704,
            0.36000001430511475,
        ],
        "magzpsci": [
            26.302705764770508,
            26.18451690673828,
            26.1732234954834,
            26.3148250579834,
            26.206892013549805,
            26.07801055908203,
            26.240121841430664,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.797990408030735,
            19.51859517298127,
            18.45585679029058,
            17.87338957776582,
            19.070816915757433,
            16.532080295555772,
            16.662174736490613,
        ],
        "dcmagerr": [
            0.07675535718167358,
            0.11072679243160007,
            0.08955554492570561,
            0.049640909960709,
            0.09132759275947543,
            0.037511097269921925,
            0.04234283512121146,
        ],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
    }
)

track_sample_2 = pd.DataFrame(
    {
        "ra": [
            161.9661916,
            162.079508,
            161.9581831,
            162.0733505,
            192.7468513,
            191.2799858,
            192.7278852,
            191.2451751,
        ],
        "dec": [
            15.6892091,
            22.3057623,
            15.6919695,
            22.3083508,
            8.2857081,
            45.1262247,
            8.2924203,
            45.1288944,
        ],
        "ssnamenr": [
            "9648",
            "9798",
            "9648",
            "9798",
            "10141",
            "99956",
            "10141",
            "99956",
        ],
        "jd": [
            2459278.7617708,
            2459278.7617708,
            2459278.7919329,
            2459278.7919329,
            2459278.818588,
            2459278.8512153,
            2459278.9221875,
            2459278.9486343,
        ],
        "fid": [1, 1, 2, 2, 1, 1, 2, 2],
        "nid": [1524, 1524, 1524, 1524, 1524, 1524, 1524, 1524],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aaodryj",
            "ZTF21aaodrux",
            "ZTF21aaoejfn",
            "ZTF21aaoeior",
            "ZTF21aaoetco",
            "ZTF21aaoexoh",
            "ZTF21aaofylx",
            "ZTF21aaogfrn",
        ],
        "candid": [
            1524261770215015013,
            1524261774915015011,
            1524291930215015012,
            1524291934915015005,
            1524318581015015017,
            1524351211215015004,
            1524422181015015020,
            1524448631215015002,
        ],
        "magpsf": [
            18.48137092590332,
            17.410818099975586,
            17.688735961914062,
            16.532590866088867,
            17.310577392578125,
            18.07114601135254,
            16.649301528930664,
            17.442279815673828,
        ],
        "sigmapsf": [
            0.09166973829269409,
            0.06021394580602646,
            0.04816843941807747,
            0.031043054535984993,
            0.045813847333192825,
            0.0635342225432396,
            0.04310397803783417,
            0.05552997812628746,
        ],
        "magnr": [
            22.35300064086914,
            22.81100082397461,
            23.097999572753906,
            22.856000900268555,
            19.447999954223633,
            23.288000106811523,
            21.869998931884766,
            22.934999465942383,
        ],
        "sigmagnr": [
            0.21799999475479126,
            0.2980000078678131,
            0.3449999988079071,
            0.34599998593330383,
            0.026000000536441803,
            0.3230000138282776,
            0.12200000137090683,
            0.3479999899864197,
        ],
        "magzpsci": [
            26.158370971679688,
            26.291818618774414,
            26.182735443115234,
            26.220590591430664,
            26.34857749938965,
            26.381145477294922,
            26.23830223083496,
            26.277280807495117,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.446161166049862,
            17.403102322155167,
            17.680657883195302,
            16.529222260425907,
            17.171513405357267,
            18.062735135363535,
            16.640175162236993,
            17.43541938581569,
        ],
        "dcmagerr": [
            0.08901684272965601,
            0.05982478176648555,
            0.04787973191104046,
            0.030965445394305197,
            0.040427152330406134,
            0.06309319638211854,
            0.04275537488480032,
            0.0552237272814471,
        ],
        "trajectory_id": [5, 6, 5, 6, 4, 7, 4, 7],
        "not_updated": [True, True, True, True, True, True, True, True],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
    }
)

# - expected outputs

remaining_track_expected = pd.DataFrame(
    {
        "ra": [191.2799858, 191.2451751],
        "dec": [45.1262247, 45.1288944],
        "ssnamenr": ["99956", "99956"],
        "jd": [2459278.8512153, 2459278.9486343],
        "fid": [1, 2],
        "nid": [1524, 1524],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aaoexoh", "ZTF21aaogfrn"],
        "candid": [1524351211215015004, 1524448631215015002],
        "magpsf": [18.07114601135254, 17.442279815673828],
        "sigmapsf": [0.0635342225432396, 0.05552997812628746],
        "magnr": [23.288000106811523, 22.934999465942383],
        "sigmagnr": [0.3230000138282776, 0.3479999899864197],
        "magzpsci": [26.381145477294922, 26.277280807495117],
        "isdiffpos": ["t", "t"],
        "dcmag": [18.062735135363535, 17.43541938581569],
        "dcmagerr": [0.06309319638211854, 0.0552237272814471],
        "trajectory_id": [7, 7],
        "not_updated": [True, True],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
    }
)

remaining_old_observations_expected = pd.DataFrame(
    {
        "ra": [92.0087889, 103.7587267, 123.8027539, 103.6863524],
        "dec": [40.1530657, 44.5252852, 40.292739, 28.7771754],
        "ssnamenr": ["99920", "100011", "100040", "100007"],
        "jd": [2459276.6631134, 2459276.664537, 2459276.7780324, 2459276.7824074],
        "fid": [2, 2, 2, 2],
        "nid": [1522, 1522, 1522, 1522],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": ["ZTF21aanxtga", "ZTF21aanxudg", "ZTF21aanzivy", "ZTF21aanznau"],
        "candid": [
            1522163111715015006,
            1522164530215015004,
            1522278032115015001,
            1522282406315015010,
        ],
        "magpsf": [
            18.949705123901367,
            19.590517044067383,
            17.90482521057129,
            19.103891372680664,
        ],
        "sigmapsf": [
            0.08777513355016708,
            0.11668884754180908,
            0.051000598818063736,
            0.0934842973947525,
        ],
        "magnr": [
            20.98200035095215,
            22.591999053955078,
            21.69499969482422,
            22.945999145507812,
        ],
        "sigmagnr": [
            0.06199999898672104,
            0.2849999964237213,
            0.1080000028014183,
            0.3619999885559082,
        ],
        "magzpsci": [
            26.302705764770508,
            26.18451690673828,
            26.3148250579834,
            26.206892013549805,
        ],
        "isdiffpos": ["t", "t", "t", "t"],
        "dcmag": [
            18.797990408030735,
            19.51859517298127,
            17.87338957776582,
            19.070816915757433,
        ],
        "dcmagerr": [
            0.07675535718167358,
            0.11072679243160007,
            0.049640909960709,
            0.09132759275947543,
        ],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
    }
)

traj_orb_expected_2 = pd.DataFrame(
    {
        "ra": [
            161.9661916,
            161.9581831,
            162.4834896,
            162.079508,
            162.0733505,
            162.4600928,
            192.7468513,
            192.7278852,
            193.0789323,
        ],
        "dec": [
            15.6892091,
            15.6919695,
            15.5037062,
            22.3057623,
            22.3083508,
            22.1389033,
            8.2857081,
            8.2924203,
            8.1612066,
        ],
        "ssnamenr": [
            "9648",
            "9648",
            "9648",
            "9798",
            "9798",
            "9798",
            "10141",
            "10141",
            "10141",
        ],
        "jd": [
            2459278.7617708,
            2459278.7919329,
            2459276.7584259,
            2459278.7617708,
            2459278.7919329,
            2459276.8375579,
            2459278.818588,
            2459278.9221875,
            2459276.8784954,
        ],
        "fid": [1, 2, 1, 1, 2, 2, 1, 2, 2],
        "nid": [1524, 1524, 1522, 1524, 1524, 1522, 1524, 1524, 1522],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aaodryj",
            "ZTF21aaoejfn",
            "ZTF21aanzbqo",
            "ZTF21aaodrux",
            "ZTF21aaoeior",
            "ZTF21aanzzqg",
            "ZTF21aaoetco",
            "ZTF21aaofylx",
            "ZTF21aaoawnr",
        ],
        "candid": [
            1524261770215015013,
            1524291930215015012,
            1522258421415015026,
            1524261774915015011,
            1524291934915015005,
            1522337556115015013,
            1524318581015015017,
            1524422181015015020,
            1522378495315015001,
        ],
        "magpsf": [
            18.48137092590332,
            17.688735961914062,
            18.48122215270996,
            17.410818099975586,
            16.532590866088867,
            16.557010650634766,
            17.310577392578125,
            16.649301528930664,
            16.666120529174805,
        ],
        "sigmapsf": [
            0.09166973829269409,
            0.04816843941807747,
            0.09149670600891113,
            0.06021394580602646,
            0.031043054535984993,
            0.03837168961763382,
            0.045813847333192825,
            0.04310397803783417,
            0.04247678071260452,
        ],
        "magnr": [
            22.35300064086914,
            23.097999572753906,
            22.698999404907227,
            22.81100082397461,
            22.856000900268555,
            20.839000701904297,
            19.447999954223633,
            21.869998931884766,
            22.79800033569336,
        ],
        "sigmagnr": [
            0.21799999475479126,
            0.3449999988079071,
            0.23999999463558197,
            0.2980000078678131,
            0.34599998593330383,
            0.039000000804662704,
            0.026000000536441803,
            0.12200000137090683,
            0.36000001430511475,
        ],
        "magzpsci": [
            26.158370971679688,
            26.182735443115234,
            26.1732234954834,
            26.291818618774414,
            26.220590591430664,
            26.07801055908203,
            26.34857749938965,
            26.23830223083496,
            26.240121841430664,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.446161166049862,
            17.680657883195302,
            18.45585679029058,
            17.403102322155167,
            16.529222260425907,
            16.532080295555772,
            17.171513405357267,
            16.640175162236993,
            16.662174736490613,
        ],
        "dcmagerr": [
            0.08901684272965601,
            0.04787973191104046,
            0.08955554492570561,
            0.05982478176648555,
            0.030965445394305197,
            0.037511097269921925,
            0.040427152330406134,
            0.04275537488480032,
            0.04234283512121146,
        ],
        "trajectory_id": [5, 5, 5, 6, 6, 6, 4, 4, 4],
        "not_updated": [False, False, False, False, False, False, False, False, False],
        "provisional designation": [
            "K21E00F",
            "K21E00F",
            "K21E00F",
            "K21E00G",
            "K21E00G",
            "K21E00G",
            "K21E00E",
            "K21E00E",
            "K21E00E",
        ],
        "ref_epoch": [
            2459278.726063516,
            2459278.726063516,
            2459278.726063516,
            2459278.724601283,
            2459278.724601283,
            2459278.724601283,
            2459278.773746477,
            2459278.773746477,
            2459278.773746477,
        ],
        "a": [
            2.3707418113470933,
            2.3707418113470933,
            2.3707418113470933,
            1.792450345712722,
            1.792450345712722,
            1.792450345712722,
            1.7215158936547512,
            1.7215158936547512,
            1.7215158936547512,
        ],
        "e": [
            0.779980097563079,
            0.779980097563079,
            0.779980097563079,
            0.494532176023262,
            0.494532176023262,
            0.494532176023262,
            0.314683773493673,
            0.314683773493673,
            0.314683773493673,
        ],
        "i": [
            6.1345978178853,
            6.1345978178853,
            6.1345978178853,
            6.4523305836603,
            6.4523305836603,
            6.4523305836603,
            3.2251129938703,
            3.2251129938703,
            3.2251129938703,
        ],
        "long. node": [
            159.6236681266895,
            159.6236681266895,
            159.6236681266895,
            131.3217210296768,
            131.3217210296768,
            131.3217210296768,
            78.7179359722708,
            78.7179359722708,
            78.7179359722708,
        ],
        "arg. peric": [
            265.3835827797645,
            265.3835827797645,
            265.3835827797645,
            305.5851330080031,
            305.5851330080031,
            305.5851330080031,
            39.9884068173304,
            39.9884068173304,
            39.9884068173304,
        ],
        "mean anomaly": [
            13.3275505526146,
            13.3275505526146,
            13.3275505526146,
            32.895438876027,
            32.895438876027,
            32.895438876027,
            27.3335771675384,
            27.3335771675384,
            27.3335771675384,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
    }
)


# Test night_to_night_association

trajectory_df_1 = pd.DataFrame(
    {
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True],
        "trajectory_id": [0, 0, 0, 0],
        "ra": [232.2341868, 229.1117136, 225.6399955, 224.1634648],
        "dec": [-19.3694842, -18.7584283, -17.98425, -17.6336513],
        "ssnamenr": ["64580", "64580", "64580", "64580"],
        "jd": [2459329.7716204, 2459345.8568634, 2459363.834375, 2459373.7345139],
        "fid": [2.0, 1.0, 2.0, 2.0],
        "nid": [1575.0, 1591.0, 1609.0, 1619.0],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": ["ZTF21aaxkiar", "ZTF21abausam", "ZTF21abctzom", "ZTF21abexdou"],
        "candid": [
            1.575271621215015e18,
            1.591356862315015e18,
            1.609334372615015e18,
            1.619234511615015e18,
        ],
        "magpsf": [
            19.092945098876953,
            19.17802619934082,
            19.020505905151367,
            19.378360748291016,
        ],
        "sigmapsf": [
            0.2158745676279068,
            0.0965801477432251,
            0.13174483180046082,
            0.18420521914958954,
        ],
        "magnr": [
            19.410999298095703,
            19.062000274658203,
            20.928998947143555,
            22.014999389648438,
        ],
        "sigmagnr": [
            0.023000000044703484,
            0.03400000184774399,
            0.07000000029802322,
            0.2240000069141388,
        ],
        "magzpsci": [
            26.123945236206055,
            26.182025909423828,
            26.267505645751953,
            26.200359344482422,
        ],
        "isdiffpos": ["t", "t", "t", "t"],
        "dcmag": [
            18.420662169461323,
            18.288246458485204,
            18.846686864667113,
            19.280371183840067,
        ],
        "dcmagerr": [
            0.11670594902127972,
            0.04661359940750083,
            0.11273170545876375,
            0.16941500452233074,
        ],
    }
)

old_observation_1 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

new_observation_1 = pd.DataFrame(
    {
        "ra": [223.6981941],
        "dec": [-17.5222626],
        "ssnamenr": ["64580"],
        "jd": [2459377.7514468],
        "fid": [2],
        "nid": [1623],
        "fink_class": ["Solar System MPC"],
        "objectId": ["ZTF21abftjdf"],
        "candid": [1623251441615015013],
        "magpsf": [19.393381118774414],
        "sigmapsf": [0.15704740583896637],
        "magnr": [18.89900016784668],
        "sigmagnr": [0.019999999552965164],
        "magzpsci": [26.21238136291504],
        "isdiffpos": ["t"],
        "dcmag": [18.326972606767193],
        "dcmagerr": [0.060128034429116364],
        "provisional designation": [-1.0],
        "ref_epoch": [-1.0],
        "a": [-1.0],
        "e": [-1.0],
        "i": [-1.0],
        "long. node": [-1.0],
        "arg. peric": [-1.0],
        "mean anomaly": [-1.0],
        "rms_a": [-1.0],
        "rms_e": [-1.0],
        "rms_i": [-1.0],
        "rms_long. node": [-1.0],
        "rms_arg. peric": [-1.0],
        "rms_mean anomaly": [-1.0],
        "not_updated": [True],
        "trajectory_id": [-1.0],
    }
)

trajectory_df_2 = pd.DataFrame(
    {
        "ra": [179.1879857, 179.2238741],
        "dec": [64.4537652, 64.3186296],
        "ssnamenr": ["2017SE19", "2017SE19"],
        "jd": [2459276.7421759, 2459276.8492708],
        "fid": [1, 2],
        "nid": [1522, 1522],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aanyvka", "ZTF21aaoadpx"],
        "candid": [1522242175915015017, 1522349275915015009],
        "magpsf": [18.811309814453125, 18.166519165039062],
        "sigmapsf": [0.09543465077877045, 0.06866215914487839],
        "magnr": [22.988000869750977, 22.492000579833984],
        "sigmagnr": [0.3479999899864197, 0.18199999630451202],
        "magzpsci": [26.342309951782227, 26.28152084350586],
        "isdiffpos": ["t", "t"],
        "dcmag": [18.788736186167718, 18.146615338868997],
        "dcmagerr": [0.0937448233135806, 0.06749592086393852],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [0, 0],
    }
)

old_observation_2 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

new_observation_2 = pd.DataFrame(
    {
        "ra": [180.570757, 180.5827225],
        "dec": [59.4718195, 59.3651274],
        "ssnamenr": ["2017SE19", "2017SE19"],
        "jd": [2459280.7750231, 2459280.8664931],
        "fid": [2, 1],
        "nid": [1526, 1526],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aaomjlk", "ZTF21aaopcpj"],
        "candid": [1526275020515015007, 1526366490515015007],
        "magpsf": [18.269437789916992, 18.94061851501465],
        "sigmapsf": [0.07619858533143997, 0.07713817805051804],
        "magnr": [22.566999435424805, 21.913000106811523],
        "sigmagnr": [0.28200000524520874, 0.09200000017881393],
        "magzpsci": [26.31043815612793, 26.413618087768555],
        "isdiffpos": ["t", "t"],
        "dcmag": [18.249552076041237, 18.877713861153353],
        "dcmagerr": [0.07499052693624493, 0.07297997798239418],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [-1.0, -1.0],
    }
)

trajectory_df_3 = pd.DataFrame(
    {
        "ra": [179.1879857, 179.2238741, 180.570757, 180.5827225, 181.8514115],
        "dec": [64.4537652, 64.3186296, 59.4718195, 59.3651274, 47.8395695],
        "ssnamenr": ["2017SE19", "2017SE19", "2017SE19", "2017SE19", "2017SE19"],
        "jd": [
            2459276.7421759,
            2459276.8492708,
            2459280.7750231,
            2459280.8664931,
            2459291.781875,
        ],
        "fid": [1.0, 2.0, 2.0, 1.0, 1.0],
        "nid": [1522.0, 1522.0, 1526.0, 1526.0, 1537.0],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanyvka",
            "ZTF21aaoadpx",
            "ZTF21aaomjlk",
            "ZTF21aaopcpj",
            "ZTF21aapqwag",
        ],
        "candid": [
            1.522242175915015e18,
            1.522349275915015e18,
            1.526275020515015e18,
            1.526366490515015e18,
            1.537281874715015e18,
        ],
        "magpsf": [
            18.811309814453125,
            18.166519165039062,
            18.269437789916992,
            18.94061851501465,
            19.183595657348633,
        ],
        "sigmapsf": [
            0.09543465077877045,
            0.06866215914487839,
            0.07619858533143997,
            0.07713817805051804,
            0.07974370568990707,
        ],
        "magnr": [
            22.988000869750977,
            22.492000579833984,
            22.566999435424805,
            21.913000106811523,
            22.934999465942383,
        ],
        "sigmagnr": [
            0.3479999899864197,
            0.18199999630451202,
            0.28200000524520874,
            0.09200000017881393,
            0.2639999985694885,
        ],
        "magzpsci": [
            26.342309951782227,
            26.28152084350586,
            26.31043815612793,
            26.413618087768555,
            26.379596710205078,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t"],
        "dcmag": [
            18.788736186167718,
            18.146615338868997,
            18.249552076041237,
            18.877713861153353,
            19.15146773195843,
        ],
        "dcmagerr": [
            0.0937448233135806,
            0.06749592086393852,
            0.07499052693624493,
            0.07297997798239418,
            0.0778003211595225,
        ],
        "provisional designation": [
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00A",
        ],
        "ref_epoch": [
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
        ],
        "a": [
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
        ],
        "e": [
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
        ],
        "i": [
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
        ],
        "long. node": [
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
        ],
        "arg. peric": [
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
        ],
        "mean anomaly": [
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True, True],
        "trajectory_id": [0, 0, 0, 0, 0],
    }
)

old_observation_3 = pd.DataFrame(
    {
        "ra": [181.931075],
        "dec": [45.9650565],
        "ssnamenr": ["2017SE19"],
        "jd": [2459293.804456],
        "fid": [1],
        "nid": [1539],
        "fink_class": ["Solar System MPC"],
        "objectId": ["ZTF21aaqikoo"],
        "candid": [1539304453115015016],
        "magpsf": [19.371646881103516],
        "sigmapsf": [0.1383635401725769],
        "magnr": [23.24799919128418],
        "sigmagnr": [0.33500000834465027],
        "magzpsci": [26.335647583007812],
        "isdiffpos": ["t"],
        "dcmag": [19.34179712858365],
        "dcmagerr": [0.13491757573154542],
        "provisional designation": [-1.0],
        "ref_epoch": [-1.0],
        "a": [-1.0],
        "e": [-1.0],
        "i": [-1.0],
        "long. node": [-1.0],
        "arg. peric": [-1.0],
        "mean anomaly": [-1.0],
        "rms_a": [-1.0],
        "rms_e": [-1.0],
        "rms_i": [-1.0],
        "rms_long. node": [-1.0],
        "rms_arg. peric": [-1.0],
        "rms_mean anomaly": [-1.0],
        "not_updated": [True],
        "trajectory_id": [-1.0],
    }
)

new_observation_3 = pd.DataFrame(
    {
        "ra": [182.2518899, 182.2517747],
        "dec": [36.9173521, 36.9113943],
        "ssnamenr": ["2017SE19", "2017SE19"],
        "jd": [2459304.7972569, 2459304.8051852],
        "fid": [2, 2],
        "nid": [1550, 1550],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aareokk", "ZTF21aarerdi"],
        "candid": [1550297251015015008, 1550305185215015001],
        "magpsf": [19.162599563598633, 19.02241325378418],
        "sigmapsf": [0.16024233400821686, 0.12882009148597717],
        "magnr": [23.09600067138672, 22.722999572753906],
        "sigmagnr": [0.2720000147819519, 0.2070000022649765],
        "magzpsci": [26.19659996032715, 26.209413528442383],
        "isdiffpos": ["t", "t"],
        "dcmag": [19.13186950523745, 18.984898693049793],
        "dcmagerr": [0.1559553421506885, 0.12464350904855288],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [-1.0, -1.0],
    }
)

trajectory_df_4 = pd.DataFrame(
    {
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

old_observation_4 = pd.DataFrame(
    {
        "ra": [150.2767428],
        "dec": [29.6432911],
        "ssnamenr": ["107951"],
        "jd": [2459274.8828472],
        "fid": [2],
        "nid": [1520],
        "fink_class": ["Solar System MPC"],
        "objectId": ["ZTF21aanrpmx"],
        "candid": [1520382840715015005],
        "magpsf": [18.91179847717285],
        "sigmapsf": [0.16078680753707886],
        "magnr": [22.88599967956543],
        "sigmagnr": [0.2849999964237213],
        "magzpsci": [26.24679946899414],
        "isdiffpos": ["t"],
        "dcmag": [18.883507138530334],
        "dcmagerr": [0.1568226716835336],
        "provisional designation": [-1.0],
        "ref_epoch": [-1.0],
        "a": [-1.0],
        "e": [-1.0],
        "i": [-1.0],
        "long. node": [-1.0],
        "arg. peric": [-1.0],
        "mean anomaly": [-1.0],
        "rms_a": [-1.0],
        "rms_e": [-1.0],
        "rms_i": [-1.0],
        "rms_long. node": [-1.0],
        "rms_arg. peric": [-1.0],
        "rms_mean anomaly": [-1.0],
        "not_updated": [-1.0],
        "trajectory_id": [-1.0],
    }
)

new_observation_4 = pd.DataFrame(
    {
        "ra": [150.0755966, 150.0461002],
        "dec": [29.657104, 29.658911],
        "ssnamenr": ["107951", "107951"],
        "jd": [2459275.7066204, 2459275.8239583],
        "fid": [1, 2],
        "nid": [1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantyqu", "ZTF21aanvhpk"],
        "candid": [1521206625615015004, 1521323955615015004],
        "magpsf": [19.61456871032715, 19.14607048034668],
        "sigmapsf": [0.17709490656852722, 0.1350758671760559],
        "magnr": [22.579999923706055, 22.739999771118164],
        "sigmagnr": [0.33799999952316284, 0.3149999976158142],
        "magzpsci": [26.359567642211914, 26.265071868896484],
        "isdiffpos": ["t", "t"],
        "dcmag": [19.548137703415094, 19.10678402261543],
        "dcmagerr": [0.1677876844765026, 0.13075569292812592],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [-1.0, -1.0],
    }
)

trajectory_df_5 = pd.DataFrame(
    {
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

old_observation_5 = pd.DataFrame(
    {
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
        "nid": [],
    }
)

new_observation_5 = pd.DataFrame(
    {
        "ra": [150.0755966, 150.0461002],
        "dec": [29.657104, 29.658911],
        "ssnamenr": ["107951", "107951"],
        "jd": [2459275.7066204, 2459275.8239583],
        "fid": [1, 2],
        "nid": [1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantyqu", "ZTF21aanvhpk"],
        "candid": [1521206625615015004, 1521323955615015004],
        "magpsf": [19.61456871032715, 19.14607048034668],
        "sigmapsf": [0.17709490656852722, 0.1350758671760559],
        "magnr": [22.579999923706055, 22.739999771118164],
        "sigmagnr": [0.33799999952316284, 0.3149999976158142],
        "magzpsci": [26.359567642211914, 26.265071868896484],
        "isdiffpos": ["t", "t"],
        "dcmag": [19.548137703415094, 19.10678402261543],
        "dcmagerr": [0.1677876844765026, 0.13075569292812592],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [-1.0, -1.0],
    }
)

new_observation_6 = pd.DataFrame(
    {
        "ra": [109.6396459, 95.2193295, 253.3348862],
        "dec": [25.9449035, 26.6148543, -17.4185314],
        "ssnamenr": ["104", "10207", "968"],
        "jd": [2459275.6721065, 2459275.7482407, 2459275.9837384],
        "fid": [1, 2, 1],
        "nid": [1521, 1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantoba", "ZTF21aanumhy", "ZTF21aanwlbu"],
        "candid": [1521172102915015000, 1521248243515015012, 1521483732815015002],
        "magpsf": [13.17834758758545, 18.19043731689453, 16.02326011657715],
        "sigmapsf": [0.02265007793903351, 0.0796399712562561, 0.031096111983060837],
        "magnr": [22.445999145507812, 22.268999099731445, 20.648000717163086],
        "sigmagnr": [0.23199999332427979, 0.2770000100135803, 0.07699999958276749],
        "magzpsci": [26.360347747802734, 26.35443878173828, 26.164260864257812],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [14.35973511234515, 18.167110771136397, 16.005616394386976],
        "dcmagerr": [0.02263767934691149, 0.07816924152753131, 0.030620034981926652],
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
        "not_updated": [True, True, True],
        "trajectory_id": [-1.0, -1.0, -1.0],
    }
)

old_observation_6 = pd.DataFrame(
    {
        "ra": [109.6370802, 95.1293755, 253.099651],
        "dec": [25.9631427, 26.6712457, -17.4600157],
        "ssnamenr": ["104", "10207", "968"],
        "jd": [2459274.66625, 2459274.7565741, 2459274.9812963],
        "fid": [1, 2, 1],
        "nid": [1520, 1520, 1520],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aanqmdh", "ZTF21aanqxgh", "ZTF21aanrvcs"],
        "candid": [1520166251615015000, 1520256574615015010, 1520481292815015007],
        "magpsf": [13.194306373596191, 18.275035858154297, 16.058544158935547],
        "sigmapsf": [0.017068419605493546, 0.12942494451999664, 0.037365127354860306],
        "magnr": [22.93899917602539, 22.70599937438965, 22.2450008392334],
        "sigmagnr": [0.3580000102519989, 0.3610000014305115, 0.257999986410141],
        "magzpsci": [26.317306518554688, 26.312036514282227, 26.140544891357422],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [14.31691743145683, 18.257456472779257, 16.0542382758845],
        "dcmagerr": [0.01706278616994172, 0.12747819103055866, 0.03723124251898085],
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
        "not_updated": [-1.0, -1.0, -1.0],
        "trajectory_id": [-1.0, -1.0, -1.0],
    }
)

new_observation_7 = pd.DataFrame(
    {
        "ra": [109.6396459, 95.2193295, 253.3348862],
        "dec": [25.9449035, 26.6148543, -17.4185314],
        "ssnamenr": ["104", "10207", "968"],
        "jd": [2459275.6721065, 2459275.7482407, 2459275.9837384],
        "fid": [1, 2, 1],
        "nid": [1521, 1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantoba", "ZTF21aanumhy", "ZTF21aanwlbu"],
        "candid": [1521172102915015000, 1521248243515015012, 1521483732815015002],
        "magpsf": [13.17834758758545, 18.19043731689453, 16.02326011657715],
        "sigmapsf": [0.02265007793903351, 0.0796399712562561, 0.031096111983060837],
        "magnr": [22.445999145507812, 22.268999099731445, 20.648000717163086],
        "sigmagnr": [0.23199999332427979, 0.2770000100135803, 0.07699999958276749],
        "magzpsci": [26.360347747802734, 26.35443878173828, 26.164260864257812],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [14.35973511234515, 18.167110771136397, 16.005616394386976],
        "dcmagerr": [0.02263767934691149, 0.07816924152753131, 0.030620034981926652],
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
        "not_updated": [True, True, True],
        "trajectory_id": [-1.0, -1.0, -1.0],
    }
)

# - expected outputs

trajectory_df_expected_1 = pd.DataFrame(
    {
        "provisional designation": [
            "K21H00A",
            "K21H00A",
            "K21H00A",
            "K21H00A",
            "K21H00A",
        ],
        "ref_epoch": [
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
            2459345.797868819,
        ],
        "a": [
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
            3.146290451465606,
        ],
        "e": [
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
            0.092386374483295,
        ],
        "i": [
            1.607049951428,
            1.607049951428,
            1.607049951428,
            1.607049951428,
            1.607049951428,
        ],
        "long. node": [
            37.54350205425,
            37.54350205425,
            37.54350205425,
            37.54350205425,
            37.54350205425,
        ],
        "arg. peric": [
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
            166.8803952053398,
        ],
        "mean anomaly": [
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
            22.3686256246004,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True, True],
        "trajectory_id": [0, 0, 0, 0, 0],
        "ra": [232.2341868, 229.1117136, 225.6399955, 224.1634648, 223.6981941],
        "dec": [-19.3694842, -18.7584283, -17.98425, -17.6336513, -17.5222626],
        "ssnamenr": ["64580", "64580", "64580", "64580", "64580"],
        "jd": [
            2459329.7716204,
            2459345.8568634,
            2459363.834375,
            2459373.7345139,
            2459377.7514468,
        ],
        "fid": [2.0, 1.0, 2.0, 2.0, 2.0],
        "nid": [1575.0, 1591.0, 1609.0, 1619.0, 1623.0],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aaxkiar",
            "ZTF21abausam",
            "ZTF21abctzom",
            "ZTF21abexdou",
            "ZTF21abftjdf",
        ],
        "candid": [
            1.575271621215015e18,
            1.591356862315015e18,
            1.609334372615015e18,
            1.619234511615015e18,
            1.623251441615015e18,
        ],
        "magpsf": [
            19.092945098876953,
            19.17802619934082,
            19.020505905151367,
            19.378360748291016,
            19.393381118774414,
        ],
        "sigmapsf": [
            0.2158745676279068,
            0.0965801477432251,
            0.13174483180046082,
            0.18420521914958954,
            0.15704740583896637,
        ],
        "magnr": [
            19.410999298095703,
            19.062000274658203,
            20.928998947143555,
            22.014999389648438,
            18.89900016784668,
        ],
        "sigmagnr": [
            0.023000000044703484,
            0.03400000184774399,
            0.07000000029802322,
            0.2240000069141388,
            0.019999999552965164,
        ],
        "magzpsci": [
            26.123945236206055,
            26.182025909423828,
            26.267505645751953,
            26.200359344482422,
            26.21238136291504,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t"],
        "dcmag": [
            18.420662169461323,
            18.288246458485204,
            18.846686864667113,
            19.280371183840067,
            18.326972606767193,
        ],
        "dcmagerr": [
            0.11670594902127972,
            0.04661359940750083,
            0.11273170545876375,
            0.16941500452233074,
            0.060128034429116364,
        ],
    }
)

old_observation_expected_1 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

trajectory_df_expected_2 = pd.DataFrame(
    {
        "ra": [179.1879857, 179.2238741, 180.570757, 180.5827225],
        "dec": [64.4537652, 64.3186296, 59.4718195, 59.3651274],
        "ssnamenr": ["2017SE19", "2017SE19", "2017SE19", "2017SE19"],
        "jd": [2459276.7421759, 2459276.8492708, 2459280.7750231, 2459280.8664931],
        "fid": [1, 2, 2, 1],
        "nid": [1522, 1522, 1526, 1526],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": ["ZTF21aanyvka", "ZTF21aaoadpx", "ZTF21aaomjlk", "ZTF21aaopcpj"],
        "candid": [
            1522242175915015017,
            1522349275915015009,
            1526275020515015007,
            1526366490515015007,
        ],
        "magpsf": [
            18.811309814453125,
            18.166519165039062,
            18.269437789916992,
            18.94061851501465,
        ],
        "sigmapsf": [
            0.09543465077877045,
            0.06866215914487839,
            0.07619858533143997,
            0.07713817805051804,
        ],
        "magnr": [
            22.988000869750977,
            22.492000579833984,
            22.566999435424805,
            21.913000106811523,
        ],
        "sigmagnr": [
            0.3479999899864197,
            0.18199999630451202,
            0.28200000524520874,
            0.09200000017881393,
        ],
        "magzpsci": [
            26.342309951782227,
            26.28152084350586,
            26.31043815612793,
            26.413618087768555,
        ],
        "isdiffpos": ["t", "t", "t", "t"],
        "dcmag": [
            18.788736186167718,
            18.146615338868997,
            18.249552076041237,
            18.877713861153353,
        ],
        "dcmagerr": [
            0.0937448233135806,
            0.06749592086393852,
            0.07499052693624493,
            0.07297997798239418,
        ],
        "provisional designation": [-1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True],
        "trajectory_id": [0, 0, 0, 0],
    }
)

old_observation_expected_2 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

trajectory_df_expected_3 = pd.DataFrame(
    {
        "ra": [
            179.1879857,
            179.2238741,
            180.570757,
            180.5827225,
            181.8514115,
            182.2518899,
            182.2517747,
            181.931075,
        ],
        "dec": [
            64.4537652,
            64.3186296,
            59.4718195,
            59.3651274,
            47.8395695,
            36.9173521,
            36.9113943,
            45.9650565,
        ],
        "ssnamenr": [
            "2017SE19",
            "2017SE19",
            "2017SE19",
            "2017SE19",
            "2017SE19",
            "2017SE19",
            "2017SE19",
            "2017SE19",
        ],
        "jd": [
            2459276.7421759,
            2459276.8492708,
            2459280.7750231,
            2459280.8664931,
            2459291.781875,
            2459304.7972569,
            2459304.8051852,
            2459293.804456,
        ],
        "fid": [1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0, 1.0],
        "nid": [1522.0, 1522.0, 1526.0, 1526.0, 1537.0, 1550.0, 1550.0, 1539.0],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanyvka",
            "ZTF21aaoadpx",
            "ZTF21aaomjlk",
            "ZTF21aaopcpj",
            "ZTF21aapqwag",
            "ZTF21aareokk",
            "ZTF21aarerdi",
            "ZTF21aaqikoo",
        ],
        "candid": [
            1.522242175915015e18,
            1.522349275915015e18,
            1.526275020515015e18,
            1.526366490515015e18,
            1.537281874715015e18,
            1.550297251015015e18,
            1.550305185215015e18,
            1.539304453115015e18,
        ],
        "magpsf": [
            18.811309814453125,
            18.166519165039062,
            18.269437789916992,
            18.94061851501465,
            19.183595657348633,
            19.162599563598633,
            19.02241325378418,
            19.371646881103516,
        ],
        "sigmapsf": [
            0.09543465077877045,
            0.06866215914487839,
            0.07619858533143997,
            0.07713817805051804,
            0.07974370568990707,
            0.16024233400821686,
            0.12882009148597717,
            0.1383635401725769,
        ],
        "magnr": [
            22.988000869750977,
            22.492000579833984,
            22.566999435424805,
            21.913000106811523,
            22.934999465942383,
            23.09600067138672,
            22.722999572753906,
            23.24799919128418,
        ],
        "sigmagnr": [
            0.3479999899864197,
            0.18199999630451202,
            0.28200000524520874,
            0.09200000017881393,
            0.2639999985694885,
            0.2720000147819519,
            0.2070000022649765,
            0.33500000834465027,
        ],
        "magzpsci": [
            26.342309951782227,
            26.28152084350586,
            26.31043815612793,
            26.413618087768555,
            26.379596710205078,
            26.19659996032715,
            26.209413528442383,
            26.335647583007812,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t", "t", "t"],
        "dcmag": [
            18.788736186167718,
            18.146615338868997,
            18.249552076041237,
            18.877713861153353,
            19.15146773195843,
            19.13186950523745,
            18.984898693049793,
            19.34179712858365,
        ],
        "dcmagerr": [
            0.0937448233135806,
            0.06749592086393852,
            0.07499052693624493,
            0.07297997798239418,
            0.0778003211595225,
            0.1559553421506885,
            0.12464350904855288,
            0.13491757573154542,
        ],
        "provisional designation": [
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00A",
            "K21E00A",
            -1.0,
            -1.0,
            -1.0,
        ],
        "ref_epoch": [
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
            2459280.81577236,
            -1.0,
            -1.0,
            -1.0,
        ],
        "a": [
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
            2.3368920945394014,
            -1.0,
            -1.0,
            -1.0,
        ],
        "e": [
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
            0.571190342465051,
            -1.0,
            -1.0,
            -1.0,
        ],
        "i": [
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
            9.2867023919892,
            -1.0,
            -1.0,
            -1.0,
        ],
        "long. node": [
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
            86.9347716116804,
            -1.0,
            -1.0,
            -1.0,
        ],
        "arg. peric": [
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
            29.7195461716035,
            -1.0,
            -1.0,
            -1.0,
        ],
        "mean anomaly": [
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
            11.6679371900858,
            -1.0,
            -1.0,
            -1.0,
        ],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True, True, True, True, True],
        "trajectory_id": [0, 0, 0, 0, 0, 1, 1, 1],
    }
)

old_observation_expected_3 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

trajectory_df_expected_4 = pd.DataFrame(
    {
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
        "not_updated": [True, True, True],
        "trajectory_id": [0, 0, 0],
        "ra": [150.0755966, 150.0461002, 150.2767428],
        "dec": [29.657104, 29.658911, 29.6432911],
        "ssnamenr": ["107951", "107951", "107951"],
        "jd": [2459275.7066204, 2459275.8239583, 2459274.8828472],
        "fid": [1.0, 2.0, 2.0],
        "nid": [1521.0, 1521.0, 1520.0],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantyqu", "ZTF21aanvhpk", "ZTF21aanrpmx"],
        "candid": [1.521206625615015e18, 1.521323955615015e18, 1.520382840715015e18],
        "magpsf": [19.61456871032715, 19.14607048034668, 18.91179847717285],
        "sigmapsf": [0.17709490656852722, 0.1350758671760559, 0.16078680753707886],
        "magnr": [22.579999923706055, 22.739999771118164, 22.88599967956543],
        "sigmagnr": [0.33799999952316284, 0.3149999976158142, 0.2849999964237213],
        "magzpsci": [26.359567642211914, 26.265071868896484, 26.24679946899414],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [19.548137703415094, 19.10678402261543, 18.883507138530334],
        "dcmagerr": [0.1677876844765026, 0.13075569292812592, 0.1568226716835336],
    }
)

old_observation_expected_4 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

trajectory_df_expected_5 = pd.DataFrame(
    {
        "ra": [150.0755966, 150.0461002],
        "dec": [29.657104, 29.658911],
        "ssnamenr": ["107951", "107951"],
        "jd": [2459275.7066204, 2459275.8239583],
        "fid": [1, 2],
        "nid": [1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantyqu", "ZTF21aanvhpk"],
        "candid": [1521206625615015004, 1521323955615015004],
        "magpsf": [19.61456871032715, 19.14607048034668],
        "sigmapsf": [0.17709490656852722, 0.1350758671760559],
        "magnr": [22.579999923706055, 22.739999771118164],
        "sigmagnr": [0.33799999952316284, 0.3149999976158142],
        "magzpsci": [26.359567642211914, 26.265071868896484],
        "isdiffpos": ["t", "t"],
        "dcmag": [19.548137703415094, 19.10678402261543],
        "dcmagerr": [0.1677876844765026, 0.13075569292812592],
        "provisional designation": [-1.0, -1.0],
        "ref_epoch": [-1.0, -1.0],
        "a": [-1.0, -1.0],
        "e": [-1.0, -1.0],
        "i": [-1.0, -1.0],
        "long. node": [-1.0, -1.0],
        "arg. peric": [-1.0, -1.0],
        "mean anomaly": [-1.0, -1.0],
        "rms_a": [-1.0, -1.0],
        "rms_e": [-1.0, -1.0],
        "rms_i": [-1.0, -1.0],
        "rms_long. node": [-1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0],
        "not_updated": [True, True],
        "trajectory_id": [0, 0],
    }
)

old_observation_expected_5 = pd.DataFrame(
    {
        "ra": [],
        "dec": [],
        "ssnamenr": [],
        "jd": [],
        "fid": [],
        "nid": [],
        "fink_class": [],
        "objectId": [],
        "candid": [],
        "magpsf": [],
        "sigmapsf": [],
        "magnr": [],
        "sigmagnr": [],
        "magzpsci": [],
        "isdiffpos": [],
        "dcmag": [],
        "dcmagerr": [],
        "provisional designation": [],
        "ref_epoch": [],
        "a": [],
        "e": [],
        "i": [],
        "long. node": [],
        "arg. peric": [],
        "mean anomaly": [],
        "rms_a": [],
        "rms_e": [],
        "rms_i": [],
        "rms_long. node": [],
        "rms_arg. peric": [],
        "rms_mean anomaly": [],
        "not_updated": [],
        "trajectory_id": [],
    }
)

old_observation_expected_6 = pd.DataFrame(
    {
        "ra": [109.6396459, 95.2193295, 253.3348862],
        "dec": [25.9449035, 26.6148543, -17.4185314],
        "ssnamenr": ["104", "10207", "968"],
        "jd": [2459275.6721065, 2459275.7482407, 2459275.9837384],
        "fid": [1, 2, 1],
        "nid": [1521, 1521, 1521],
        "fink_class": ["Solar System MPC", "Solar System MPC", "Solar System MPC"],
        "objectId": ["ZTF21aantoba", "ZTF21aanumhy", "ZTF21aanwlbu"],
        "candid": [1521172102915015000, 1521248243515015012, 1521483732815015002],
        "magpsf": [13.17834758758545, 18.19043731689453, 16.02326011657715],
        "sigmapsf": [0.02265007793903351, 0.0796399712562561, 0.031096111983060837],
        "magnr": [22.445999145507812, 22.268999099731445, 20.648000717163086],
        "sigmagnr": [0.23199999332427979, 0.2770000100135803, 0.07699999958276749],
        "magzpsci": [26.360347747802734, 26.35443878173828, 26.164260864257812],
        "isdiffpos": ["t", "t", "t"],
        "dcmag": [14.35973511234515, 18.167110771136397, 16.005616394386976],
        "dcmagerr": [0.02263767934691149, 0.07816924152753131, 0.030620034981926652],
        "provisional designation": [-1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0],
        "not_updated": [True, True, True],
        "trajectory_id": [-1.0, -1.0, -1.0],
    }
)

trajectory_df_expected_6 = pd.DataFrame(
    {
        "provisional designation": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "ref_epoch": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_a": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_e": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_i": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_long. node": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_arg. peric": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "rms_mean anomaly": [-1.0, -1.0, -1.0, -1.0, -1.0, -1.0],
        "not_updated": [True, True, True, True, True, True],
        "trajectory_id": [0, 1, 2, 0, 1, 2],
        "ra": [
            109.6370802,
            95.1293755,
            253.099651,
            109.6396459,
            95.2193295,
            253.3348862,
        ],
        "dec": [
            25.9631427,
            26.6712457,
            -17.4600157,
            25.9449035,
            26.6148543,
            -17.4185314,
        ],
        "ssnamenr": ["104", "10207", "968", "104", "10207", "968"],
        "jd": [
            2459274.66625,
            2459274.7565741,
            2459274.9812963,
            2459275.6721065,
            2459275.7482407,
            2459275.9837384,
        ],
        "fid": [1.0, 2.0, 1.0, 1.0, 2.0, 1.0],
        "nid": [1520.0, 1520.0, 1520.0, 1521.0, 1521.0, 1521.0],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aanqmdh",
            "ZTF21aanqxgh",
            "ZTF21aanrvcs",
            "ZTF21aantoba",
            "ZTF21aanumhy",
            "ZTF21aanwlbu",
        ],
        "candid": [
            1.520166251615015e18,
            1.520256574615015e18,
            1.520481292815015e18,
            1.521172102915015e18,
            1.521248243515015e18,
            1.521483732815015e18,
        ],
        "magpsf": [
            13.194306373596191,
            18.275035858154297,
            16.058544158935547,
            13.17834758758545,
            18.19043731689453,
            16.02326011657715,
        ],
        "sigmapsf": [
            0.017068419605493546,
            0.12942494451999664,
            0.037365127354860306,
            0.02265007793903351,
            0.0796399712562561,
            0.031096111983060837,
        ],
        "magnr": [
            22.93899917602539,
            22.70599937438965,
            22.2450008392334,
            22.445999145507812,
            22.268999099731445,
            20.648000717163086,
        ],
        "sigmagnr": [
            0.3580000102519989,
            0.3610000014305115,
            0.257999986410141,
            0.23199999332427979,
            0.2770000100135803,
            0.07699999958276749,
        ],
        "magzpsci": [
            26.317306518554688,
            26.312036514282227,
            26.140544891357422,
            26.360347747802734,
            26.35443878173828,
            26.164260864257812,
        ],
        "isdiffpos": ["t", "t", "t", "t", "t", "t"],
        "dcmag": [
            14.31691743145683,
            18.257456472779257,
            16.0542382758845,
            14.35973511234515,
            18.167110771136397,
            16.005616394386976,
        ],
        "dcmagerr": [
            0.01706278616994172,
            0.12747819103055866,
            0.03723124251898085,
            0.02263767934691149,
            0.07816924152753131,
            0.030620034981926652,
        ],
    }
)

test_time_window = pd.DataFrame(
    {
        "trajectory_id": [0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6],
        "jd": [0, 10, 0, 1, 10, 0, 2, 2, 0, 9, 0, 1, 2, 6, 0, 1, 0, 1, 2],
        "nid": [0, 10, 0, 1, 10, 0, 2, 2, 0, 9, 0, 1, 2, 6, 0, 1, 0, 1, 2],
        "a": [
            -1.0,
            -1.0,
            1,
            1,
            1,
            -1.0,
            -1.0,
            -1.0,
            2,
            2,
            3,
            3,
            3,
            3,
            -1.0,
            -1.0,
            2,
            2,
            2,
        ],
    }
)

old_traj_expected = pd.DataFrame(
    {
        "trajectory_id": [6, 6, 6],
        "jd": [0, 1, 2],
        "nid": [0, 1, 2],
        "a": [2.0, 2.0, 2.0],
    }
)

keep_traj_expected = pd.DataFrame(
    {
        "trajectory_id": [0, 0, 1, 1, 1, 3, 3, 4, 4, 4, 4],
        "jd": [0, 10, 0, 1, 10, 0, 9, 0, 1, 2, 6],
        "nid": [0, 10, 0, 1, 10, 0, 9, 0, 1, 2, 6],
        "a": [-1.0, -1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0],
    }
)

trajectory_sample = pd.DataFrame(
    {
        "ra": [
            180.8801523,
            177.5296323,
            177.2496744,
            178.1829226,
            178.9264723,
            176.154299,
            179.312505,
            176.2823594,
            179.0375741,
            179.0456036,
            183.5866864,
            183.5972838,
            184.0653758,
            184.0810831,
            177.2582025,
            187.5032364,
            187.4923078,
            186.3767104,
            186.9486747,
            176.2011908,
            209.4181042,
            203.3497447,
            198.3799109,
            204.603046,
            200.5551092,
            203.3361293,
            205.4440385,
            198.8852864,
            199.2478811,
            199.9684341,
            199.4597799,
            206.2751422,
            199.2408958,
            199.7045296,
            198.4136717,
            203.7583491,
            201.2351661,
            208.4549852,
            200.243764,
            206.2707565,
            187.0108506,
            186.5485178,
            186.0330402,
            188.4401674,
            186.2203797,
            189.2524853,
            189.2576624,
            186.0703073,
            186.0324126,
            191.9783927,
            191.984062,
            192.4384847,
            185.9885404,
            195.6309858,
            187.738982,
            195.9789426,
            195.9837656,
            185.9900718,
            186.5448519,
            186.3666441,
            239.3579632,
            233.7092035,
            232.969768,
            230.9591717,
            230.936293,
            230.5361168,
            230.1822834,
            229.0339148,
            228.7762909,
            228.5521677,
            234.9086814,
            231.3843206,
            227.8804844,
            235.8577128,
            227.874058,
            237.784429,
            236.7758723,
            240.2301478,
            235.8733855,
            236.7572494,
            141.3100473,
            130.0543739,
            130.0542314,
            130.04997,
            129.9232788,
            129.870475,
            129.8807292,
            131.0043347,
            131.4574516,
            132.1486376,
            132.5454012,
            141.9782606,
            133.3704816,
            134.5469131,
            135.0566001,
            142.6658974,
            139.36293,
            140.0176583,
            131.4687796,
            130.3120568,
        ],
        "dec": [
            6.1739254,
            7.0134225,
            7.0436816,
            6.9051259,
            6.7393856,
            6.60782,
            6.6403427,
            6.9459491,
            4.140222,
            4.1347604,
            5.1844347,
            5.1803383,
            4.9879437,
            4.9816581,
            7.0430552,
            3.3575127,
            3.3632449,
            3.9434484,
            3.6538323,
            6.8795799,
            -13.4824868,
            -10.4302951,
            -7.5098977,
            -11.0706285,
            -8.9358983,
            -10.4235176,
            -11.4937939,
            -7.4138523,
            -8.1667122,
            -8.6009891,
            -8.2984063,
            -11.9082676,
            -8.162544,
            -8.4458117,
            -7.3722627,
            -10.6406019,
            -9.3113609,
            -12.9916974,
            -8.7599442,
            -11.9061388,
            -9.1283975,
            -8.5872784,
            -7.053292,
            -10.4405296,
            -8.0966139,
            -11.0701403,
            -11.0737153,
            -7.7766181,
            -7.0561955,
            -12.8754344,
            -12.8785879,
            -13.1452162,
            -7.4703454,
            -14.7726495,
            -6.3734723,
            -14.9206494,
            -14.9225411,
            -7.4761896,
            -6.592165,
            -8.3342494,
            -16.1321166,
            -15.5410575,
            -15.4877918,
            -15.3923507,
            -15.3917401,
            -15.3857485,
            -15.3859542,
            -15.4419623,
            -15.4748978,
            -15.5152113,
            -15.6418087,
            -15.4047432,
            -16.0304387,
            -15.7316201,
            -15.9350587,
            -15.9371173,
            -15.8256827,
            -16.2779733,
            -15.7330995,
            -15.8238043,
            21.8114436,
            29.7187935,
            29.718708,
            29.7157123,
            29.5897934,
            29.5182225,
            28.7194283,
            27.4814939,
            27.1325294,
            26.6527311,
            26.3959144,
            21.4910327,
            25.8933908,
            25.2241429,
            24.9462947,
            21.1623531,
            22.7549833,
            22.4355391,
            27.1236805,
            29.8828986,
        ],
        "ssnamenr": [
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100751",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100772",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "100906",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "101855",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
            "102892",
        ],
        "jd": [
            2459304.8028125,
            2459321.7913079,
            2459323.8165162,
            2459317.70875,
            2459313.7140972,
            2459342.7341204,
            2459311.8094097,
            2459334.6896296,
            2459369.6833681,
            2459369.7277546,
            2459293.794838,
            2459293.753831,
            2459291.8504167,
            2459291.7891204,
            2459323.7555208,
            2459275.8832755,
            2459275.9433681,
            2459281.7878356,
            2459278.924537,
            2459336.7573727,
            2459290.899213,
            2459323.7727199,
            2459362.752963,
            2459317.8169444,
            2459338.7946991,
            2459323.8359259,
            2459313.8371991,
            2459379.7114236,
            2459348.7307407,
            2459342.7731944,
            2459346.7947338,
            2459309.814456,
            2459348.7943056,
            2459344.7725579,
            2459370.7699074,
            2459321.8128704,
            2459334.7130208,
            2459297.8783796,
            2459340.8359491,
            2459309.8354977,
            2459334.7111458,
            2459338.7528819,
            2459353.7289236,
            2459325.8284722,
            2459342.7741319,
            2459321.7747917,
            2459321.751875,
            2459345.6727431,
            2459353.6903472,
            2459309.7959606,
            2459309.7730903,
            2459307.8366088,
            2459348.7525579,
            2459292.8559491,
            2459370.7694444,
            2459290.856088,
            2459290.8292593,
            2459348.6905903,
            2459361.7115625,
            2459340.7735069,
            2459325.9621644,
            2459353.8109491,
            2459356.8744329,
            2459365.7932176,
            2459365.8979398,
            2459367.8769792,
            2459369.7312269,
            2459376.7723032,
            2459378.7520023,
            2459380.7102894,
            2459348.8711343,
            2459363.7937731,
            2459394.7104051,
            2459344.8775694,
            2459392.7514236,
            2459335.8997222,
            2459340.8147685,
            2459312.898588,
            2459344.8136343,
            2459340.8956481,
            2459344.7057986,
            2459278.6831134,
            2459278.6845255,
            2459278.7355324,
            2459280.7561806,
            2459281.8256019,
            2459291.7173958,
            2459303.6953588,
            2459306.7149884,
            2459310.6967245,
            2459312.7582407,
            2459346.7064931,
            2459316.6763773,
            2459321.6851968,
            2459323.704375,
            2459348.7350231,
            2459338.6765625,
            2459340.7414468,
            2459306.7885764,
            2459275.674456,
        ],
        "fid": [
            2,
            2,
            2,
            2,
            2,
            1,
            2,
            1,
            2,
            1,
            1,
            2,
            2,
            1,
            1,
            2,
            1,
            2,
            2,
            1,
            1,
            1,
            2,
            2,
            1,
            2,
            2,
            2,
            1,
            2,
            2,
            1,
            2,
            1,
            2,
            2,
            1,
            2,
            1,
            1,
            1,
            2,
            1,
            1,
            2,
            2,
            1,
            1,
            2,
            1,
            2,
            2,
            1,
            2,
            2,
            2,
            1,
            2,
            2,
            2,
            2,
            2,
            2,
            1,
            2,
            2,
            1,
            2,
            2,
            2,
            1,
            1,
            1,
            2,
            1,
            1,
            2,
            2,
            1,
            1,
            2,
            2,
            2,
            1,
            2,
            1,
            2,
            1,
            2,
            2,
            2,
            2,
            2,
            1,
            2,
            1,
            1,
            2,
            1,
            1,
        ],
        "nid": [
            1550,
            1567,
            1569,
            1563,
            1559,
            1588,
            1557,
            1580,
            1615,
            1615,
            1539,
            1539,
            1537,
            1537,
            1569,
            1521,
            1521,
            1527,
            1524,
            1582,
            1536,
            1569,
            1608,
            1563,
            1584,
            1569,
            1559,
            1625,
            1594,
            1588,
            1592,
            1555,
            1594,
            1590,
            1616,
            1567,
            1580,
            1543,
            1586,
            1555,
            1580,
            1584,
            1599,
            1571,
            1588,
            1567,
            1567,
            1591,
            1599,
            1555,
            1555,
            1553,
            1594,
            1538,
            1616,
            1536,
            1536,
            1594,
            1607,
            1586,
            1571,
            1599,
            1602,
            1611,
            1611,
            1613,
            1615,
            1622,
            1624,
            1626,
            1594,
            1609,
            1640,
            1590,
            1638,
            1581,
            1586,
            1558,
            1590,
            1586,
            1590,
            1524,
            1524,
            1524,
            1526,
            1527,
            1537,
            1549,
            1552,
            1556,
            1558,
            1592,
            1562,
            1567,
            1569,
            1594,
            1584,
            1586,
            1552,
            1521,
        ],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aarepjo",
            "ZTF21aawbmfj",
            "ZTF21aawniei",
            "ZTF21aavcdld",
            "ZTF21aatoeep",
            "ZTF21aazvwko",
            "ZTF21aatbwml",
            "ZTF21aaxsqpk",
            "ZTF21abdvyuq",
            "ZTF21abdxdhl",
            "ZTF21aaqiejw",
            "ZTF21aaqhqnb",
            "ZTF21aapsrit",
            "ZTF21aapqytw",
            "ZTF21aawmqyz",
            "ZTF21aanwdeb",
            "ZTF21aanwjdn",
            "ZTF21aaougpm",
            "ZTF21aaogaac",
            "ZTF21aaydsjy",
            "ZTF21aapkhlz",
            "ZTF21aawmwuc",
            "ZTF21abcpppa",
            "ZTF21aavenxc",
            "ZTF21aayqefs",
            "ZTF21aawnwze",
            "ZTF21aatqrst",
            "ZTF21abgfhvt",
            "ZTF21abbgjxh",
            "ZTF21aazwwsj",
            "ZTF21abazvpl",
            "ZTF21aasqkef",
            "ZTF21abbiqxc",
            "ZTF21abalusd",
            "ZTF21abeewfz",
            "ZTF21aawclsl",
            "ZTF21aaxtdao",
            "ZTF21aaqqbty",
            "ZTF21aazldxs",
            "ZTF21aasqsod",
            "ZTF21aaxtavs",
            "ZTF21aaypcfe",
            "ZTF21abbyqre",
            "ZTF21aawzpqd",
            "ZTF21aazwwpk",
            "ZTF21aawaybc",
            "ZTF21aawadcn",
            "ZTF21abaqzwk",
            "ZTF21abbyfph",
            "ZTF21aasqcaq",
            "ZTF21aaspgnr",
            "ZTF21aasaapx",
            "ZTF21abbhcds",
            "ZTF21aaqbvsl",
            "ZTF21abeeuyq",
            "ZTF21aapiyjj",
            "ZTF21aaphxdz",
            "ZTF21abbevzt",
            "ZTF21abcmcsw",
            "ZTF21aazjmiz",
            "ZTF21aaxbmjo",
            "ZTF21abbzlal",
            "ZTF21abcgfjy",
            "ZTF21abdbqax",
            "ZTF21abdczxf",
            "ZTF21abdnruv",
            "ZTF21abdxfxh",
            "ZTF21abfnjha",
            "ZTF21abfznom",
            "ZTF21abgliyv",
            "ZTF21abbkmgm",
            "ZTF21abctobj",
            "ZTF21abiiprc",
            "ZTF21abaotof",
            "ZTF21abidohz",
            "ZTF21aaxyvtd",
            "ZTF21aazkqzl",
            "ZTF21aatldwm",
            "ZTF21abamrne",
            "ZTF21aazlytw",
            "ZTF21abajfeb",
            "ZTF21aaoclbm",
            "ZTF21aaoclbm",
            "ZTF21aaodgxk",
            "ZTF21aaolord",
            "ZTF21aaoveqs",
            "ZTF21aapootj",
            "ZTF21aaqxyrc",
            "ZTF21aarlttl",
            "ZTF21aastkxs",
            "ZTF21aatjdml",
            "ZTF21abaypaq",
            "ZTF21aauoypu",
            "ZTF21aavxqvh",
            "ZTF21aawlufp",
            "ZTF21abbgcrj",
            "ZTF21aaymwbb",
            "ZTF21aazinqy",
            "ZTF21aaropag",
            "ZTF20aclpank",
        ],
        "candid": [
            1550302813315015002,
            1567291305815015018,
            1569316515815015019,
            1563208745915015034,
            1559214095415015017,
            1588234126315015024,
            1557309405415015024,
            1580189626315015014,
            1615183362115015010,
            1615227752115015017,
            1539294834215015019,
            1539253834215015026,
            1537350414215015030,
            1537289124215015016,
            1569255525815015014,
            1521383271815015009,
            1521443361815015002,
            1527287832015015029,
            1524424532315015006,
            1582257376315015030,
            1536399211115015009,
            1569272712115015016,
            1608252965015015015,
            1563316942315015021,
            1584294694715015000,
            1569335922115015016,
            1559337191815015026,
            1625211425115015014,
            1594230743215015004,
            1588273194515015023,
            1592294734515015016,
            1555314450015015002,
            1594294304515015005,
            1590272554515015015,
            1616269905015015009,
            1567312872115015032,
            1580213024215015019,
            1543378371015015004,
            1586335944415015010,
            1555335491315015002,
            1580211144215015009,
            1584252884415015027,
            1599228926315015002,
            1571328472415015005,
            1588274134415015007,
            1567274792215015016,
            1567251872215015019,
            1591172746315015019,
            1599190346315015001,
            1555295960315015000,
            1555273090315015003,
            1553336601415015011,
            1594252556315015026,
            1538355945115015017,
            1616269445715015005,
            1536356085115015024,
            1536329255115015018,
            1594190596315015031,
            1607211566015015009,
            1586273504415015011,
            1571462164715015003,
            1599310944015015019,
            1602374434115015004,
            1611293213215015007,
            1611397934515015012,
            1613376973215015006,
            1615231223315015004,
            1622272303615015008,
            1624252003615015015,
            1626210283615015079,
            1594371133715015019,
            1609293774515015003,
            1640210403715015012,
            1590377563615015028,
            1638251423715015007,
            1581399724515015003,
            1586314763315015027,
            1558398584215015004,
            1590313633615015029,
            1586395643315015025,
            1590205794815015021,
            1524183111415015013,
            1524184525215015007,
            1524235535215015003,
            1526256181415015015,
            1527325605215015011,
            1537217395515015006,
            1549195353315015011,
            1552214983315015027,
            1556196724615015013,
            1558258244615015013,
            1592206496215015004,
            1562176372815015008,
            1567185192515015008,
            1569204372615015002,
            1594235026315015014,
            1584176560315015021,
            1586241440315015014,
            1552288573315015009,
            1521174451515015019,
        ],
        "magpsf": [
            18.16050148010254,
            18.784912109375,
            19.461193084716797,
            18.621198654174805,
            18.964542388916016,
            19.726045608520508,
            18.917972564697266,
            19.629337310791016,
            19.819753646850586,
            20.327407836914062,
            18.61440086364746,
            18.00200653076172,
            17.978425979614258,
            18.70786476135254,
            19.724464416503906,
            18.80974769592285,
            19.129016876220703,
            18.30741310119629,
            18.309383392333984,
            20.198789596557617,
            19.204242706298828,
            18.656694412231445,
            19.142784118652344,
            18.321063995361328,
            19.409656524658203,
            18.365034103393555,
            18.50041389465332,
            19.651634216308594,
            19.721988677978516,
            19.101137161254883,
            18.771387100219727,
            18.667316436767578,
            18.85565948486328,
            19.478546142578125,
            19.41177749633789,
            18.018444061279297,
            18.901935577392578,
            18.875383377075195,
            19.079631805419922,
            18.730152130126953,
            19.471435546875,
            18.687870025634766,
            19.894933700561523,
            19.213397979736328,
            19.528350830078125,
            18.61668586730957,
            19.362348556518555,
            19.657224655151367,
            19.23882293701172,
            18.898710250854492,
            18.274375915527344,
            18.92976188659668,
            19.962953567504883,
            18.937763214111328,
            19.376014709472656,
            18.91219711303711,
            19.540496826171875,
            19.029064178466797,
            19.61917495727539,
            18.966806411743164,
            18.31865882873535,
            17.55437469482422,
            17.493623733520508,
            18.174449920654297,
            18.09038543701172,
            17.732297897338867,
            18.213428497314453,
            18.63913917541504,
            18.153682708740234,
            18.394041061401367,
            18.144115447998047,
            18.17262077331543,
            19.76862907409668,
            17.465614318847656,
            18.842065811157227,
            18.10329818725586,
            17.95139503479004,
            18.39837646484375,
            18.292007446289062,
            18.471073150634766,
            19.620988845825195,
            18.05362892150879,
            18.024885177612305,
            18.849946975708008,
            18.161867141723633,
            18.806217193603516,
            18.629243850708008,
            19.20088005065918,
            18.684677124023438,
            19.054309844970703,
            19.012123107910156,
            19.33477020263672,
            18.91602897644043,
            19.674766540527344,
            19.09544563293457,
            20.13256072998047,
            19.820457458496094,
            19.502416610717773,
            19.505033493041992,
            18.697317123413086,
        ],
        "sigmapsf": [
            0.08086217194795609,
            0.10333321988582611,
            0.12432822585105896,
            0.0690094605088234,
            0.11114966869354248,
            0.11514615267515182,
            0.11507633328437805,
            0.12553229928016663,
            0.14449118077754974,
            0.19334548711776733,
            0.06743238866329193,
            0.07984911650419235,
            0.04475726559758186,
            0.07892462611198425,
            0.18304443359375,
            0.11266020685434341,
            0.21246781945228577,
            0.06773529946804047,
            0.06490179896354675,
            0.17240846157073975,
            0.09527900815010071,
            0.0837320014834404,
            0.15481868386268616,
            0.06432870775461197,
            0.11632395535707474,
            0.05988134816288948,
            0.0680500790476799,
            0.15114709734916687,
            0.14940446615219116,
            0.09450526535511017,
            0.07781684398651123,
            0.09233693033456802,
            0.08076968789100647,
            0.12606967985630035,
            0.14525116980075836,
            0.05351139232516289,
            0.07985306531190872,
            0.12600380182266235,
            0.09354324638843536,
            0.08365997672080994,
            0.13612638413906097,
            0.07286768406629562,
            0.2142745405435562,
            0.1374446004629135,
            0.11322065442800522,
            0.08303889632225037,
            0.11597646027803421,
            0.13433687388896942,
            0.10422319918870926,
            0.10974860936403275,
            0.058592259883880615,
            0.09524000436067581,
            0.18964269757270813,
            0.1132965087890625,
            0.15997228026390076,
            0.10844775289297104,
            0.18111419677734375,
            0.08225247263908386,
            0.1806689202785492,
            0.08678941428661346,
            0.06458517909049988,
            0.05453339219093323,
            0.05520128458738327,
            0.06031213328242302,
            0.0700724646449089,
            0.05910727381706238,
            0.0716085433959961,
            0.06671624630689621,
            0.059239231050014496,
            0.10783270001411438,
            0.06748528778553009,
            0.06872479617595673,
            0.18406693637371063,
            0.04366064444184303,
            0.09892421960830688,
            0.1230313628911972,
            0.05659736320376396,
            0.07645241171121597,
            0.06001603975892067,
            0.08190277963876724,
            0.16915172338485718,
            0.05649499222636223,
            0.06032877042889595,
            0.1050485223531723,
            0.0712265744805336,
            0.10293182730674744,
            0.1137363389134407,
            0.1189168319106102,
            0.06506755948066711,
            0.10056870430707932,
            0.08264419436454773,
            0.1294383853673935,
            0.08439051359891891,
            0.15384674072265625,
            0.11327838152647018,
            0.1961180865764618,
            0.18113191425800323,
            0.13044734299182892,
            0.15962624549865723,
            0.07393377274274826,
        ],
        "magnr": [
            19.083999633789062,
            22.716999053955078,
            22.55900001525879,
            20.795000076293945,
            22.52400016784668,
            22.347000122070312,
            22.0310001373291,
            22.53999900817871,
            19.357999801635742,
            22.27899932861328,
            19.68199920654297,
            22.457000732421875,
            22.72599983215332,
            23.163000106811523,
            21.906999588012695,
            20.820999145507812,
            22.650999069213867,
            22.244998931884766,
            21.27199935913086,
            22.427000045776367,
            22.374000549316406,
            22.60300064086914,
            21.5989990234375,
            22.333999633789062,
            22.413999557495117,
            20.966999053955078,
            21.597999572753906,
            21.39299964904785,
            22.51799964904785,
            22.645000457763672,
            22.322999954223633,
            21.281999588012695,
            22.461999893188477,
            22.542999267578125,
            21.999000549316406,
            22.256999969482422,
            22.261999130249023,
            19.31800079345703,
            20.43600082397461,
            22.46500015258789,
            22.128000259399414,
            21.413000106811523,
            22.135000228881836,
            22.334999084472656,
            22.430999755859375,
            22.235000610351562,
            22.208999633789062,
            22.05900001525879,
            22.530000686645508,
            21.30500030517578,
            21.854000091552734,
            21.95599937438965,
            22.225000381469727,
            22.320999145507812,
            22.253999710083008,
            20.01300048828125,
            21.104999542236328,
            22.17099952697754,
            22.21299934387207,
            21.996999740600586,
            22.26799964904785,
            22.666000366210938,
            22.68400001525879,
            22.062999725341797,
            22.433000564575195,
            22.341999053955078,
            22.29400062561035,
            22.204999923706055,
            22.374000549316406,
            22.67099952697754,
            15.880000114440918,
            22.121000289916992,
            22.035999298095703,
            18.93899917602539,
            22.17300033569336,
            22.37299919128418,
            21.145999908447266,
            21.058000564575195,
            21.70400047302246,
            18.79400062561035,
            22.823999404907227,
            23.052000045776367,
            22.93400001525879,
            23.29199981689453,
            20.230998992919922,
            21.714000701904297,
            22.618000030517578,
            22.246000289916992,
            22.923999786376953,
            22.027999877929688,
            18.923999786376953,
            21.802000045776367,
            23.118999481201172,
            23.302000045776367,
            22.89699935913086,
            20.732999801635742,
            22.9950008392334,
            22.948999404907227,
            22.93400001525879,
            23.326000213623047,
        ],
        "sigmagnr": [
            0.032999999821186066,
            0.3400000035762787,
            0.27399998903274536,
            0.0860000029206276,
            0.3610000014305115,
            0.3490000069141388,
            0.25600001215934753,
            0.35499998927116394,
            0.03700000047683716,
            0.28600001335144043,
            0.027000000700354576,
            0.2919999957084656,
            0.2939999997615814,
            0.33399999141693115,
            0.1850000023841858,
            0.0689999982714653,
            0.18199999630451202,
            0.21899999678134918,
            0.11999999731779099,
            0.30399999022483826,
            0.3540000021457672,
            0.34200000762939453,
            0.19099999964237213,
            0.3059999942779541,
            0.2709999978542328,
            0.0860000029206276,
            0.20000000298023224,
            0.15399999916553497,
            0.36000001430511475,
            0.3370000123977661,
            0.24500000476837158,
            0.14499999582767487,
            0.2930000126361847,
            0.2930000126361847,
            0.2280000001192093,
            0.26499998569488525,
            0.2919999957084656,
            0.10199999809265137,
            0.08399999886751175,
            0.3149999976158142,
            0.33799999952316284,
            0.1340000033378601,
            0.35499998927116394,
            0.3230000138282776,
            0.3479999899864197,
            0.32899999618530273,
            0.35899999737739563,
            0.34599998593330383,
            0.3479999899864197,
            0.12999999523162842,
            0.3059999942779541,
            0.22300000488758087,
            0.3499999940395355,
            0.3490000069141388,
            0.3400000035762787,
            0.04800000041723251,
            0.2160000056028366,
            0.296999990940094,
            0.2879999876022339,
            0.23399999737739563,
            0.36000001430511475,
            0.35899999737739563,
            0.3149999976158142,
            0.33899998664855957,
            0.29100000858306885,
            0.3529999852180481,
            0.3089999854564667,
            0.21199999749660492,
            0.25200000405311584,
            0.3269999921321869,
            0.014999999664723873,
            0.3440000116825104,
            0.30300000309944153,
            0.020999999716877937,
            0.289000004529953,
            0.2840000092983246,
            0.11100000143051147,
            0.11900000274181366,
            0.16599999368190765,
            0.023000000044703484,
            0.3190000057220459,
            0.29600000381469727,
            0.3529999852180481,
            0.3240000009536743,
            0.05999999865889549,
            0.14399999380111694,
            0.3330000042915344,
            0.19900000095367432,
            0.23499999940395355,
            0.11800000071525574,
            0.017999999225139618,
            0.10400000214576721,
            0.3479999899864197,
            0.31299999356269836,
            0.3100000023841858,
            0.039000000804662704,
            0.34299999475479126,
            0.32600000500679016,
            0.33799999952316284,
            0.3149999976158142,
        ],
        "magzpsci": [
            26.253501892089844,
            26.252912521362305,
            26.25119400024414,
            26.264198303222656,
            26.106542587280273,
            26.2220458984375,
            26.25397300720215,
            26.256336212158203,
            26.28575325012207,
            26.191408157348633,
            26.401399612426758,
            26.398006439208984,
            26.39542579650879,
            26.36386489868164,
            26.350465774536133,
            26.328746795654297,
            26.323017120361328,
            26.274412155151367,
            26.366382598876953,
            26.24979019165039,
            26.36224365234375,
            26.171695709228516,
            26.2587833404541,
            26.290063858032227,
            26.260656356811523,
            26.23203468322754,
            26.232412338256836,
            26.12663459777832,
            26.16598892211914,
            26.203136444091797,
            26.18838882446289,
            26.1433162689209,
            26.211660385131836,
            26.22754669189453,
            26.20577621459961,
            26.22044563293457,
            26.26893424987793,
            26.176382064819336,
            26.25063133239746,
            26.211153030395508,
            26.290435791015625,
            26.283870697021484,
            26.17693328857422,
            26.227397918701172,
            26.256349563598633,
            26.275684356689453,
            26.21034812927246,
            26.154224395751953,
            26.130823135375977,
            26.050710678100586,
            25.99737548828125,
            26.026762008666992,
            26.175952911376953,
            26.086763381958008,
            26.078014373779297,
            26.152196884155273,
            26.18449592590332,
            26.137065887451172,
            26.152175903320312,
            26.271806716918945,
            26.271657943725586,
            26.340373992919922,
            26.332624435424805,
            26.091449737548828,
            26.085384368896484,
            26.09329605102539,
            26.152427673339844,
            26.256139755249023,
            26.272682189941406,
            25.364042282104492,
            26.118114471435547,
            26.28261947631836,
            25.881629943847656,
            26.18361473083496,
            26.107065200805664,
            25.79429817199707,
            26.227394104003906,
            26.3803768157959,
            26.11200714111328,
            26.159074783325195,
            25.998987197875977,
            26.085628509521484,
            26.25388526916504,
            26.311946868896484,
            26.085866928100586,
            26.341217041015625,
            25.764244079589844,
            26.313880920410156,
            26.269678115844727,
            26.278310775756836,
            26.288122177124023,
            26.002769470214844,
            26.284029006958008,
            26.28776741027832,
            26.27944564819336,
            26.128559112548828,
            26.082456588745117,
            25.950416564941406,
            26.190034866333008,
            26.339317321777344,
        ],
        "isdiffpos": [
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
        ],
        "dcmag": [
            17.76783280480246,
            18.755679678598938,
            19.39901616256605,
            18.482374870626792,
            18.917775632575022,
            19.624188020566926,
            18.856789666224117,
            19.552858757463646,
            18.81842733939189,
            20.140903169777012,
            18.289645516672593,
            17.98610860012757,
            17.966233733264126,
            18.69069807935427,
            19.590944419761854,
            18.65868337340721,
            19.087390112966823,
            18.278889269191215,
            18.246083438010622,
            20.058760801594893,
            19.149055361258107,
            18.624185271271976,
            19.033708596682768,
            18.294805953934322,
            19.339570416871037,
            18.266785457924424,
            18.43717051908699,
            19.42636972530173,
            19.630271272859524,
            19.0576660057392,
            18.727640436397664,
            18.557570008357693,
            18.814889136972784,
            19.41012836174113,
            19.309919805904492,
            17.99566374890629,
            18.85135658984227,
            18.281240840184026,
            18.78890672963249,
            18.692159168523318,
            19.37849536993412,
            18.60369556205516,
            19.74733889178654,
            19.14837669345671,
            19.454678050823333,
            18.578624001938245,
            19.27802465133069,
            19.526341187341696,
            19.18058260623176,
            18.75611874428951,
            18.22370589969651,
            18.848808818319803,
            19.818005524958497,
            18.88197791514201,
            19.28779586964235,
            18.542036063857086,
            19.28149902508548,
            18.962870305436596,
            19.51302466578901,
            18.90195934460992,
            18.290367441034405,
            17.54518954743289,
            17.485017726524497,
            18.137608582143738,
            18.066952351616017,
            17.714064247786574,
            18.18414289812551,
            18.598515973974507,
            18.131597587070804,
            18.3462086346708,
            15.566964347685644,
            18.14328187980044,
            19.58306928658731,
            17.197566352122813,
            18.782023065809685,
            18.06915700775924,
            17.89315460439296,
            18.316484258627867,
            18.236422169883976,
            17.794163857121106,
            19.550085397316874,
            18.04075982361215,
            18.012914247607046,
            18.831730013835152,
            17.98491575010349,
            18.735124022968844,
            18.586007576181125,
            19.136437661679956,
            18.6629118726918,
            18.986500197722187,
            18.221400053448725,
            19.199737724971506,
            18.893822702609853,
            19.63569273097211,
            19.063317674176368,
            19.56330147874166,
            19.749869557460826,
            19.442856152441284,
            19.45399749840128,
            18.682336681603708,
        ],
        "dcmagerr": [
            0.05720545288607908,
            0.10099287930264715,
            0.11839464639747001,
            0.06159763614185044,
            0.10754602785251247,
            0.1093941932476433,
            0.10967166609213494,
            0.11945976376452162,
            0.0616244606909508,
            0.16897035177885342,
            0.05048445841654089,
            0.07880283195356998,
            0.04437907501007706,
            0.07786303248185897,
            0.16327283927167002,
            0.09843565193382021,
            0.2045906178899214,
            0.06622288066147894,
            0.061602154509014066,
            0.1559472456673834,
            0.0922408307095141,
            0.08188588142240137,
            0.14120608387990802,
            0.06321587703210074,
            0.11036027489006309,
            0.05520431338663941,
            0.0651892987848807,
            0.12617080146327359,
            0.14036464461743087,
            0.09175446916703653,
            0.07536738186768448,
            0.08461591237210413,
            0.07853883803694249,
            0.11971534578191664,
            0.13381097432679626,
            0.052688420462661645,
            0.07736856733234368,
            0.08463050992604566,
            0.07423911311947673,
            0.08150610398286012,
            0.12799834936740512,
            0.0681687651028096,
            0.1924049880375731,
            0.130809584329541,
            0.10822827509364774,
            0.08097537764264111,
            0.11061241359160415,
            0.12539632301995615,
            0.10043802965443813,
            0.09756234965107563,
            0.05763499950770862,
            0.08983744213358438,
            0.1716103110788238,
            0.10903245053904131,
            0.1498558598561757,
            0.07835486510624162,
            0.14986019640229173,
            0.07935624606605265,
            0.16602265165404598,
            0.08287554886708423,
            0.06360163143439777,
            0.05415849992009089,
            0.05482190372006695,
            0.05938686945404236,
            0.06885721440429553,
            0.058419464274054284,
            0.07018625810376314,
            0.06473602365240233,
            0.05826777043618555,
            0.1041432334067552,
            0.01498491596378753,
            0.06751833944211874,
            0.16228806003952048,
            0.03441714925133719,
            0.0948846570754786,
            0.11954651499377979,
            0.053953754960224636,
            0.07142323447579049,
            0.05761949098654056,
            0.04518498878212762,
            0.15973642770799235,
            0.05593815301327354,
            0.05979267619428926,
            0.1034412444356978,
            0.06118383306579501,
            0.09683891371853652,
            0.11006655338436314,
            0.11264929018180053,
            0.06394648325269814,
            0.09474953538780832,
            0.04096748545826492,
            0.11494628072775898,
            0.08298164509294753,
            0.1488203491267954,
            0.11034629719600583,
            0.11718067468191141,
            0.1710981428080136,
            0.12470423352430447,
            0.15308528055773027,
            0.07304831368748005,
        ],
    }
)

trajectory_sample_2 = pd.DataFrame(
    {
        "ra": [
            251.7524292,
            255.7670507,
            258.8328397,
            260.4098597,
            261.1618098,
            261.1653787,
            261.4823923,
            261.4974453,
            262.8265616,
            263.0573988,
            263.0437751,
            262.9947469,
            262.9919092,
            262.7891757,
            262.2231129,
            261.8181227,
            261.5276968,
            260.850303,
            260.8343066,
            259.8458154,
            259.2111807,
            259.1955657,
            259.1953397,
            258.7510019,
            258.741083,
            258.2797994,
            258.2737536,
            257.8099535,
            257.3216502,
            256.8520963,
            256.3732258,
            256.3659298,
            255.9068966,
            255.4243588,
            254.9745357,
            254.5593688,
            254.5352718,
            253.3283433,
            252.9821052,
            252.9739772,
        ],
        "dec": [
            -18.6364371,
            -18.4989623,
            -18.1739112,
            -17.880881,
            -17.686997,
            -17.6859217,
            -17.5876298,
            -17.5824284,
            -16.8949672,
            -16.4439832,
            -16.3145206,
            -16.1837111,
            -16.1796083,
            -15.9197258,
            -15.5294343,
            -15.3346564,
            -15.214951,
            -14.9785789,
            -14.9738932,
            -14.6993151,
            -14.5525839,
            -14.5493996,
            -14.5493562,
            -14.4579551,
            -14.4561171,
            -14.369898,
            -14.3688627,
            -14.2903089,
            -14.2159453,
            -14.1520687,
            -14.0947549,
            -14.0939624,
            -14.0465265,
            -14.0050399,
            -13.9743641,
            -13.9534956,
            -13.9526023,
            -13.9441507,
            -13.9600792,
            -13.9604684,
        ],
        "ssnamenr": [
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
            "10053",
        ],
        "jd": [
            2459280.9420949,
            2459292.9425579,
            2459303.9599306,
            2459310.9610995,
            2459314.959294,
            2459314.9809259,
            2459316.8795602,
            2459316.9799653,
            2459328.856713,
            2459335.93,
            2459337.9102199,
            2459339.8979398,
            2459339.9602431,
            2459343.897963,
            2459349.8767245,
            2459352.9435185,
            2459354.8759722,
            2459358.8365625,
            2459358.9178356,
            2459363.8968981,
            2459366.8139005,
            2459366.8796412,
            2459366.8805787,
            2459368.8363426,
            2459368.8768981,
            2459370.8545833,
            2459370.8787963,
            2459372.8331019,
            2459374.8640741,
            2459376.8145023,
            2459378.808287,
            2459378.8371296,
            2459380.7725116,
            2459382.8368519,
            2459384.816713,
            2459386.7093866,
            2459386.8145602,
            2459392.8348843,
            2459394.7926505,
            2459394.8371065,
        ],
        "fid": [
            2,
            1,
            2,
            1,
            2,
            1,
            1,
            2,
            1,
            1,
            1,
            1,
            2,
            1,
            1,
            1,
            1,
            2,
            1,
            2,
            1,
            2,
            2,
            1,
            2,
            2,
            1,
            2,
            1,
            2,
            2,
            1,
            1,
            2,
            2,
            2,
            1,
            2,
            2,
            1,
        ],
        "nid": [
            1526,
            1538,
            1549,
            1556,
            1560,
            1560,
            1562,
            1562,
            1574,
            1581,
            1583,
            1585,
            1585,
            1589,
            1595,
            1598,
            1600,
            1604,
            1604,
            1609,
            1612,
            1612,
            1612,
            1614,
            1614,
            1616,
            1616,
            1618,
            1620,
            1622,
            1624,
            1624,
            1626,
            1628,
            1630,
            1632,
            1632,
            1638,
            1640,
            1640,
        ],
        "fink_class": [
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
            "Solar System MPC",
        ],
        "objectId": [
            "ZTF21aaoqaif",
            "ZTF21aaqedea",
            "ZTF21aaraaae",
            "ZTF21aasxdjq",
            "ZTF21aaubnmk",
            "ZTF21aaubuxp",
            "ZTF21aauvskc",
            "ZTF21aauztyu",
            "ZTF21aaxijyg",
            "ZTF21aaxzboc",
            "ZTF21aaylsgp",
            "ZTF21aazeywe",
            "ZTF21aazgfae",
            "ZTF21abahzau",
            "ZTF21abbsunp",
            "ZTF21abbxqjy",
            "ZTF21abccmxj",
            "ZTF21abciqdn",
            "ZTF21abcjait",
            "ZTF21abcusmr",
            "ZTF21abdgvzi",
            "ZTF21abdicyw",
            "ZTF21abdicyw",
            "ZTF21abdtbjr",
            "ZTF21abdtwsz",
            "ZTF21abegqyz",
            "ZTF21abehfrh",
            "ZTF21abeupta",
            "ZTF21abfdwil",
            "ZTF21abfoiyq",
            "ZTF21abgawrt",
            "ZTF21abgblei",
            "ZTF21abgluwj",
            "ZTF21abgxpaa",
            "ZTF21abhfzfd",
            "ZTF21abhsill",
            "ZTF21abhsubu",
            "ZTF21abiecpy",
            "ZTF21abikrdr",
            "ZTF21abiltta",
        ],
        "candid": [
            1526442091915015023,
            1538442552215015018,
            1549459933015015008,
            1556461092815015024,
            1560459292515015025,
            1560480922515015043,
            1562379562515015025,
            1562479962515015031,
            1574356713815015026,
            1581430003815015016,
            1583410213815015010,
            1585397933815015005,
            1585460243815015005,
            1589397963715015059,
            1595376724015015012,
            1598443514015015004,
            1600375974115015000,
            1604336565815015025,
            1604417835815015015,
            1609396896315015032,
            1612313906215015011,
            1612379646215015019,
            1612380575115015014,
            1614336345115015010,
            1614376895115015009,
            1616354585015015008,
            1616378795015015006,
            1618333105015015000,
            1620364075515015001,
            1622314505215015016,
            1624308285315015014,
            1624337125315015018,
            1626272515315015010,
            1628336855615015017,
            1630316715615015014,
            1632209385715015007,
            1632314565715015010,
            1638334886015015018,
            1640292656015015016,
            1640337106015015008,
        ],
        "magpsf": [
            18.036869049072266,
            18.525136947631836,
            17.514747619628906,
            17.973377227783203,
            17.221111297607422,
            17.895639419555664,
            17.808406829833984,
            17.16434097290039,
            17.4180965423584,
            17.229183197021484,
            17.09563636779785,
            17.189735412597656,
            16.607458114624023,
            16.981061935424805,
            16.95501136779785,
            16.738494873046875,
            16.78156852722168,
            15.995867729187012,
            16.625547409057617,
            15.931930541992188,
            16.455678939819336,
            15.868266105651855,
            15.809646606445312,
            16.335847854614258,
            15.704656600952148,
            15.75794792175293,
            16.22144889831543,
            15.544684410095215,
            16.162494659423828,
            15.64391803741455,
            15.64637279510498,
            16.289222717285156,
            16.305313110351562,
            15.67836856842041,
            15.816125869750977,
            15.80380630493164,
            16.390533447265625,
            15.926766395568848,
            15.952705383300781,
            16.516693115234375,
        ],
        "sigmapsf": [
            0.0768224373459816,
            0.10321882367134094,
            0.0766848623752594,
            0.08624500781297684,
            0.03459253907203674,
            0.04582305625081062,
            0.05549671873450279,
            0.03571411594748497,
            0.06782419979572296,
            0.07883951812982559,
            0.0556395947933197,
            0.03936946764588356,
            0.029921529814600945,
            0.046503305435180664,
            0.03344561532139778,
            0.03773140162229538,
            0.05104396864771843,
            0.03277841955423355,
            0.04006878286600113,
            0.026836523786187172,
            0.0384971983730793,
            0.038393110036849976,
            0.03329050913453102,
            0.03619929030537605,
            0.030167296528816223,
            0.04390547797083855,
            0.03744559735059738,
            0.04168780893087387,
            0.03943997621536255,
            0.04122317582368851,
            0.038666702806949615,
            0.037398818880319595,
            0.05574681609869003,
            0.039540596306324005,
            0.03717188909649849,
            0.029090767726302147,
            0.04275164008140564,
            0.04727723076939583,
            0.04890663921833038,
            0.05484451726078987,
        ],
        "magnr": [
            21.43400001525879,
            21.722999572753906,
            19.895999908447266,
            20.559999465942383,
            20.823999404907227,
            19.08500099182129,
            18.731000900268555,
            20.310998916625977,
            20.031999588012695,
            17.954999923706055,
            19.89699935913086,
            21.16900062561035,
            17.464000701904297,
            20.85099983215332,
            20.98200035095215,
            20.99799919128418,
            19.6510009765625,
            22.136999130249023,
            22.240999221801758,
            20.84600067138672,
            21.14299964904785,
            22.655000686645508,
            20.312999725341797,
            20.0939998626709,
            20.961999893188477,
            22.01799964904785,
            20.236000061035156,
            19.37299919128418,
            22.469999313354492,
            21.50200080871582,
            22.1299991607666,
            22.266000747680664,
            17.423999786376953,
            22.860000610351562,
            19.553998947143555,
            21.185998916625977,
            20.889999389648438,
            23.393999099731445,
            19.06800079345703,
            22.591999053955078,
        ],
        "sigmagnr": [
            0.12999999523162842,
            0.1679999977350235,
            0.04699999839067459,
            0.07999999821186066,
            0.14900000393390656,
            0.02800000086426735,
            0.03200000151991844,
            0.09099999815225601,
            0.07999999821186066,
            0.017999999225139618,
            0.057999998331069946,
            0.16899999976158142,
            0.023000000044703484,
            0.10499999672174454,
            0.08799999952316284,
            0.10899999737739563,
            0.03500000014901161,
            0.13199999928474426,
            0.210999995470047,
            0.04500000178813934,
            0.06300000101327896,
            0.25,
            0.04800000041723251,
            0.09099999815225601,
            0.050999999046325684,
            0.12200000137090683,
            0.07999999821186066,
            0.024000000208616257,
            0.296999990940094,
            0.11500000208616257,
            0.16099999845027924,
            0.34700000286102295,
            0.014000000432133675,
            0.24799999594688416,
            0.026000000536441803,
            0.050999999046325684,
            0.10100000351667404,
            0.3580000102519989,
            0.014000000432133675,
            0.3449999988079071,
        ],
        "magzpsci": [
            26.115869522094727,
            26.05913543701172,
            26.209747314453125,
            26.23337745666504,
            26.42911148071289,
            26.25864028930664,
            26.086406707763672,
            26.417341232299805,
            26.071096420288086,
            25.784183502197266,
            26.114635467529297,
            26.15373420715332,
            26.344457626342773,
            26.07006072998047,
            26.28801155090332,
            26.206493377685547,
            26.29056739807129,
            26.240867614746094,
            26.24454689025879,
            26.23293113708496,
            26.044677734375,
            26.1292667388916,
            26.132646560668945,
            26.089847564697266,
            26.122657775878906,
            26.24494743347168,
            26.187448501586914,
            24.989683151245117,
            26.214494705200195,
            26.218917846679688,
            26.232372283935547,
            26.280221939086914,
            25.195314407348633,
            25.99736976623535,
            26.084125518798828,
            26.107805252075195,
            26.218534469604492,
            26.065765380859375,
            25.861705780029297,
            25.8046932220459,
        ],
        "isdiffpos": [
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
            "t",
        ],
        "dcmag": [
            17.98319732320105,
            18.45454892653741,
            17.393188949412988,
            17.86943998889616,
            17.187522884646366,
            17.565417069624004,
            17.344836056833373,
            17.113074780033852,
            17.30111478684247,
            16.565172771274014,
            17.000119194959492,
            17.15766571789453,
            16.22201714298219,
            16.94286201265401,
            16.92782967955456,
            16.714804141052824,
            16.704612563261236,
            15.991958037232244,
            16.618934362835816,
            15.9197828990098,
            16.437092239385645,
            15.865873642753552,
            15.790262673720381,
            16.29433379319891,
            15.694844545279295,
            15.75445630839871,
            16.19132673947491,
            15.445041990701364,
            16.158895471360275,
            15.638743295277646,
            15.643497055323726,
            16.284630677938715,
            15.547224735042246,
            15.676490342207698,
            15.775502598264826,
            15.794935769000386,
            16.371707642356615,
            15.925410413765999,
            15.866110972762892,
            16.51020041326505,
        ],
        "dcmagerr": [
            0.07338552404940367,
            0.09729802343671755,
            0.06874291924348738,
            0.07871121273919436,
            0.03384450411518058,
            0.03459437778009251,
            0.037879957514163114,
            0.03432451774474552,
            0.06144224704500239,
            0.043555643980421936,
            0.051187443431163646,
            0.03853879467577054,
            0.022077217126680527,
            0.045042121244155,
            0.03269117375134044,
            0.036991907554593216,
            0.04761153244226201,
            0.03266404428664542,
            0.0398460770117155,
            0.0265426621530148,
            0.037858878739993336,
            0.03831255442850794,
            0.03271246723929445,
            0.03500814978597125,
            0.0298994163655786,
            0.04376626230353461,
            0.03648672454084371,
            0.03809044023440725,
            0.03932173696803908,
            0.04103081258218728,
            0.03856677496867637,
            0.037269762438517276,
            0.028610731531166125,
            0.03947458111844519,
            0.03581951312116638,
            0.028857046426422665,
            0.04205260469097008,
            0.04722033697486204,
            0.045170268572920204,
            0.05455631613825157,
        ],
    }
)

if __name__ == "__main__":  # pragma: no cover
    exit()

# Intra night association testing # intra_night_separation_association testing # compute_diff_mag testing # intra_night_association testing # Night to night association testing # Cone search association testing # Association that match the angle criterion # Association that not match the angle criterion # Night to night trajectory association testing # trajectory associations testing # tracklets and observations associations testing # Night to night association testing # Trajectory and tracklets association test # - test with duplicates # - expected outputs # Trajectories and new observations associations # - test with duplicates # - expected outputs # Tracklets and old observations associations # - with duplicates # - expected outputs # old observations with new observations associations test # - expected outputs # Test OrbFit # - expected outputs # Test orbit_elem_dataframe - expected outputs # Test compute_orbit_elem - expected outputs # Test Intra night step for inter_night associations # - expected outputs # Test Trajectories and Tracklets associations Steps in Inter night associations # - expected outputs # Test Trajectories and new observations associations Steps in Inter night associations # - expected outputs # Test Old observations and Tracklets associations Steps in Inter night associations # - expected outputs # Test night_to_night_association # - expected outputs # pragma: no cover