Adler outlier detection for early science

This notebook demonstrates Adler’s outlier detection capability with specific functionality for working with the early Rubin submissions to the MPC

[1]:
import sqlite3
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
import astropy.units as u

from adler.objectdata.AdlerPlanetoid import AdlerPlanetoid
from adler.objectdata.objectdata_utilities import generate_summary_csvs

from adler.science.AvgMagModel import AvgMagModel
from adler.science.PhaseCurve import PhaseCurve
from astropy.stats import sigma_clip as astropy_sigma_clip

from adler.objectdata.AdlerData import VALID_AVG_MAG_MODELS, VALID_PHASE_MODELS

from tqdm import tqdm
import adler.utilities.science_utilities as sci_utils

plot_filter_colors_white_background = {
    "u": "#1600ea",
    "g": "#31de1f",
    "r": "#b52626",
    "i": "#370201",
    "z": "#ba52ff",
    "y": "#61a2b3",
}
plot_symbols = {"u": "o", "g": "^", "r": "v", "i": "s", "z": "*", "y": "p"}
plot_linestyles = {
    "u": "--",
    "g": (0, (3, 1, 1, 1)),
    "r": "-.",
    "i": "-",
    "z": (0, (3, 1, 1, 1, 1, 1)),
    "y": ":",
}
[2]:
# Settings
input_sql_file = f"../../tests/data/mpc_obs_sbn_testing_database.sqlite"
# Code to ensure the MPC obs_sbn file is compatible with adler
# from adler.objectdata.objectdata_utilities import mpc_file_preprocessing
# mpc_file_preprocessing(sql_filename=input_sql_file)
schema = "MPC"

# input_sql_file = f"../../tests/data/testing_database.db"
# schema = "dp03_catalogs_10yr"

input_conn = sqlite3.connect(input_sql_file)
input_cur = input_conn.cursor()

# Set column to use for magnitude
mag_col = "reduced_mag"
magErr_col = "magErr"

# Set filter list
# filter_list=['u', 'g', 'r', 'i', 'z', 'y']


make_plots = False
write_model_data_flag = False

sig_clip_val = 3

# Set thresholds for magnitude changes
# diff_cuts_arr = np.array([1, 2, 3])
# std_cuts_arr = np.array([5, 6])
# Shifting to single thresholds and recording the res value to simplify things. User can always check their own threshold if it's higher than these (or run the code themselves at a lower threshold)
diff_cut = 1.5
std_cut = 5

if schema == "MPC":
    process_mjd_arr = np.array([60799.5])
    model_name = "median"

    # Defines how many nights of data to retrieve in total
    # By default we take the previous 30 nights and the previous 7 nights to allow different checks for outliers
    data_timespan_arr = np.array([30, 7])

    # Defines how many nights to consider as "new observations" allowing for the checking of "sustained outliers/outbursts"
    n_new_nights_arr = np.array([1, 3])

    filter_list = ["g", "r"]

elif schema == "dp03_catalogs_10yr":
    process_mjd_arr = np.array([63335.5])
    model_name = "HG12_Pen16"
    # Defines how many nights of data to retrieve in total
    data_timespan_arr = np.array([400])

    # Defines how many nights to consider as "new observations" allowing for the checking of "sustained outliers/outbursts"
    n_new_nights_arr = np.array([31])

    filter_list = ["r", "i"]
else:
    raise ValueError("Schema not recognised")
[3]:
# for process_mjd in process_mjd_arr: #option to loop through multiple days
process_mjd = process_mjd_arr[0]
# Get objects with new observations from previous night
start_of_night_mjd = process_mjd - 1

if schema == "MPC":
    obj_df = pd.read_sql_query(
        f"SELECT DISTINCT provid FROM obs_sbn WHERE mjd_tai BETWEEN '{start_of_night_mjd}' AND '{process_mjd}'",
        input_conn,
    )
    unique_obj_ids = obj_df.provid.to_numpy()
elif schema == "dp03_catalogs_10yr":
    obj_df = pd.read_sql_query(
        f"SELECT DISTINCT ssObjectId FROM diaSource WHERE midPointMjdTai BETWEEN '{start_of_night_mjd}' AND '{process_mjd}'",
        input_conn,
    )
    unique_obj_ids = obj_df.ssObjectId.to_numpy()
