diff --git a/data/Publications.json b/data/Publications.json index d5bbd5689..a673cefb0 100644 --- a/data/Publications.json +++ b/data/Publications.json @@ -6922,5 +6922,11 @@ "bibcode": "", "doi": "", "description": "Rothermich in prep." + }, + { + "reference": "Veda20", + "bibcode": "2020ApJ...903L..33V", + "doi": "10.3847/2041-8213/abc256", + "description": "Direct Radio Discovery of a Cold Brown Dwarf" } ] \ No newline at end of file diff --git a/data/[vcs2020]_bdr_j1750+3809.json b/data/[vcs2020]_bdr_j1750+3809.json new file mode 100644 index 000000000..61e078802 --- /dev/null +++ b/data/[vcs2020]_bdr_j1750+3809.json @@ -0,0 +1,45 @@ +{ + "Sources": [ + { + "source": "[VCS2020] BDR J1750+3809", + "ra": 267.5047083333333, + "dec": 38.15541666666667, + "epoch": null, + "equinox": null, + "shortname": null, + "reference": "Veda20", + "other_references": null, + "comments": null + } + ], + "Names": [ + { + "other_name": "BDR J1750+3809" + }, + { + "other_name": "[VCS2020] BDR J1750+3809" + } + ], + "ProperMotions": [ + { + "mu_ra": -120.0, + "mu_ra_error": 30.0, + "mu_dec": 200.0, + "mu_dec_error": 30.0, + "adopted": true, + "comments": null, + "reference": "Veda20" + } + ], + "SpectralTypes": [ + { + "spectral_type_string": "T6.5", + "spectral_type_code": 86.5, + "spectral_type_error": 1.0, + "regime": "nir", + "adopted": null, + "comments": null, + "reference": "Veda20" + } + ] +} \ No newline at end of file diff --git a/scripts/ingests/ingest_BDR_J1750+3809.py b/scripts/ingests/ingest_BDR_J1750+3809.py new file mode 100644 index 000000000..38b221721 --- /dev/null +++ b/scripts/ingests/ingest_BDR_J1750+3809.py @@ -0,0 +1,57 @@ +#script ingest first data into companion tables + +from scripts.ingests.ingest_utils import * +from scripts.ingests.utils import * +from astropy.table import Table +import astropy.units as u +from astropy.coordinates import Angle + +SAVE_DB = False # save the data files in addition to modifying the .db file +RECREATE_DB = True # recreates the .db file from the data files + +# LOAD THE DATABASE +db = load_simpledb('SIMPLE.db', recreatedb=RECREATE_DB) + + +# Ingest 2MASS J01415823-4633574 and its reference +#doi- 10.3847/2041-8213/abc256 +#bibcode of coordinates reference- 2020ApJ...903L..33V +ingest_publication(db, doi = '10.3847/2041-8213/abc256', + description = "Direct radio discovery of a cold brown dwarf.", + ignore_ads = False) + + +ra_1750= Angle("17 50 01.13", u.hour).degree +dec_3809=Angle("+38 09 19.5", u.degree).degree + +ingest_sources(db, ["[VCS2020] BDR J1750+3809"], references="Veda20", + ras= [ra_1750], + decs=[dec_3809], + search_db=False) + +# Ingest other name for BDR J1750+3809 (one used in SIMBAD) +# code from deprecated utils does not work +ingest_names(db, '[VCS2020] BDR J1750+3809', 'BDR J1750+3809') + + +# SPECTRAL TYPES +# The spectral type of T6.5 is based on data in the nir regime +ingest_spectral_types(db, sources = ["[VCS2020] BDR J1750+3809"], + spectral_types = "T6.5", + references = "Veda20", + regimes = "nir", + spectral_type_error="1", + comments=None) + +# PROPER MOTIONS +ingest_proper_motions(db, sources = ["[VCS2020] BDR J1750+3809"], + pm_ras = [-120], + pm_ra_errs = [30], + pm_decs = [200], + pm_dec_errs = [30], + pm_references = "Veda20") + +# WRITE THE JSON FILES +if SAVE_DB: + db.save_database(directory='data/') + diff --git a/tests/test_data.py b/tests/test_data.py index 7c096d476..fc2b46a0e 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -359,7 +359,7 @@ def test_spectral_types(db): regime = 'nir' t = db.query(db.SpectralTypes).filter(db.SpectralTypes.c.regime == regime).astropy() - assert len(t) == 380, f'found {len(t)} spectral types in the {regime} regime' + assert len(t) == 381, f'found {len(t)} spectral types in the {regime} regime' regime = 'nir_UCD' t = db.query(db.SpectralTypes).filter(db.SpectralTypes.c.regime == regime).astropy() @@ -386,16 +386,16 @@ def test_spectral_types(db): l_dwarfs = db.query(db.SpectralTypes).filter( and_(db.SpectralTypes.c.spectral_type_code >= 70, db.SpectralTypes.c.spectral_type_code < 80)).astropy() - assert len(l_dwarfs) == 1963, f'found {len(t)} L spectral types' + assert len(l_dwarfs) == 1963, f'found {len(l_dwarfs)} L spectral types' t_dwarfs = db.query(db.SpectralTypes).filter( and_(db.SpectralTypes.c.spectral_type_code >= 80, db.SpectralTypes.c.spectral_type_code < 90)).astropy() - assert len(t_dwarfs) == 998, f'found {len(t)} T spectral types' + assert len(t_dwarfs) == 999, f'found {len(t_dwarfs)} T spectral types' y_dwarfs = db.query(db.SpectralTypes).filter( and_(db.SpectralTypes.c.spectral_type_code >= 90)).astropy() - assert len(y_dwarfs) == 79, f'found {len(t)} Y spectral types' + assert len(y_dwarfs) == 79, f'found {len(y_dwarfs)} Y spectral types' n_spectral_types = db.query(db.SpectralTypes).count() assert len(m_dwarfs) + len(l_dwarfs) + len(t_dwarfs) + len(y_dwarfs) == n_spectral_types