B612-Asteroid-Institute / precovery

Fast precovery of small body observations at scale
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Predicted ephemeris and attribute naming improvements for PrecoveryCandidate, rename catalog_id to exposure_id, expose window_size #22

Closed moeyensj closed 2 years ago

moeyensj commented 2 years ago

Addresses #20.

This PR introduces a new schema for the PrecoveryCandidate dataclass that should make it a little more user-friendly:

class PrecoveryCandidate:
    mjd_utc: float
    ra_deg: float
    dec_deg: float
    ra_sigma_arcsec: float
    dec_sigma_arcsec: float
    mag: float
    mag_sigma: float
    filter: str
    obscode: str
    exposure_id: str
    observation_id: str
    healpix_id: int
    pred_ra_deg: float
    pred_dec_deg: float
    pred_vra_degpday: float
    pred_vdec_degpday: float
    delta_ra_arcsec: float
    delta_dec_arcsec: float
    distance_arcsec: float

The class now also carries the predicted location of the orbit, which will be useful for both generating cutouts and future negative observations analyses.

Lastly, catalog_id has been renamed to exposure_id so that it is consistent throughout the code. Unfortunately, this means existing index.dbs will need to be updated with a name change. Here is a Python snippet that will do that:

import sqlite3 as sql

INDEX_DB = ""

con = sql.connect(INDEX_DB)
con .execute("""ALTER TABLE frames RENAME COLUMN catalog_id TO exposure_id;""")
con.close()
moeyensj commented 2 years ago

PR now also closes #7.