else:
    print("Schema not recognised")
    raise ValueError("Schema not recognised")

print(f"{len(unique_obj_ids)} objects to analyze")

if len(unique_obj_ids) == 0:
    print(f"No objects to process for {process_mjd}")
    raise ValueError(f"No objects to process for {process_mjd}")

for data_timespan in data_timespan_arr:
    for n_new_nights in n_new_nights_arr:

        # output_dir = f"demo_output_files"

        # os.makedirs(output_dir, exist_ok=True)

        # output_db = f"{output_dir}/adler_output_{model_name}_{process_mjd:.1f}_{data_timespan}n_{n_new_nights}n.sqlite"

        for ssObjectId in tqdm(unique_obj_ids, desc=f"Objects to process for {process_mjd}"):
            if schema == "MPC":
                planetoid = AdlerPlanetoid.construct_from_mpc_obs_sbn(
                    ssObjectId=ssObjectId,
                    sql_filename=input_sql_file,
                    filter_list=filter_list,
                    date_range=[process_mjd - data_timespan, process_mjd],
                )
            elif schema == "dp03_catalogs_10yr":
                planetoid = AdlerPlanetoid.construct_from_SQL(
                    ssObjectId=ssObjectId,
                    sql_filename=input_sql_file,
                    filter_list=filter_list,
                    date_range=[process_mjd - data_timespan, process_mjd],
                )
            else:
                raise ValueError("Schema not recognised")

            for filt in planetoid.filter_list:
                df_obs = sci_utils.get_df_obs_filt(planetoid, filt=filt)

                err_flag = df_obs.magErr.isnull().all()
                if err_flag:
                    print("All magErr values are NaNs, proceed with caution")
                else:
                    # Remove observations with large errorbars
                    magErr_mask = sci_utils.large_magErr_mask(df_obs)
                    df_obs = df_obs[magErr_mask]

                # Split into previous observations and observations from the most recent night(s)
                df_obs_old, df_obs_new, *_ = sci_utils.split_obs(
                    df_obs, process_mjd=process_mjd, n_new_nights=n_new_nights
                )
                print(
                    "Previous observations (date < {}): {}".format(
                        process_mjd - n_new_nights, len(df_obs_old)
                    )
                )
                print(
                    "New observations ({} <= date < {}): {}".format(
                        process_mjd - n_new_nights, process_mjd, len(df_obs_new)
                    )
                )
                if len(df_obs_old) < 2:
                    print("Insufficient number of previous observations, continuing to next band/object")
                    continue
                if len(df_obs_new) == 0:
                    print(f"No new observations in {filt}, continuing to next band/object")
                    continue

                # Sigma clip old observations
                sig_clip_mask = astropy_sigma_clip(df_obs_old[mag_col], sigma=sig_clip_val).mask
                df_obs_old = df_obs_old[~sig_clip_mask].copy()
                if len(df_obs_old) < 2:
                    print(
                        "Insufficient number of previous observations after sigma clipping, continuing to next band/object"
                    )
                    continue

                # Set the modelId here
                planetoid.AdlerData.set_modelId(model_name, process_mjd, data_timespan, n_new_nights)

                # Populate summary AdlerData params for this filter and particular model
                ad_params = {}
                ad_params["phaseAngle_min"] = np.amin(df_obs_old["phaseAngle"])
                ad_params["phaseAngle_range"] = np.ptp(df_obs_old["phaseAngle"])
                ad_params["observationTime_max"] = np.amax(df_obs_old["midPointMjdTai"])
                ad_params["arc"] = np.ptp(df_obs_old["midPointMjdTai"])
                ad_params["nobs"] = len(df_obs_old)

                # Fit model
                if model_name in VALID_AVG_MAG_MODELS:
                    model = AvgMagModel().InitModelObs(
                        mag=df_obs_old[mag_col], magErr=df_obs_old[magErr_col], model_name=model_name
                    )
                    ad_params.update(model.__dict__)  # store model values in ad_params
                    planetoid.AdlerData.populate_avg_mag_parameters(filt, **ad_params)

                    res = np.array(df_obs_new[mag_col]) - model.avg_mag
                elif model_name in VALID_PHASE_MODELS:
                    model = PhaseCurve(H=np.amin(df_obs_old["reduced_mag"]), model_name=model_name)
                    pc_fit = model.FitModel(
                        phase_angle=np.radians(df_obs_old["phaseAngle"]),
                        reduced_mag=np.array(df_obs_old["reduced_mag"]),
                        mag_err=np.array(df_obs_old[magErr_col]),
                    )
                    model = model.InitModelSbpy(pc_fit)
                    ad_params.update(model.__dict__)  # store model values in ad_params
                    planetoid.AdlerData.populate_phase_parameters(filt, **ad_params)

                    res = df_obs_new[mag_col].to_numpy() - model.ReducedMag(
                        np.radians(df_obs_new["phaseAngle"])
                    )
                else:
                    print(f"Model '{model_name}' not recognised")
                    raise ValueError(f"Model '{model_name}' not recognised")

                ####
                # Check for individual outlying observations
                ####

                # Simple magnitude difference
                diff_cut_outlier_arr = sci_utils.outlier_diff(res, diff_cut=diff_cut)
                df_obs_new["mag_diff"] = np.zeros(shape=len(df_obs_new), dtype=float)
                df_obs_new.loc[diff_cut_outlier_arr, "mag_diff"] = res[diff_cut_outlier_arr]

                # Outliers in sigma-space
                magErrs = df_obs_new[magErr_col].to_numpy()
                std_cut_outlier_arr = sci_utils.outlier_sigma_diff(res, magErrs, std_sigma=std_cut)
                df_obs_new["std_diff"] = np.zeros(shape=len(df_obs_new), dtype=float)
                res_sig_diff = res / magErrs
                df_obs_new.loc[std_cut_outlier_arr, "std_diff"] = res_sig_diff[std_cut_outlier_arr]

                combined_outlier_arr = diff_cut_outlier_arr | std_cut_outlier_arr

                planetoid.AdlerData.populate_source_flags(
                    filt, planetoid.AdlerData.modelId, df_obs_new.loc[combined_outlier_arr]
                )

                ####
                # Sustained outburst checks
                ####

                # Identify timegaps in case there's only one night of new data (in the case where we are using n_new_nights>1)
                df_obs_new.sort_values(by="midPointMjdTai", inplace=True)
                time_gaps = sci_utils.apparition_gap_finder(df_obs_new.midPointMjdTai.to_numpy(), dx=0.5)
                if len(time_gaps) == 0:
                    # If there is only one night of new data, we continue to the next band/object
                    print(
                        "Insufficient number of nights with new observations, continuing to next band/object"
                    )
                    continue

                # Sigma clip new observations
                sig_clip_mask_new = astropy_sigma_clip(df_obs_new[mag_col], sigma=sig_clip_val).mask
                df_obs_new_sigclip = df_obs_new[~sig_clip_mask_new].copy()

                if len(df_obs_new_sigclip) == 0:
                    print(
                        f"No new observations in {filt} after sigma clipping, continuing to next band/object"
                    )
                    continue

                # Calculate average magnitude of the new observations (slightly obtuse to use the model here but future proofing maybe)
                if model_name in VALID_AVG_MAG_MODELS:
                    new_obs_model = AvgMagModel().InitModelObs(
                        mag=df_obs_new_sigclip[mag_col],
                        magErr=df_obs_new_sigclip[magErr_col],
                        model_name=model_name,
                    )
                    mag_change = np.abs(new_obs_model.avg_mag - model.avg_mag)
                    # Difference in magnitude space
                    sustained_diff_cut_flag = mag_change > diff_cut
                    # Check if sustained outlier detected and record the different between the old and new avg_mag values in AdlerData
                    if sustained_diff_cut_flag:
                        planetoid.AdlerData.populate_filter_dependent_parameters(
                            filter_name=filt, **{"sustained_outliers": mag_change}
                        )
                    else:
                        print(f"No sustained outlier detected")
                elif model_name in VALID_PHASE_MODELS:
                    print(f"Sustained outlier detection in phase model regime not implemented yet")
                    pass
                    # TODO implement sustained difference in phase model regime?

                ####
                # Plotting
                ####
                # TODO make optional plotting routine into a function
                # Make this work from planetoid and put in plotting_utilities as `plot_outliers`, perhaps with model_name as argument to control the different behaviours for AvgMag vs PhaseModel
                if make_plots:
                    # os.makedirs(f"{output_dir}/plots", exist_ok=True)
                    # FIXME sigclip sometimes removes values that shouldn't be plotted/should be marked different for the new obs?
                    fig, ax = plt.subplots()
                    if model_name in VALID_AVG_MAG_MODELS:
                        x_param = "midPointMjdTai"
                        ax.axhline(model.avg_mag, c="k", ls="-")
                        ax.axhline(new_obs_model.avg_mag, c="c", ls="--")
                    elif model_name in VALID_PHASE_MODELS:
                        x_param = "phaseAngle"
                        alpha = np.linspace(0, np.amax(df_obs.phaseAngle)) * u.deg
                        ax.plot(
                            alpha.to_value(),
                            model.ReducedMag(alpha),
                        )
                    else:
                        raise ValueError("Invalid phase model.")

                    ax.errorbar(
                        df_obs_old[x_param],
                        df_obs_old[mag_col],
                        df_obs_old[magErr_col],
                        ls="",
                        marker=".",
                        color="k",
                        label="Previous observations",
                    )
                    ax.errorbar(
                        df_obs_new[x_param],
                        df_obs_new[mag_col],
                        df_obs_new[magErr_col],
                        ls="",
                        marker=".",
                        color="c",
                        label="New observations",
                    )
                    ax.errorbar(
                        df_obs_new[diff_cut_outlier_arr][x_param],
                        df_obs_new[diff_cut_outlier_arr][mag_col],
                        df_obs_new[diff_cut_outlier_arr][magErr_col],
                        ls="",
                        marker="x",
                        color="b",
                        label="Outliers",
                    )
                    ax.invert_yaxis()
                    ax.set_xlabel(x_param)
                    ax.set_ylabel(f"{filt}-band Reduced Magnitude")
                    # plot_filepath = f"{output_dir}/plots/{planetoid.ssObjectId}_{planetoid.AdlerData.modelId}_{filt}_outliers.png"
                    # fig.savefig(
                    #     plot_filepath,
                    #     bbox_inches="tight",
                    #     pad_inches=0.05,
                    # )
                    # plt.close(fig)
                    # print(f"Plot saved to {plot_filepath}")

            # Write out AdlerData info
            # Here we can write out the calculated information to a database
            # planetoid.AdlerData.write_to_database(output_db, write_model_data=write_model_data_flag)

        # This will generate a summary of what was found
        # generate_summary_csvs(
        #     output_db,
        #     f"{output_dir}/{planetoid.AdlerData.modelId}",
        #     output_cols=["ssObjectId"],
        #     filter_list=planetoid.AdlerData.filter_list,
        # )
5 objects to analyze
Objects to process for 60799.5:   0%|          | 0/5 [00:00<?, ?it/s]Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Objects to process for 60799.5:  60%|██████    | 3/5 [00:00<00:00, 27.32it/s]Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Objects to process for 60799.5: 100%|██████████| 5/5 [00:00<00:00, 26.28it/s]
Previous observations (date < 60798.5): 133
New observations (60798.5 <= date < 60799.5): 14
No sustained outlier detected
Previous observations (date < 60798.5): 141
New observations (60798.5 <= date < 60799.5): 63
No sustained outlier detected
Previous observations (date < 60798.5): 100
New observations (60798.5 <= date < 60799.5): 10
No sustained outlier detected
Previous observations (date < 60798.5): 111
New observations (60798.5 <= date < 60799.5): 47
No sustained outlier detected
Previous observations (date < 60798.5): 5
New observations (60798.5 <= date < 60799.5): 0
No new observations in g, continuing to next band/object
Previous observations (date < 60798.5): 34
New observations (60798.5 <= date < 60799.5): 16
No sustained outlier detected
Previous observations (date < 60798.5): 39
New observations (60798.5 <= date < 60799.5): 3
No sustained outlier detected
Previous observations (date < 60798.5): 50
New observations (60798.5 <= date < 60799.5): 18
No sustained outlier detected
Previous observations (date < 60798.5): 39
New observations (60798.5 <= date < 60799.5): 3
Previous observations (date < 60798.5): 50
New observations (60798.5 <= date < 60799.5): 18
No sustained outlier detected
Objects to process for 60799.5:   0%|          | 0/5 [00:00<?, ?it/s]Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Previous observations (date < 60796.5): 46
New observations (60796.5 <= date < 60799.5): 101
No sustained outlier detected
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Objects to process for 60799.5:  60%|██████    | 3/5 [00:00<00:00, 27.13it/s]Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Objects to process for 60799.5: 100%|██████████| 5/5 [00:00<00:00, 25.54it/s]
Previous observations (date < 60796.5): 41
New observations (60796.5 <= date < 60799.5): 163
No sustained outlier detected
Previous observations (date < 60796.5): 24
New observations (60796.5 <= date < 60799.5): 86
No sustained outlier detected
Previous observations (date < 60796.5): 27
New observations (60796.5 <= date < 60799.5): 131
No sustained outlier detected
Previous observations (date < 60796.5): 0
New observations (60796.5 <= date < 60799.5): 5
Insufficient number of previous observations, continuing to next band/object
Previous observations (date < 60796.5): 6
New observations (60796.5 <= date < 60799.5): 44
No sustained outlier detected
Previous observations (date < 60796.5): 26
New observations (60796.5 <= date < 60799.5): 16
No sustained outlier detected
Previous observations (date < 60796.5): 26
New observations (60796.5 <= date < 60799.5): 42
No sustained outlier detected
Previous observations (date < 60796.5): 26
New observations (60796.5 <= date < 60799.5): 16
Previous observations (date < 60796.5): 26
New observations (60796.5 <= date < 60799.5): 42
No sustained outlier detected
Objects to process for 60799.5:   0%|          | 0/5 [00:00<?, ?it/s]Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Previous observations (date < 60798.5): 126
New observations (60798.5 <= date < 60799.5): 14
No sustained outlier detected
Previous observations (date < 60798.5): 130
New observations (60798.5 <= date < 60799.5): 63
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
No sustained outlier detected
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Objects to process for 60799.5:  60%|██████    | 3/5 [00:00<00:00, 27.67it/s]Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Objects to process for 60799.5: 100%|██████████| 5/5 [00:00<00:00, 27.38it/s]
Previous observations (date < 60798.5): 96
New observations (60798.5 <= date < 60799.5): 10
No sustained outlier detected
Previous observations (date < 60798.5): 103
New observations (60798.5 <= date < 60799.5): 47
No sustained outlier detected
Previous observations (date < 60798.5): 5
New observations (60798.5 <= date < 60799.5): 0
No new observations in g, continuing to next band/object
Previous observations (date < 60798.5): 34
New observations (60798.5 <= date < 60799.5): 16
No sustained outlier detected
Previous observations (date < 60798.5): 33
New observations (60798.5 <= date < 60799.5): 3
No sustained outlier detected
Previous observations (date < 60798.5): 44
New observations (60798.5 <= date < 60799.5): 18
No sustained outlier detected
Previous observations (date < 60798.5): 33
New observations (60798.5 <= date < 60799.5): 3
No sustained outlier detected
Previous observations (date < 60798.5): 44
New observations (60798.5 <= date < 60799.5): 18
No sustained outlier detected
Objects to process for 60799.5:   0%|          | 0/5 [00:00<?, ?it/s]Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Previous observations (date < 60796.5): 39
New observations (60796.5 <= date < 60799.5): 101
No sustained outlier detected
Previous observations (date < 60796.5): 30
New observations (60796.5 <= date < 60799.5): 163
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
No sustained outlier detected
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
Previous observations (date < 60796.5): 20
New observations (60796.5 <= date < 60799.5): 86
No sustained outlier detected
Previous observations (date < 60796.5): 19
New observations (60796.5 <= date < 60799.5): 131
No sustained outlier detected
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Objects to process for 60799.5:  60%|██████    | 3/5 [00:00<00:00, 26.00it/s]Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
SSObjectId = provid; diaSourceId = obsid; magErr = rmsmag
mjd_utc is converted to mjd_tai and presented as midPointMjdTai
phaseAngle, topocentricDist and heliocentricDist are not currently corrected for light travel time effects
heliocentricX, heliocentricY, heliocentricZ, topocentricX, topocentricY, topocentricZ, eclipticLambda, eclipticBeta are unpopulated and selected as NULLs.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
ssObjectId = fullDesignation; fullDesignation = fullDesignation; tperi = t_p
mpcDesignation, mpcNumber, mpcG, n, uncertaintyParameter, flags are unpopulated and selected as NULL/0.
mpcG unpopulated in MPCORB table for this object. Storing NaN instead.
n unpopulated in MPCORB table for this object. Storing NaN instead.
Constructing from the MPC obs_sbn table populates the following LSST schema columns as their best case obs_sbn analogs (LSST column name = obs_sbn column name):
All columns other than numObs/'band'_Ndata are selected as NULL/0.
discoverySubmissionDate unpopulated in SSObject table for this object. Storing NaN instead.
firstObservationDate unpopulated in SSObject table for this object. Storing NaN instead.
arc unpopulated in SSObject table for this object. Storing NaN instead.
maxExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
minExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
medianExtendedness unpopulated in SSObject table for this object. Storing NaN instead.
g_H unpopulated in SSObject table for this object. Storing NaN instead.
g_G12 unpopulated in SSObject table for this object. Storing NaN instead.
g_HErr unpopulated in SSObject table for this object. Storing NaN instead.
g_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
r_H unpopulated in SSObject table for this object. Storing NaN instead.
r_G12 unpopulated in SSObject table for this object. Storing NaN instead.
r_HErr unpopulated in SSObject table for this object. Storing NaN instead.
r_G12Err unpopulated in SSObject table for this object. Storing NaN instead.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Input model name median does not match model name  in AdlerData. Parameters will be overwritten.
Objects to process for 60799.5: 100%|██████████| 5/5 [00:00<00:00, 25.57it/s]
Previous observations (date < 60796.5): 0
New observations (60796.5 <= date < 60799.5): 5
Insufficient number of previous observations, continuing to next band/object
Previous observations (date < 60796.5): 6
New observations (60796.5 <= date < 60799.5): 44
No sustained outlier detected
Previous observations (date < 60796.5): 20
New observations (60796.5 <= date < 60799.5): 16
No sustained outlier detected
Previous observations (date < 60796.5): 20
New observations (60796.5 <= date < 60799.5): 42
No sustained outlier detected
Previous observations (date < 60796.5): 20
New observations (60796.5 <= date < 60799.5): 16
Previous observations (date < 60796.5): 20
New observations (60796.5 <= date < 60799.5): 42
No sustained outlier detected

[4]:
# # ssObjectId = "2025 MX40Fake"
# # schema = "MPC"
# # process_mjd = 60799.5
# # data_timespan = 30
# # n_new_nights = 3
# # model_name = "median"

# ssObjectId = "6098332225018000"
# schema = "dp03_catalogs_10yr"
# process_mjd = 63335.5
# data_timespan = 400
# n_new_nights = 31
# model_name = "HG12_Pen16"

# output_db = (
#     f"{output_dir}/adler_output_{model_name}_{process_mjd:.1f}_{data_timespan}n_{n_new_nights}n.sqlite"
# )

# if schema == "MPC":
#     planetoid = AdlerPlanetoid.construct_from_mpc_obs_sbn(
#         ssObjectId=ssObjectId,
#         sql_filename=input_sql_file,
#         filter_list=filter_list,
#         date_range=[process_mjd - data_timespan, process_mjd],
#     )
# elif schema == "dp03_catalogs_10yr":
#     planetoid = AdlerPlanetoid.construct_from_SQL(
#         ssObjectId=ssObjectId,
#         sql_filename=input_sql_file,
#         filter_list=filter_list,
#         date_range=[process_mjd - data_timespan, process_mjd],
#     )
# else:
#     raise ValueError("Schema not recognised")

# # You can populate AdlerData from the database as follows
# planetoid.AdlerData.populate_from_database(output_db)
[5]:
# planetoid.AdlerData
[6]:
# # Quickly check what objects triggered the outlier detection by reading in the CSV file (no SQL needed!)
# # Simple magnitude difference
# mag_diff_df = pd.read_csv(
#     f"{output_dir}/median_{process_mjd:.1f}_{data_timespan}n_{n_new_nights}n_outliers.csv"
# )
# mag_diff_df

# # # Sigma-space outliers
# # std_diff_df = pd.read_csv(f"{output_dir}/median__{process_mjd:.1f}_{data_timespan}n_{n_new_nights}n_std_outliers.csv")
# # std_diff_df

# # # Sustained outliers
# # sus_outliers_df = pd.read_csv(f"{output_dir}/median__{process_mjd:.1f}_{data_timespan}n_{n_new_nights}n_sustained_outliers.csv")
# # sus_outliers_df
[ ]:

[ ]: