From dab5afc41a761df8e23475dc822c5c79c6e45796 Mon Sep 17 00:00:00 2001 From: Austin Rothermich Date: Fri, 8 Mar 2024 11:17:21 -0500 Subject: [PATCH 01/17] first commit --- .gitignore | 2 + scripts/ingests/Roth24/Spectral_types.ipynb | 55 +++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 scripts/ingests/Roth24/Spectral_types.ipynb diff --git a/.gitignore b/.gitignore index bd62c4b79..eb9083205 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ .pytest_cache .ds_store *.code-workspace +.ipynb_checkpoints + diff --git a/scripts/ingests/Roth24/Spectral_types.ipynb b/scripts/ingests/Roth24/Spectral_types.ipynb new file mode 100644 index 000000000..eabf22150 --- /dev/null +++ b/scripts/ingests/Roth24/Spectral_types.ipynb @@ -0,0 +1,55 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "0c8363db", + "metadata": {}, + "outputs": [ + { + "ename": "ModuleNotFoundError", + "evalue": "No module named 'simple'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0msimple\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mutils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mspectral_types\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mingest_spectral_types\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconvert_spt_string_to_code\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'simple'" + ] + } + ], + "source": [ + "from simple.utils.spectral_types import ingest_spectral_types, convert_spt_string_to_code" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a2c0fa5b", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.9" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From 4eab56c83e95348e859354c03b2c082f79c1fbf1 Mon Sep 17 00:00:00 2001 From: Austin Rothermich Date: Fri, 10 May 2024 11:12:18 -0400 Subject: [PATCH 02/17] start of ingest script --- scripts/ingests/BYW_SpT2024.py | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 scripts/ingests/BYW_SpT2024.py diff --git a/scripts/ingests/BYW_SpT2024.py b/scripts/ingests/BYW_SpT2024.py new file mode 100644 index 000000000..edf05834a --- /dev/null +++ b/scripts/ingests/BYW_SpT2024.py @@ -0,0 +1,53 @@ +from astrodb_utils import load_astrodb +from simple.schema import * + +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_astrodb("SIMPLE.db", recreatedb=RECREATE_DB) + +# Load Google sheet +sheet_id = "1JFa8F4Ngzp3qAW8NOBurkz4bMKo9zXYeF6N1vMtqDZs" +link = f"https://docs.google.com/spreadsheets/d/{sheet_id}/export?format=csv" + +# read the csv data into an astropy table +# ascii.read attempts to read data from local files rather from URLs so using a library like requests helps get data and create object that can be passed to ascii.read +byw_table = ascii.read( + link, + format="csv", + data_start=1, + header_start=0, + guess=False, + fast_reader=False, + delimiter=",", +) + +# print result astropy table +print(byw_table.info) + +# Loop through each row in byw table and print data: source name ra, dec. +def ingest_all_source_spt(db): + for row in byw_table[1:90]: # skip the header row - [1:10]runs only first 10 rows + # Print byw source information + print("BYW Source SpT Information:") + + + for col_name in row.colnames: + print(f"{col_name}: {row[col_name]}") + + ingest_spectral_types( + db, + source=row["Source"], + spectral_type_string=row["spectral_type_string"], + spectral_type_code=row["spectral_type_code"], + spectral_type_error=row["spectral_type_error"], + regime=row["regime"], + adopted=row["adopted"], + comments=row["comments"], + reference=row["Reference"] + raise_error=True, + search_db=True, + ) + + # Add a separator between rows for better readability + print("-" * 20) \ No newline at end of file From d6adf75302fbf51457cd419c0147a577c5d5870c Mon Sep 17 00:00:00 2001 From: Evan <93949832+Exu-112@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:12:44 -0400 Subject: [PATCH 03/17] refactor ingest_spectral_types function --- simple/utils/spectral_types.py | 327 ++++++++++++++------------------- 1 file changed, 139 insertions(+), 188 deletions(-) diff --git a/simple/utils/spectral_types.py b/simple/utils/spectral_types.py index 2dfb8944b..123649ff3 100644 --- a/simple/utils/spectral_types.py +++ b/simple/utils/spectral_types.py @@ -3,6 +3,7 @@ import logging from sqlalchemy import and_ import sqlalchemy.exc +from simple.schema import SpectralTypes from astrodb_utils import ( AstroDBError, find_source_in_db, @@ -18,14 +19,14 @@ logger = logging.getLogger("SIMPLE") -def ingest_spectral_types( +def ingest_spectral_type( db, - sources, - spectral_types, - references, - regimes, - spectral_type_error=None, - comments=None, + source: str = None, + spectral_type: str = None, + reference: str = None, + regime: str = None, + spectral_type_error: float = None, + comments: str = None, ): """ Script to ingest spectral types @@ -33,202 +34,152 @@ def ingest_spectral_types( ---------- db: astrodbkit2.astrodb.Database Database object created by astrodbkit2 - sources: str or list[str] - Names of sources - spectral_types: str or list[strings] - Spectral Types of sources - spectral_type_error: str or list[strings], optional - Spectral Type Errors of sources - regimes: str or list[str] - List or string - comments: list[strings], optional + sources: str + Name of source + spectral_types: str + Spectral Type of source + spectral_type_error: str, optional + Spectral Type Error of source + regimes: str + String + comments: str, optional Comments - references: str or list[strings] + references: str Reference of the Spectral Type Returns ------- None - """ + None - n_sources = len(sources) - - # Convert single element input value to list - input_values = [ - sources, - spectral_types, - spectral_type_error, - regimes, - comments, - references, - ] - for i, input_value in enumerate(input_values): - if input_value is None: - input_values[i] = [None] * n_sources - elif isinstance(input_value, str): - input_values[i] = [input_value] * n_sources - # Convert single element input value to list - ( - sources, - spectral_types, - spectral_type_error, - regimes, - comments, - references, - ) = input_values - - n_added = 0 - n_skipped = 0 - - logger.info(f"Trying to add {n_sources} spectral types") - - for i, source in enumerate(sources): - db_name = find_source_in_db(db, source) - # Spectral Type data is in the database - - if len(db_name) != 1: - msg = ( - f"No unique source match for {source} in the database " - f"(with SpT: {spectral_types[i]} from {references[i]})" - ) - raise AstroDBError(msg) - else: - db_name = db_name[0] + db_name = find_source_in_db(db, source) - adopted = None - source_spt_data = ( - db.query(db.SpectralTypes) - .filter(db.SpectralTypes.c.source == db_name) - .table() + if len(db_name) != 1: + msg = ( + f"No unique source match for {source} in the database " + f"(with SpT: {spectral_type} from {reference})" ) - - if source_spt_data is None or len(source_spt_data) == 0: - adopted: True - logger.debug("No Spectral Type data for this source in the database") - elif len(source_spt_data) > 0: - # Spectral Type Data already exists - dupe_ind = source_spt_data["reference"] == references[i] - if sum(dupe_ind): - logger.debug(f"Duplicate measurement\n, {source_spt_data[dupe_ind]}") - else: - logger.debug("Another Spectral Type exists,") - if logger.level == 10: - source_spt_data.pprint_all() - - adopted_ind = source_spt_data["adopted"] == 1 - if sum(adopted_ind): - old_adopted = source_spt_data[adopted_ind] - if spectral_type_error[i] < min(source_spt_data["spectral_type_error"]): - adopted = True - - if old_adopted: - with db.engine.connect() as conn: - conn.execute( - db.SpectralTypes.update() - .where( - and_( - db.SpectralTypes.c.source - == old_adopted["source"][0], - db.SpectralTypes.c.reference - == old_adopted["reference"][0], - ) - ) - .values(adopted=False) - ) - conn.commit() - # check that adopted flag is successfully changed - old_adopted_data = ( - db.query(db.SpectralTypes) - .filter( - and_( - db.SpectralTypes.c.source - == old_adopted["source"][0], - db.SpectralTypes.c.reference - == old_adopted["reference"][0], - ) - ) - .table() - ) - logger.debug("Old adopted measurement unset") - if logger.level == 10: - old_adopted_data.pprint_all() - - logger.debug(f"The new spectral type's adopted flag is:, {adopted}") + raise AstroDBError(msg) + + adopted = False + old_adopted = None + source_spt_data = ( + db.query(db.SpectralTypes).filter(db.SpectralTypes.c.source == db_name).table() + ) + + # set adopted flag + if source_spt_data is None or len(source_spt_data) == 0: + adopted = True + logger.debug("No Spectral Type data for this source in the database") + elif len(source_spt_data) > 0: + # Spectral Type Data already exists + dupe_ind = source_spt_data["reference"] == reference + if sum(dupe_ind): + logger.debug(f"Duplicate measurement\n, {source_spt_data[dupe_ind]}") else: - msg = "Unexpected state" - logger.error(msg) - raise RuntimeError - - # Convert the spectral type string to code - spectral_type_code = convert_spt_string_to_code(spectral_types[i])[0] - msg = f"Converted {spectral_types[i]} to {spectral_type_code}" - logger.debug(msg) - - # Construct the data to be added - spt_data = [ - { - "source": db_name, - "spectral_type_string": spectral_types[i], - "spectral_type_code": spectral_type_code, - "spectral_type_error": spectral_type_error[i], - "regime": regimes[i], - "adopted": adopted, - "comments": comments[i], - "reference": references[i], - } - ] - - # Check if the entry already exists; if so: skip adding it - check = ( - db.query(db.SpectralTypes.c.source) - .filter( - and_( - db.SpectralTypes.c.source == db_name, - db.SpectralTypes.c.regime == regimes[i], - db.SpectralTypes.c.reference == references[i], - ) + logger.debug("Another Spectral Type exists,") + if logger.level == 10: + source_spt_data.pprint_all() + + adopted_ind = source_spt_data["adopted"] == 1 + if sum(adopted_ind): + old_adopted = source_spt_data[adopted_ind] + if spectral_type_error < min(source_spt_data["spectral_type_error"]): + adopted = True + logger.debug(f"The new spectral type's adopted flag is:, {adopted}") + else: + msg = "Unexpected state" + logger.error(msg) + raise RuntimeError + + spectral_type_code = convert_spt_string_to_code(spectral_type)[0] + msg = f"Converted {spectral_type} to {spectral_type_code}" + logger.debug(msg) + + # Construct the data to be added + spt_data = { + "source": db_name, + "spectral_type_string": spectral_type, + "spectral_type_code": spectral_type_code, + "spectral_type_error": spectral_type_error, + "regime": regime, + "adopted": adopted, + "comments": comments, + "reference": reference, + } + + check = ( + db.query(db.SpectralTypes.c.source) + .filter( + and_( + db.SpectralTypes.c.source == db_name, + db.SpectralTypes.c.regime == regime, + db.SpectralTypes.c.reference == reference, ) - .count() ) - if check == 1: - n_skipped += 1 - logger.info( - f"Spectral type for {db_name} already in the database: skipping insert " - f"{spt_data}" - ) - continue - - logger.debug(f"Trying to insert {spt_data} into Spectral Types table ") - try: + .count() + ) + if check == 1: + msg = f"Spectral type for {db_name} already in the database" + raise AstroDBError(msg) + + logger.debug(f"Trying to insert {spt_data} into Spectral Types table ") + + try: + spt_obj = SpectralTypes(**spt_data) + with db.session as session: + session.add(spt_obj) + session.commit() + logger.info(f"Spectral type added to database: {spt_data}\n") + + # unset old adopted only after ingest is successful! + if adopted and old_adopted is not None: with db.engine.connect() as conn: - conn.execute(db.SpectralTypes.insert().values(spt_data)) + conn.execute( + db.SpectralTypes.update() + .where( + and_( + db.SpectralTypes.c.source == old_adopted["source"][0], + db.SpectralTypes.c.reference == old_adopted["reference"][0], + ) + ) + .values(adopted=False) + ) conn.commit() - n_added += 1 - msg = f"Added {str(spt_data)}" - logger.debug(msg) - except sqlalchemy.exc.IntegrityError as e: - if ( - db.query(db.Publications) - .filter(db.Publications.c.reference == references[i]) - .count() - == 0 - ): - msg = f"The publication does not exist in the database: {references[i]}" - msg1 = "Add it with ingest_publication function." - logger.debug(msg + msg1) - raise AstroDBError(msg) - elif "NOT NULL constraint failed: SpectralTypes.regime" in str(e): - msg = f"The regime was not provided for {source}" - logger.error(msg) - raise AstroDBError(msg) - else: - msg = "Other error\n" - logger.error(msg) - raise AstroDBError(msg) - - msg = f"Spectral types added: {n_added} \n" f"Spectral Types skipped: {n_skipped}" - logger.info(msg) + # check that adopted flag is successfully changed + old_adopted_data = ( + db.query(db.SpectralTypes) + .filter( + and_( + db.SpectralTypes.c.source == old_adopted["source"][0], + db.SpectralTypes.c.reference == old_adopted["reference"][0], + ) + ) + .table() + ) + logger.debug("Old adopted measurement unset") + if logger.level == 10: + old_adopted_data.pprint_all() + except sqlalchemy.exc.IntegrityError as e: + if ( + db.query(db.Publications) + .filter(db.Publications.c.reference == reference) + .count() + == 0 + ): + msg = f"The publication does not exist in the database: {reference}" + msg1 = "Add it with ingest_publication function." + logger.debug(msg + msg1) + raise AstroDBError(msg) + elif "NOT NULL constraint failed: SpectralTypes.regime" in str(e): + msg = f"The regime was not provided for {source}" + logger.error(msg) + raise AstroDBError(msg) + else: + msg = f"Spectral type ingest failed with error {e}\n" + logger.error(msg) + raise AstroDBError(msg) def convert_spt_string_to_code(spectral_types): From ff07a4e5a821bf17c582feef9efaaf680e613919 Mon Sep 17 00:00:00 2001 From: kelle Date: Mon, 22 Jul 2024 23:37:08 -0400 Subject: [PATCH 04/17] trying to get tests to pass --- simple/utils/spectral_types.py | 13 +++-- tests/test_utils.py | 95 +++++++++++++++++----------------- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/simple/utils/spectral_types.py b/simple/utils/spectral_types.py index 123649ff3..157b68f87 100644 --- a/simple/utils/spectral_types.py +++ b/simple/utils/spectral_types.py @@ -11,7 +11,7 @@ __all__ = [ - "ingest_spectral_types", + "ingest_spectral_type", "convert_spt_string_to_code", "convert_spt_code_to_string_to_code", ] @@ -34,24 +34,23 @@ def ingest_spectral_type( ---------- db: astrodbkit2.astrodb.Database Database object created by astrodbkit2 - sources: str + source: str Name of source - spectral_types: str + spectral_type: str Spectral Type of source spectral_type_error: str, optional Spectral Type Error of source - regimes: str + regime: str String - comments: str, optional + comment: str, optional Comments - references: str + reference: str Reference of the Spectral Type Returns ------- None """ - None db_name = find_source_in_db(db, source) diff --git a/tests/test_utils.py b/tests/test_utils.py index 87c8d8cd7..f213a1593 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -5,7 +5,7 @@ ) from simple.utils.spectral_types import ( convert_spt_string_to_code, - ingest_spectral_types, + ingest_spectral_type, ) from simple.utils.companions import ingest_companion_relationships @@ -64,30 +64,53 @@ def test_convert_spt_string_to_code(): assert convert_spt_string_to_code(["Y2pec"]) == [92] -def test_ingest_spectral_types(temp_db): - data1 = Table( - [ - { - "source": "Fake 1", - "spectral_type": "M5.6", - "regime": "nir", - "reference": "Ref 1", - }, - { - "source": "Fake 2", - "spectral_type": "T0.1", - "regime": "nir", - "reference": "Ref 1", - }, - { - "source": "Fake 3", - "spectral_type": "Y2pec", - "regime": "nir", - "reference": "Ref 2", - }, - ] +def test_ingest_spectral_type(temp_db): + spt_data1 = { + "source": "Fake 1", + "spectral_type": "M5.6", + "regime": "nir", + "reference": "Ref 1", + } + spt_data2 = { + "source": "Fake 2", + "spectral_type": "T0.1", + "regime": "nir", + "reference": "Ref 1", + } + spt_data3 = { + "source": "Fake 3", + "spectral_type": "Y2pec", + "regime": "nir", + "reference": "Ref 2", + } + for spt_data in [spt_data1, spt_data2, spt_data3]: + ingest_spectral_type( + temp_db, + source=spt_data["source"], + spectral_type=spt_data["spectral_type"], + reference=spt_data["reference"], + regime=spt_data["regime"], + ) + + assert ( + temp_db.query(temp_db.SpectralTypes) + .filter(temp_db.SpectralTypes.c.reference == "Ref 1") + .count() + == 2 ) + results = ( + temp_db.query(temp_db.SpectralTypes) + .filter(temp_db.SpectralTypes.c.reference == "Ref 2") + .table() + ) + assert len(results) == 1 + assert results["source"][0] == "Fake 3" + assert results["spectral_type_string"][0] == "Y2pec" + assert results["spectral_type_code"][0] == [92] + +def test_ingest_spectral_type_errors(temp_db): + # testing for publication error data3 = Table( [ { @@ -110,31 +133,9 @@ def test_ingest_spectral_types(temp_db): }, ] ) - ingest_spectral_types( - temp_db, - data1["source"], - data1["spectral_type"], - data1["reference"], - data1["regime"], - ) - assert ( - temp_db.query(temp_db.SpectralTypes) - .filter(temp_db.SpectralTypes.c.reference == "Ref 1") - .count() - == 2 - ) - results = ( - temp_db.query(temp_db.SpectralTypes) - .filter(temp_db.SpectralTypes.c.reference == "Ref 2") - .table() - ) - assert len(results) == 1 - assert results["source"][0] == "Fake 3" - assert results["spectral_type_string"][0] == "Y2pec" - assert results["spectral_type_code"][0] == [92] - # testing for publication error + with pytest.raises(AstroDBError) as error_message: - ingest_spectral_types( + ingest_spectral_type( temp_db, data3["source"], data3["spectral_type"], From bf379cc138d7f886d06617f764e26c29f53bf253 Mon Sep 17 00:00:00 2001 From: kelle Date: Tue, 23 Jul 2024 09:59:52 -0400 Subject: [PATCH 05/17] getting tests to pass --- simple/utils/spectral_types.py | 9 ++++-- tests/test_utils.py | 53 +++++++++++++++++----------------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/simple/utils/spectral_types.py b/simple/utils/spectral_types.py index 157b68f87..27b553047 100644 --- a/simple/utils/spectral_types.py +++ b/simple/utils/spectral_types.py @@ -60,6 +60,8 @@ def ingest_spectral_type( f"(with SpT: {spectral_type} from {reference})" ) raise AstroDBError(msg) + else: + db_name = db_name[0] adopted = False old_adopted = None @@ -84,9 +86,10 @@ def ingest_spectral_type( adopted_ind = source_spt_data["adopted"] == 1 if sum(adopted_ind): old_adopted = source_spt_data[adopted_ind] - if spectral_type_error < min(source_spt_data["spectral_type_error"]): - adopted = True - logger.debug(f"The new spectral type's adopted flag is:, {adopted}") + if spectral_type_error is not None: + if spectral_type_error < min(source_spt_data["spectral_type_error"]): + adopted = True + logger.debug(f"The new spectral type's adopted flag is:, {adopted}") else: msg = "Unexpected state" logger.error(msg) diff --git a/tests/test_utils.py b/tests/test_utils.py index f213a1593..287765638 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -111,38 +111,37 @@ def test_ingest_spectral_type(temp_db): def test_ingest_spectral_type_errors(temp_db): # testing for publication error - data3 = Table( - [ - { - "source": "Fake 1", - "spectral_type": "M5.6", - "regime": "nir", - "reference": "Ref 1", - }, - { - "source": "Fake 2", - "spectral_type": "T0.1", - "regime": "nir", - "reference": "Ref 1", - }, - { - "source": "Fake 3", - "spectral_type": "Y2pec", - "regime": "nir", - "reference": "Ref 4", - }, - ] - ) + spt_data4 = { + "source": "Fake 1", + "spectral_type": "M5.6", + "regime": "nir", + "reference": "Ref 1", + } + # spt_data5 = { + # "source": "Fake 2", + # "spectral_type": "T0.1", + # "regime": "nir", + # "reference": "Ref 1", + # } + # spt_data6 = { + # "source": "Fake 3", + # "spectral_type": "Y2pec", + # "regime": "nir", + # "reference": "Ref 4", + # } with pytest.raises(AstroDBError) as error_message: ingest_spectral_type( temp_db, - data3["source"], - data3["spectral_type"], - data3["reference"], - data3["regime"], + spt_data4["source"], + spt_data4["spectral_type"], + spt_data4["reference"], + spt_data4["regime"], ) - assert "The publication does not exist in the database" in str(error_message.value) + assert "Spectral type for Fake 1 already in the database" in str( + error_message.value + ) + # assert "The publication does not exist in the database" in str(error_message.value) def test_companion_relationships(temp_db): From 64dbb2ec8faf6939c5dfe1f3c7db2cf00aa67613 Mon Sep 17 00:00:00 2001 From: kelle Date: Tue, 23 Jul 2024 14:34:38 -0400 Subject: [PATCH 06/17] add photometric column, updating docs --- documentation/SpectralTypes.md | 3 ++- simple/schema.py | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/documentation/SpectralTypes.md b/documentation/SpectralTypes.md index 19d392d71..cedd6edec 100644 --- a/documentation/SpectralTypes.md +++ b/documentation/SpectralTypes.md @@ -7,11 +7,12 @@ Columns marked with an asterisk (*) may not be empty. | Column Name | Description | Unit | Data Type | Key Type | |---|---|---|---|---| | *source | Unique identifier for the source | | String(100) | primary and foreign: Sources.source | -| spectral_type_string | Spectral type string | | String(10) | | +| spectral_type_string | Spectral type string | | String(20) | | | *spectral_type_code | Numeric code corresponding to spectral type | | Float | primary | | spectral_type_error | Uncertainty of spectral type | | Float | | | regime | Regime for spectral type value | | | primary and foreign:Regimes.regime | | adopted | Flag indicating if this is the adopted measurement | | Boolean | | +| photometric | Flag indicating if this is a photometric spectral type | | Boolean | | | comments | Free form comments | | String(1000) | | | *reference | Reference | | String(30) | primary and foreign: Publications.name | diff --git a/simple/schema.py b/simple/schema.py index 48fb29a1a..634d73ad3 100644 --- a/simple/schema.py +++ b/simple/schema.py @@ -300,7 +300,7 @@ class SpectralTypes(Base): nullable=False, primary_key=True, ) - spectral_type_string = Column(String(10), nullable=False, primary_key=True) + spectral_type_string = Column(String(20), nullable=False, primary_key=True) spectral_type_code = Column(Float, nullable=False, primary_key=True) spectral_type_error = Column(Float) regime = Column( @@ -310,6 +310,7 @@ class SpectralTypes(Base): primary_key=True, ) adopted = Column(Boolean) + photometric = Column(Boolean) comments = Column(String(1000)) reference = Column( String(30), @@ -317,6 +318,12 @@ class SpectralTypes(Base): primary_key=True, ) + @validates("source", "spectral_type_code", "reference") + def validate_required(self, key, value): + if value is None: + raise ValueError(f"Value required for {key}") + return value + class Gravities(Base): # Table to store gravity measurements From a0898a6741afcaf3cf13dba372cb6a804b2c1a4d Mon Sep 17 00:00:00 2001 From: kelle Date: Tue, 23 Jul 2024 14:34:55 -0400 Subject: [PATCH 07/17] refactor ingest_spectral_type function --- simple/utils/spectral_types.py | 151 ++++++++++++++++----------------- tests/test_utils.py | 22 +++-- 2 files changed, 88 insertions(+), 85 deletions(-) diff --git a/simple/utils/spectral_types.py b/simple/utils/spectral_types.py index 27b553047..8adaa36d3 100644 --- a/simple/utils/spectral_types.py +++ b/simple/utils/spectral_types.py @@ -22,11 +22,14 @@ def ingest_spectral_type( db, source: str = None, - spectral_type: str = None, - reference: str = None, - regime: str = None, + *, + spectral_type_string: str = None, + spectral_type_code: float = None, spectral_type_error: float = None, + regime: str = None, + photometric: bool = False, comments: str = None, + reference: str = None, ): """ Script to ingest spectral types @@ -46,6 +49,7 @@ def ingest_spectral_type( Comments reference: str Reference of the Spectral Type + Returns ------- @@ -55,10 +59,7 @@ def ingest_spectral_type( db_name = find_source_in_db(db, source) if len(db_name) != 1: - msg = ( - f"No unique source match for {source} in the database " - f"(with SpT: {spectral_type} from {reference})" - ) + msg = f"No unique source match for {source} in the database " raise AstroDBError(msg) else: db_name = db_name[0] @@ -86,7 +87,12 @@ def ingest_spectral_type( adopted_ind = source_spt_data["adopted"] == 1 if sum(adopted_ind): old_adopted = source_spt_data[adopted_ind] - if spectral_type_error is not None: + print("spt_error:", spectral_type_error) + print("source spt data:", source_spt_data["spectral_type_error"]) + if ( + spectral_type_error is not None + and source_spt_data["spectral_type_error"] is not None + ): if spectral_type_error < min(source_spt_data["spectral_type_error"]): adopted = True logger.debug(f"The new spectral type's adopted flag is:, {adopted}") @@ -95,18 +101,20 @@ def ingest_spectral_type( logger.error(msg) raise RuntimeError - spectral_type_code = convert_spt_string_to_code(spectral_type)[0] - msg = f"Converted {spectral_type} to {spectral_type_code}" - logger.debug(msg) + if spectral_type_code is None: + spectral_type_code = convert_spt_string_to_code(spectral_type_string) + msg = f"Converted {spectral_type_string} to {spectral_type_code}" + logger.debug(msg) # Construct the data to be added spt_data = { "source": db_name, - "spectral_type_string": spectral_type, + "spectral_type_string": spectral_type_string, "spectral_type_code": spectral_type_code, "spectral_type_error": spectral_type_error, "regime": regime, "adopted": adopted, + "photometric": photometric, "comments": comments, "reference": reference, } @@ -184,7 +192,7 @@ def ingest_spectral_type( raise AstroDBError(msg) -def convert_spt_string_to_code(spectral_types): +def convert_spt_string_to_code(spectral_type_string): """ normal tests: M0, M5.5, L0, L3.5, T0, T3, T4.5, Y0, Y5, Y9. weird TESTS: sdM4, ≥Y4, T5pec, L2:, L0blue, Lpec, >L9, >M10, >L, T, Y @@ -192,84 +200,71 @@ def convert_spt_string_to_code(spectral_types): :param spectral_types: :return: """ - if isinstance(spectral_types, str): - spectral_types = [spectral_types] - spectral_type_codes = [] - for spt in spectral_types: - logger.debug(f"Trying to convert: `{spt}`") - spt_code = np.nan - if spt == "": - spectral_type_codes.append(spt_code) - logger.debug("Appended NAN") - continue - if spt == "null": - spt_code = 0 - spectral_type_codes.append(spt_code) - logger.debug("Appended Null") - continue - # identify main spectral class, loop over any prefix text to identify MLTY - for i, item in enumerate(spt): - if item == "M": - spt_code = 60 - break - elif item == "L": - spt_code = 70 - break - elif item == "T": - spt_code = 80 - break - elif item == "Y": - spt_code = 90 - break - else: # only trigger if not MLTY - i = 0 - # find integer or decimal subclass and add to spt_code - if re.search(r"\d*\.?\d+", spt[i + 1 :]) is None: - spt_code = spt_code - else: - spt_code += float(re.findall(r"\d*\.?\d+", spt[i + 1 :])[0]) + logger.debug(f"Trying to convert: `{spectral_type_string}`") + spt_code = np.nan + if spectral_type_string == "": + logger.debug("Empty spectral_type_string") + return None + if spectral_type_string == "null": + return None + # identify main spectral class, loop over any prefix text to identify MLTY + for i, item in enumerate(spectral_type_string): + if item == "M": + spt_code = 60 + break + elif item == "L": + spt_code = 70 + break + elif item == "T": + spt_code = 80 + break + elif item == "Y": + spt_code = 90 + break + else: # only trigger if not MLTY + i = 0 + # find integer or decimal subclass and add to spt_code + if re.search(r"\d*\.?\d+", spectral_type_string[i + 1 :]) is None: + spt_code = spt_code + else: + spt_code += float(re.findall(r"\d*\.?\d+", spectral_type_string[i + 1 :])[0]) - spectral_type_codes.append(spt_code) - return spectral_type_codes + return spt_code -def convert_spt_code_to_string_to_code(spectral_codes, decimals=1): +def convert_spt_code_to_string(spectral_code, decimals=1): """ Convert spectral type codes to string values Parameters ---------- - spectral_codes : list[float] - List of spectral type codes + spectral_code : float + A spectral type code + + decimals : int + Number of decimal places to include in the spectral type string Returns ------- - spectral_types : list[str] - List of spectral types + spectral_type_string : str + spectral type string """ - if isinstance(spectral_codes, float): - spectral_codes = [spectral_codes] - - spectral_types = [] - for spt in spectral_codes: - spt_type = "" - - # Identify major type - if 60 <= spt < 70: - spt_type = "M" - elif 70 <= spt < 80: - spt_type = "L" - elif 80 <= spt < 90: - spt_type = "T" - elif 90 <= spt < 100: - spt_type = "Y" + spt_type = "" - # Numeric part of type - format = f".{decimals}f" - spt_type = f"{spt_type}{spt % 10:{format}}" - logger.debug(f"Converting: {spt} -> {spt_type}") + # Identify major type + if 60 <= spectral_code < 70: + spt_type = "M" + elif 70 <= spectral_code < 80: + spt_type = "L" + elif 80 <= spectral_code < 90: + spt_type = "T" + elif 90 <= spectral_code < 100: + spt_type = "Y" - spectral_types.append(spt_type) + # Numeric part of type + format = f".{decimals}f" + spt_type = f"{spt_type}{spectral_code% 10:{format}}" + logger.debug(f"Converting: {spectral_code} -> {spt_type}") - return spectral_types + return spt_type diff --git a/tests/test_utils.py b/tests/test_utils.py index 287765638..4bf6a8da4 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -5,6 +5,7 @@ ) from simple.utils.spectral_types import ( convert_spt_string_to_code, + convert_spt_code_to_string, ingest_spectral_type, ) from simple.utils.companions import ingest_companion_relationships @@ -59,9 +60,16 @@ def t_pm(): def test_convert_spt_string_to_code(): # Test conversion of spectral types into numeric values - assert convert_spt_string_to_code(["M5.6"]) == [65.6] - assert convert_spt_string_to_code(["T0.1"]) == [80.1] - assert convert_spt_string_to_code(["Y2pec"]) == [92] + assert convert_spt_string_to_code("M5.6") == 65.6 + assert convert_spt_string_to_code("T0.1") == 80.1 + assert convert_spt_string_to_code("Y2pec") == 92 + + +def test_convert_spt_code_to_string(): + # Test conversion of spectral types into numeric values + assert convert_spt_code_to_string(65.6) == "M5.6" + assert convert_spt_code_to_string(80.1) == "T0.1" + assert convert_spt_code_to_string(92, decimals=0) == "Y2" def test_ingest_spectral_type(temp_db): @@ -87,7 +95,7 @@ def test_ingest_spectral_type(temp_db): ingest_spectral_type( temp_db, source=spt_data["source"], - spectral_type=spt_data["spectral_type"], + spectral_type_string=spt_data["spectral_type"], reference=spt_data["reference"], regime=spt_data["regime"], ) @@ -134,9 +142,9 @@ def test_ingest_spectral_type_errors(temp_db): ingest_spectral_type( temp_db, spt_data4["source"], - spt_data4["spectral_type"], - spt_data4["reference"], - spt_data4["regime"], + spectral_type_string=spt_data4["spectral_type"], + reference=spt_data4["reference"], + regime=spt_data4["regime"], ) assert "Spectral type for Fake 1 already in the database" in str( error_message.value From ccd91400cbc662297e3866aa996e43ff5ace12bd Mon Sep 17 00:00:00 2001 From: kelle Date: Tue, 23 Jul 2024 15:45:39 -0400 Subject: [PATCH 08/17] add raise_error keyword --- simple/utils/spectral_types.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/simple/utils/spectral_types.py b/simple/utils/spectral_types.py index 8adaa36d3..db962f793 100644 --- a/simple/utils/spectral_types.py +++ b/simple/utils/spectral_types.py @@ -30,6 +30,7 @@ def ingest_spectral_type( photometric: bool = False, comments: str = None, reference: str = None, + raise_error: bool = True, ): """ Script to ingest spectral types @@ -49,6 +50,7 @@ def ingest_spectral_type( Comments reference: str Reference of the Spectral Type + raise_error: bool, optional Returns ------- From 2f1d7ed8a18cb472bba82e4e2ea87bf0e2ba50fd Mon Sep 17 00:00:00 2001 From: kelle Date: Tue, 23 Jul 2024 16:19:30 -0400 Subject: [PATCH 09/17] improve error handling --- documentation/SpectralTypes.md | 6 ++++-- simple/utils/spectral_types.py | 25 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/documentation/SpectralTypes.md b/documentation/SpectralTypes.md index cedd6edec..34b2c6e4b 100644 --- a/documentation/SpectralTypes.md +++ b/documentation/SpectralTypes.md @@ -10,7 +10,7 @@ Columns marked with an asterisk (*) may not be empty. | spectral_type_string | Spectral type string | | String(20) | | | *spectral_type_code | Numeric code corresponding to spectral type | | Float | primary | | spectral_type_error | Uncertainty of spectral type | | Float | | -| regime | Regime for spectral type value | | | primary and foreign:Regimes.regime | +| *regime | Regime for spectral type value | | | primary and foreign:Regimes.regime | | adopted | Flag indicating if this is the adopted measurement | | Boolean | | | photometric | Flag indicating if this is a photometric spectral type | | Boolean | | | comments | Free form comments | | String(1000) | | @@ -21,4 +21,6 @@ Spectral Type Codes: - 69 = M9 - 70 = L0 - 80 = T0 - - 90 = Y0 \ No newline at end of file + - 90 = Y0 + + Regime is required however, regime = "unkwown" can be used when the regime is unknown. \ No newline at end of file diff --git a/simple/utils/spectral_types.py b/simple/utils/spectral_types.py index db962f793..5ba443c18 100644 --- a/simple/utils/spectral_types.py +++ b/simple/utils/spectral_types.py @@ -134,7 +134,11 @@ def ingest_spectral_type( ) if check == 1: msg = f"Spectral type for {db_name} already in the database" - raise AstroDBError(msg) + if raise_error: + logger.error(msg) + raise AstroDBError(msg) + else: + logger.warning(msg) logger.debug(f"Trying to insert {spt_data} into Spectral Types table ") @@ -181,17 +185,20 @@ def ingest_spectral_type( == 0 ): msg = f"The publication does not exist in the database: {reference}" - msg1 = "Add it with ingest_publication function." + msg1 = "Add it with astrodb_utils.ingest_publication function." logger.debug(msg + msg1) - raise AstroDBError(msg) - elif "NOT NULL constraint failed: SpectralTypes.regime" in str(e): - msg = f"The regime was not provided for {source}" - logger.error(msg) - raise AstroDBError(msg) + if raise_error: + logger.error(msg) + raise AstroDBError(msg + msg1) + else: + logger.warning(msg) else: msg = f"Spectral type ingest failed with error {e}\n" - logger.error(msg) - raise AstroDBError(msg) + if raise_error: + logger.error(msg) + raise AstroDBError(msg) + else: + logger.warning(msg) def convert_spt_string_to_code(spectral_type_string): From 570f0e3701b67f328a918c636bbcc6d8f5c1951a Mon Sep 17 00:00:00 2001 From: kelle Date: Tue, 23 Jul 2024 16:49:43 -0400 Subject: [PATCH 10/17] error handling --- simple/schema.py | 3 +-- simple/utils/spectral_types.py | 49 +++++++++++++++++++--------------- tests/test_utils.py | 4 +-- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/simple/schema.py b/simple/schema.py index 634d73ad3..6461f0d08 100644 --- a/simple/schema.py +++ b/simple/schema.py @@ -306,7 +306,6 @@ class SpectralTypes(Base): regime = Column( String(30), ForeignKey("Regimes.regime", ondelete="cascade", onupdate="cascade"), - nullable=True, primary_key=True, ) adopted = Column(Boolean) @@ -318,7 +317,7 @@ class SpectralTypes(Base): primary_key=True, ) - @validates("source", "spectral_type_code", "reference") + @validates("source", "spectral_type_code", "regime", "reference") def validate_required(self, key, value): if value is None: raise ValueError(f"Value required for {key}") diff --git a/simple/utils/spectral_types.py b/simple/utils/spectral_types.py index 5ba443c18..4dc69e2a3 100644 --- a/simple/utils/spectral_types.py +++ b/simple/utils/spectral_types.py @@ -17,6 +17,7 @@ ] logger = logging.getLogger("SIMPLE") +logger.setLevel(logging.INFO) # set default log level to INFO def ingest_spectral_type( @@ -72,6 +73,26 @@ def ingest_spectral_type( db.query(db.SpectralTypes).filter(db.SpectralTypes.c.source == db_name).table() ) + # Check for duplicates + duplicate_check = ( + db.query(db.SpectralTypes.c.source) + .filter( + and_( + db.SpectralTypes.c.source == db_name, + db.SpectralTypes.c.regime == regime, + db.SpectralTypes.c.reference == reference, + ) + ) + .count() + ) + if duplicate_check > 0: + msg = f"Spectral type already in the database: {db_name}, {regime}, {reference}" + if raise_error: + logger.error(msg) + raise AstroDBError(msg) + else: + logger.warning(msg) + # set adopted flag if source_spt_data is None or len(source_spt_data) == 0: adopted = True @@ -99,9 +120,12 @@ def ingest_spectral_type( adopted = True logger.debug(f"The new spectral type's adopted flag is:, {adopted}") else: - msg = "Unexpected state" - logger.error(msg) - raise RuntimeError + msg = f"Unexpected state while ingesting {source}" + if raise_error: + logger.error(msg) + raise RuntimeError + else: + logger.warning(msg) if spectral_type_code is None: spectral_type_code = convert_spt_string_to_code(spectral_type_string) @@ -121,25 +145,6 @@ def ingest_spectral_type( "reference": reference, } - check = ( - db.query(db.SpectralTypes.c.source) - .filter( - and_( - db.SpectralTypes.c.source == db_name, - db.SpectralTypes.c.regime == regime, - db.SpectralTypes.c.reference == reference, - ) - ) - .count() - ) - if check == 1: - msg = f"Spectral type for {db_name} already in the database" - if raise_error: - logger.error(msg) - raise AstroDBError(msg) - else: - logger.warning(msg) - logger.debug(f"Trying to insert {spt_data} into Spectral Types table ") try: diff --git a/tests/test_utils.py b/tests/test_utils.py index 4bf6a8da4..bb57a6dba 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -146,9 +146,7 @@ def test_ingest_spectral_type_errors(temp_db): reference=spt_data4["reference"], regime=spt_data4["regime"], ) - assert "Spectral type for Fake 1 already in the database" in str( - error_message.value - ) + assert "Spectral type already in the database" in str(error_message.value) # assert "The publication does not exist in the database" in str(error_message.value) From 680ac25b64b07db8ac8548b62d77a477cfabddfb Mon Sep 17 00:00:00 2001 From: Austin Rothermich Date: Tue, 23 Jul 2024 17:24:00 -0400 Subject: [PATCH 11/17] Updated working script and tests --- scripts/ingests/BYW_SpT2024.py | 56 ++++++++++++++++++---------------- tests/test_data.py | 8 ++--- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/scripts/ingests/BYW_SpT2024.py b/scripts/ingests/BYW_SpT2024.py index edf05834a..13f8f5796 100644 --- a/scripts/ingests/BYW_SpT2024.py +++ b/scripts/ingests/BYW_SpT2024.py @@ -1,19 +1,26 @@ from astrodb_utils import load_astrodb +from astrodb_utils import ingest_publication from simple.schema import * +from simple.schema import REFERENCE_TABLES +from astropy.io import ascii +from simple.utils.spectral_types import ingest_spectral_type +import logging +logger = logging.getLogger("SIMPLE") +logger.setLevel(logging.INFO) 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_astrodb("SIMPLE.db", recreatedb=RECREATE_DB) - +db = load_astrodb("SIMPLE.sqlite", recreatedb=RECREATE_DB, reference_tables=REFERENCE_TABLES) +ingest_publication(db, doi='10.3847/1538-3881/ad324e' ) # Load Google sheet -sheet_id = "1JFa8F4Ngzp3qAW8NOBurkz4bMKo9zXYeF6N1vMtqDZs" -link = f"https://docs.google.com/spreadsheets/d/{sheet_id}/export?format=csv" + +link = 'scripts/ingests/Austin-BYW-Benchmark-SpT.csv' # read the csv data into an astropy table # ascii.read attempts to read data from local files rather from URLs so using a library like requests helps get data and create object that can be passed to ascii.read byw_table = ascii.read( - link, + link, #change this to the path for the csv file format="csv", data_start=1, header_start=0, @@ -22,32 +29,29 @@ delimiter=",", ) -# print result astropy table -print(byw_table.info) - -# Loop through each row in byw table and print data: source name ra, dec. -def ingest_all_source_spt(db): - for row in byw_table[1:90]: # skip the header row - [1:10]runs only first 10 rows - # Print byw source information - print("BYW Source SpT Information:") +for row in byw_table: # skip the header row - [1:10]runs only first 10 rows + if row["photometric"] == 'True': + photometric = True + else: + photometric = False + preexisting = ['CWISE J183207.94-540943.3', + 'SDSS J134403.83+083950.9'] + if row["Source"] in preexisting: + continue - for col_name in row.colnames: - print(f"{col_name}: {row[col_name]}") - - ingest_spectral_types( + ingest_spectral_type( db, source=row["Source"], spectral_type_string=row["spectral_type_string"], - spectral_type_code=row["spectral_type_code"], spectral_type_error=row["spectral_type_error"], regime=row["regime"], - adopted=row["adopted"], comments=row["comments"], - reference=row["Reference"] - raise_error=True, - search_db=True, - ) - - # Add a separator between rows for better readability - print("-" * 20) \ No newline at end of file + photometric=photometric, + reference=row["Reference"], + raise_error=False, + ) + + # WRITE THE JSON FILES +if SAVE_DB: + db.save_database(directory="data/") \ No newline at end of file diff --git a/tests/test_data.py b/tests/test_data.py index 96a807a7e..fb299bb57 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -324,7 +324,7 @@ def test_spectral_types(db): regime = "nir" t = db.query(db.SpectralTypes).filter(db.SpectralTypes.c.regime == regime).astropy() - assert len(t) == 2359, f"found {len(t)} spectral types in the {regime} regime" + assert len(t) == 2446, 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() @@ -353,7 +353,7 @@ def test_spectral_types(db): ) .astropy() ) - assert len(m_dwarfs) == 843, f"found {len(t)} M spectral types" + assert len(m_dwarfs) == 861, f"found {len(t)} M spectral types" l_dwarfs = ( db.query(db.SpectralTypes) @@ -365,7 +365,7 @@ def test_spectral_types(db): ) .astropy() ) - assert len(l_dwarfs) == 1963, f"found {len(l_dwarfs)} L spectral types" + assert len(l_dwarfs) == 2011, f"found {len(l_dwarfs)} L spectral types" t_dwarfs = ( db.query(db.SpectralTypes) @@ -377,7 +377,7 @@ def test_spectral_types(db): ) .astropy() ) - assert len(t_dwarfs) == 998, f"found {len(t_dwarfs)} T spectral types" + assert len(t_dwarfs) == 1019, f"found {len(t_dwarfs)} T spectral types" y_dwarfs = ( db.query(db.SpectralTypes) From 406cb1ccb65399d78d873e27ddd4317962457b5f Mon Sep 17 00:00:00 2001 From: Austin Rothermich Date: Fri, 26 Jul 2024 15:07:03 -0400 Subject: [PATCH 12/17] Extra prints commented out --- simple/utils/spectral_types.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/simple/utils/spectral_types.py b/simple/utils/spectral_types.py index 8207534eb..63b04992c 100644 --- a/simple/utils/spectral_types.py +++ b/simple/utils/spectral_types.py @@ -244,8 +244,8 @@ def adopt_spectral_type(db, source, spectral_type_error): elif len(source_spt_data) > 0: # Spectral Type Data already exists logger.debug("Pre-existing Spectral Type data:") - if logger.level <= 10: - source_spt_data.pprint_all() + #if logger.level <= 10: + # source_spt_data.pprint_all() adopted_ind = source_spt_data["adopted"] == 1 if sum(adopted_ind): old_adopted = source_spt_data[adopted_ind] @@ -314,8 +314,8 @@ def check_one_adopted_sptype(db, source, raise_error=True): .table() ) logger.debug(f"Adopted measurements for {source}:{results}") - if logger.level <= 10: - results.pprint_all() + #if logger.level <= 10: + # results.pprint_all() logger.debug(f"adopted column: {results['adopted']}") if len(results) == 1: logger.debug(f"One adopted measurement for {source}") From 5aad6ff4b8a3abe300923c482864a2b248752109 Mon Sep 17 00:00:00 2001 From: Austin Rothermich Date: Fri, 26 Jul 2024 15:07:32 -0400 Subject: [PATCH 13/17] completed ingest script --- scripts/ingests/BYW_SpT2024.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/ingests/BYW_SpT2024.py b/scripts/ingests/BYW_SpT2024.py index 13f8f5796..31dc1ed83 100644 --- a/scripts/ingests/BYW_SpT2024.py +++ b/scripts/ingests/BYW_SpT2024.py @@ -1,14 +1,16 @@ from astrodb_utils import load_astrodb from astrodb_utils import ingest_publication +import sys +sys.path.append(".") from simple.schema import * from simple.schema import REFERENCE_TABLES from astropy.io import ascii from simple.utils.spectral_types import ingest_spectral_type import logging -logger = logging.getLogger("SIMPLE") +logger = logging.getLogger("AstroDB") logger.setLevel(logging.INFO) -SAVE_DB = False # save the data files in addition to modifying the .db file +SAVE_DB = True # 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_astrodb("SIMPLE.sqlite", recreatedb=RECREATE_DB, reference_tables=REFERENCE_TABLES) @@ -46,7 +48,6 @@ spectral_type_string=row["spectral_type_string"], spectral_type_error=row["spectral_type_error"], regime=row["regime"], - comments=row["comments"], photometric=photometric, reference=row["Reference"], raise_error=False, From 43080a08601047c8e3479f07ba4f210a1393a21b Mon Sep 17 00:00:00 2001 From: Austin Rothermich Date: Fri, 26 Jul 2024 15:08:11 -0400 Subject: [PATCH 14/17] JSON files and test --- data/Publications.json | 6 ++++++ data/cwise_j000021.45-481314.9.json | 12 ++++++++++++ data/cwise_j002029.72-153527.5.json | 12 ++++++++++++ data/cwise_j002101.45-334631.5.json | 12 ++++++++++++ data/cwise_j002159.02-451434.4.json | 12 ++++++++++++ data/cwise_j002414.30-403053.7.json | 12 ++++++++++++ data/cwise_j002658.73-260859.6.json | 12 ++++++++++++ data/cwise_j004218.67+291730.6.json | 12 ++++++++++++ data/cwise_j004945.38+423619.3.json | 12 ++++++++++++ data/cwise_j005635.48-240401.9.json | 12 ++++++++++++ data/cwise_j010424.50+133949.8.json | 12 ++++++++++++ data/cwise_j011003.61-592650.8.json | 12 ++++++++++++ data/cwise_j012715.52-300246.9.json | 12 ++++++++++++ data/cwise_j013719.04+342837.6.json | 12 ++++++++++++ data/cwise_j015905.58+105551.5.json | 12 ++++++++++++ data/cwise_j020538.20+594452.2.json | 12 ++++++++++++ data/cwise_j022454.80+152629.5.json | 12 ++++++++++++ data/cwise_j022737.75+083008.8.json | 12 ++++++++++++ data/cwise_j025645.16-335008.9.json | 12 ++++++++++++ data/cwise_j030005.73-062218.6.json | 12 ++++++++++++ data/cwise_j032853.32-112332.6.json | 12 ++++++++++++ data/cwise_j055515.83+510514.0.json | 12 ++++++++++++ data/cwise_j055909.00-384219.8.json | 12 ++++++++++++ data/cwise_j060202.17-462447.8.json | 12 ++++++++++++ data/cwise_j062000.01+344641.3.json | 12 ++++++++++++ data/cwise_j062648.96+594129.2.json | 12 ++++++++++++ data/cwise_j062727.34-002826.8.json | 12 ++++++++++++ data/cwise_j062909.21+395701.6.json | 12 ++++++++++++ data/cwise_j065752.45+163350.2.json | 12 ++++++++++++ data/cwise_j073831.31+525453.7.json | 12 ++++++++++++ data/cwise_j080912.95+741704.3.json | 12 ++++++++++++ data/cwise_j085131.24-603056.2.json | 12 ++++++++++++ data/cwise_j091558.53+254713.0.json | 12 ++++++++++++ data/cwise_j091902.55-574837.3.json | 12 ++++++++++++ data/cwise_j094352.22+335639.1.json | 12 ++++++++++++ data/cwise_j095259.54-505418.9.json | 12 ++++++++++++ data/cwise_j101017.43-242300.4.json | 12 ++++++++++++ data/cwise_j101317.51-010313.6.json | 12 ++++++++++++ data/cwise_j101523.92-111539.6.json | 12 ++++++++++++ data/cwise_j103734.29-050749.8.json | 12 ++++++++++++ data/cwise_j104053.42-355029.7.json | 12 ++++++++++++ data/cwise_j115229.05-351105.9.json | 12 ++++++++++++ data/cwise_j124033.48+460544.7.json | 12 ++++++++++++ data/cwise_j125858.20+001133.2.json | 12 ++++++++++++ data/cwise_j130329.90+512754.0.json | 12 ++++++++++++ data/cwise_j130446.64-120023.6.json | 12 ++++++++++++ data/cwise_j131355.15+223005.6.json | 12 ++++++++++++ data/cwise_j132539.70+022309.4.json | 12 ++++++++++++ data/cwise_j132857.58-063747.4.json | 12 ++++++++++++ data/cwise_j133211.93-374837.9.json | 12 ++++++++++++ data/cwise_j133427.70-273053.1.json | 12 ++++++++++++ data/cwise_j141737.21+041847.2.json | 12 ++++++++++++ data/cwise_j143935.94-804851.5.json | 12 ++++++++++++ data/cwise_j143951.51+260000.3.json | 12 ++++++++++++ data/cwise_j144057.87+380432.8.json | 12 ++++++++++++ data/cwise_j151939.68-485820.4.json | 12 ++++++++++++ data/cwise_j152742.44-121528.2.json | 12 ++++++++++++ data/cwise_j153910.07+722757.2.json | 12 ++++++++++++ data/cwise_j160654.19-103214.7.json | 12 ++++++++++++ data/cwise_j162511.27+774946.8.json | 12 ++++++++++++ data/cwise_j165143.63+695259.4.json | 12 ++++++++++++ data/cwise_j165325.10+490439.7.json | 12 ++++++++++++ data/cwise_j171308.00+644220.8.json | 12 ++++++++++++ data/cwise_j171700.57+724437.3.json | 12 ++++++++++++ data/cwise_j173859.73+200501.2.json | 12 ++++++++++++ data/cwise_j174426.85+230355.1.json | 12 ++++++++++++ data/cwise_j174509.03+380733.2.json | 12 ++++++++++++ data/cwise_j190909.62+553027.1.json | 12 ++++++++++++ data/cwise_j192425.03-532837.1.json | 12 ++++++++++++ data/cwise_j195956.16-644318.1.json | 12 ++++++++++++ data/cwise_j200304.70-142228.9.json | 12 ++++++++++++ data/cwise_j200813.66-124502.4.json | 12 ++++++++++++ data/cwise_j202934.80-791013.1.json | 12 ++++++++++++ data/cwise_j205247.07+053855.7.json | 12 ++++++++++++ data/cwise_j210640.16+250729.0.json | 12 ++++++++++++ data/cwise_j212342.88+655615.6.json | 12 ++++++++++++ data/cwise_j214129.80-024623.6.json | 12 ++++++++++++ data/cwise_j214213.99-204659.8.json | 12 ++++++++++++ data/cwise_j221418.15+253432.2.json | 12 ++++++++++++ data/cwise_j224452.18-362946.0.json | 12 ++++++++++++ data/cwise_j225525.22-302320.8.json | 12 ++++++++++++ data/cwise_j231824.58+052142.3.json | 12 ++++++++++++ data/cwise_j233531.55+014219.6.json | 12 ++++++++++++ data/cwise_j235827.96-521813.4.json | 12 ++++++++++++ data/cwisep_j040351.00-491605.6.json | 10 ++++++++++ data/cwisep_j085938.95+534908.7.json | 10 ++++++++++ data/ulas_j103131.49+123736.4.json | 12 ++++++++++++ data/wisea_j040702.42+190945.8.json | 10 ++++++++++ tests/test_data.py | 6 +++--- 89 files changed, 1047 insertions(+), 3 deletions(-) diff --git a/data/Publications.json b/data/Publications.json index bfcb4cde7..af9de4a69 100644 --- a/data/Publications.json +++ b/data/Publications.json @@ -7300,5 +7300,11 @@ "bibcode": "", "doi": "", "description": "UKIDSS DR11+ Release: http://wsa.roe.ac.uk/dr11plus_release.html" + }, + { + "reference": "Roth24", + "bibcode": "2024AJ....167..253R", + "doi": "10.3847/1538-3881/ad324e", + "description": "89 New Ultracool Dwarf Comoving Companions Identified with the Backyard Worlds: Planet 9 Citizen Science Project" } ] \ No newline at end of file diff --git a/data/cwise_j000021.45-481314.9.json b/data/cwise_j000021.45-481314.9.json index d79e1a87a..b4bad3388 100644 --- a/data/cwise_j000021.45-481314.9.json +++ b/data/cwise_j000021.45-481314.9.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J000021.45-481314.9" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L4)", + "spectral_type_code": 74.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j002029.72-153527.5.json b/data/cwise_j002029.72-153527.5.json index 676b23f61..53f929f21 100644 --- a/data/cwise_j002029.72-153527.5.json +++ b/data/cwise_j002029.72-153527.5.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J002029.72-153527.5" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(M9)", + "spectral_type_code": 69.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j002101.45-334631.5.json b/data/cwise_j002101.45-334631.5.json index 130530cda..530a8e18f 100644 --- a/data/cwise_j002101.45-334631.5.json +++ b/data/cwise_j002101.45-334631.5.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J002101.45-334631.5" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T1)", + "spectral_type_code": 81.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j002159.02-451434.4.json b/data/cwise_j002159.02-451434.4.json index f2daec136..90f1e96a0 100644 --- a/data/cwise_j002159.02-451434.4.json +++ b/data/cwise_j002159.02-451434.4.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J002159.02-451434.4" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T3)", + "spectral_type_code": 83.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j002414.30-403053.7.json b/data/cwise_j002414.30-403053.7.json index 2c80b2394..ebad95fd5 100644 --- a/data/cwise_j002414.30-403053.7.json +++ b/data/cwise_j002414.30-403053.7.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J002414.30-403053.7" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L5)", + "spectral_type_code": 75.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j002658.73-260859.6.json b/data/cwise_j002658.73-260859.6.json index e955e40c9..4884c1c14 100644 --- a/data/cwise_j002658.73-260859.6.json +++ b/data/cwise_j002658.73-260859.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J002658.73-260859.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L5)", + "spectral_type_code": 75.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j004218.67+291730.6.json b/data/cwise_j004218.67+291730.6.json index 3de7e3c0b..f5a68a4a9 100644 --- a/data/cwise_j004218.67+291730.6.json +++ b/data/cwise_j004218.67+291730.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J004218.67+291730.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L5)", + "spectral_type_code": 75.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j004945.38+423619.3.json b/data/cwise_j004945.38+423619.3.json index 857156570..9381ba92b 100644 --- a/data/cwise_j004945.38+423619.3.json +++ b/data/cwise_j004945.38+423619.3.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J004945.38+423619.3" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L6)", + "spectral_type_code": 76.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j005635.48-240401.9.json b/data/cwise_j005635.48-240401.9.json index c48c8e4f9..efa57b692 100644 --- a/data/cwise_j005635.48-240401.9.json +++ b/data/cwise_j005635.48-240401.9.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J005635.48-240401.9" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L8)", + "spectral_type_code": 78.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j010424.50+133949.8.json b/data/cwise_j010424.50+133949.8.json index 801ee5170..8bce498df 100644 --- a/data/cwise_j010424.50+133949.8.json +++ b/data/cwise_j010424.50+133949.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J010424.50+133949.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L8)", + "spectral_type_code": 78.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j011003.61-592650.8.json b/data/cwise_j011003.61-592650.8.json index e9b9ef794..d4906ecca 100644 --- a/data/cwise_j011003.61-592650.8.json +++ b/data/cwise_j011003.61-592650.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J011003.61-592650.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L2)", + "spectral_type_code": 72.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j012715.52-300246.9.json b/data/cwise_j012715.52-300246.9.json index 12cfbad71..02c0bb771 100644 --- a/data/cwise_j012715.52-300246.9.json +++ b/data/cwise_j012715.52-300246.9.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J012715.52-300246.9" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T0)", + "spectral_type_code": 80.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j013719.04+342837.6.json b/data/cwise_j013719.04+342837.6.json index a09eb9b9c..379078990 100644 --- a/data/cwise_j013719.04+342837.6.json +++ b/data/cwise_j013719.04+342837.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J013719.04+342837.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L6)", + "spectral_type_code": 76.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j015905.58+105551.5.json b/data/cwise_j015905.58+105551.5.json index 30b052924..8b8bb5b41 100644 --- a/data/cwise_j015905.58+105551.5.json +++ b/data/cwise_j015905.58+105551.5.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J015905.58+105551.5" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(M9)", + "spectral_type_code": 69.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j020538.20+594452.2.json b/data/cwise_j020538.20+594452.2.json index c653a2423..85fd26e76 100644 --- a/data/cwise_j020538.20+594452.2.json +++ b/data/cwise_j020538.20+594452.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J020538.20+594452.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "M8 beta", + "spectral_type_code": 68.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j022454.80+152629.5.json b/data/cwise_j022454.80+152629.5.json index 1a9fca912..e16f0dbd7 100644 --- a/data/cwise_j022454.80+152629.5.json +++ b/data/cwise_j022454.80+152629.5.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J022454.80+152629.5" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L6 beta", + "spectral_type_code": 76.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j022737.75+083008.8.json b/data/cwise_j022737.75+083008.8.json index 863c09f6d..c114c58c4 100644 --- a/data/cwise_j022737.75+083008.8.json +++ b/data/cwise_j022737.75+083008.8.json @@ -60,5 +60,17 @@ "comments": null, "reference": "Lawr12" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L5 blue", + "spectral_type_code": 75.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j025645.16-335008.9.json b/data/cwise_j025645.16-335008.9.json index f0261db06..843979c08 100644 --- a/data/cwise_j025645.16-335008.9.json +++ b/data/cwise_j025645.16-335008.9.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J025645.16-335008.9" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L2)", + "spectral_type_code": 72.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j030005.73-062218.6.json b/data/cwise_j030005.73-062218.6.json index 685a2ca83..7028c5af3 100644 --- a/data/cwise_j030005.73-062218.6.json +++ b/data/cwise_j030005.73-062218.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J030005.73-062218.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L9)", + "spectral_type_code": 79.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j032853.32-112332.6.json b/data/cwise_j032853.32-112332.6.json index 41db3dc03..9de03c7d4 100644 --- a/data/cwise_j032853.32-112332.6.json +++ b/data/cwise_j032853.32-112332.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J032853.32-112332.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L2)", + "spectral_type_code": 72.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j055515.83+510514.0.json b/data/cwise_j055515.83+510514.0.json index df388498e..cecec661f 100644 --- a/data/cwise_j055515.83+510514.0.json +++ b/data/cwise_j055515.83+510514.0.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J055515.83+510514.0" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "M7", + "spectral_type_code": 67.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j055909.00-384219.8.json b/data/cwise_j055909.00-384219.8.json index 27037ec53..26dab5e4b 100644 --- a/data/cwise_j055909.00-384219.8.json +++ b/data/cwise_j055909.00-384219.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J055909.00-384219.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L4)", + "spectral_type_code": 74.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j060202.17-462447.8.json b/data/cwise_j060202.17-462447.8.json index d8108901c..9f5a89519 100644 --- a/data/cwise_j060202.17-462447.8.json +++ b/data/cwise_j060202.17-462447.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J060202.17-462447.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L8)", + "spectral_type_code": 78.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j062000.01+344641.3.json b/data/cwise_j062000.01+344641.3.json index ec485010d..587b2bb27 100644 --- a/data/cwise_j062000.01+344641.3.json +++ b/data/cwise_j062000.01+344641.3.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J062000.01+344641.3" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L4", + "spectral_type_code": 74.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j062648.96+594129.2.json b/data/cwise_j062648.96+594129.2.json index d6d971a68..b6aedd3ab 100644 --- a/data/cwise_j062648.96+594129.2.json +++ b/data/cwise_j062648.96+594129.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J062648.96+594129.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L3 blue", + "spectral_type_code": 73.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j062727.34-002826.8.json b/data/cwise_j062727.34-002826.8.json index 3588662b2..d085228b4 100644 --- a/data/cwise_j062727.34-002826.8.json +++ b/data/cwise_j062727.34-002826.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J062727.34-002826.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "T0 blue", + "spectral_type_code": 80.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j062909.21+395701.6.json b/data/cwise_j062909.21+395701.6.json index 498af5976..ee73d63ad 100644 --- a/data/cwise_j062909.21+395701.6.json +++ b/data/cwise_j062909.21+395701.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J062909.21+395701.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L5)", + "spectral_type_code": 75.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j065752.45+163350.2.json b/data/cwise_j065752.45+163350.2.json index e71656093..c2f62621a 100644 --- a/data/cwise_j065752.45+163350.2.json +++ b/data/cwise_j065752.45+163350.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J065752.45+163350.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L6 beta", + "spectral_type_code": 76.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j073831.31+525453.7.json b/data/cwise_j073831.31+525453.7.json index f27e65755..b9e1272a5 100644 --- a/data/cwise_j073831.31+525453.7.json +++ b/data/cwise_j073831.31+525453.7.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J073831.31+525453.7" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L4 red", + "spectral_type_code": 74.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j080912.95+741704.3.json b/data/cwise_j080912.95+741704.3.json index 50c789409..b4266908e 100644 --- a/data/cwise_j080912.95+741704.3.json +++ b/data/cwise_j080912.95+741704.3.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J080912.95+741704.3" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L6)", + "spectral_type_code": 76.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j085131.24-603056.2.json b/data/cwise_j085131.24-603056.2.json index 60025a2da..90223b758 100644 --- a/data/cwise_j085131.24-603056.2.json +++ b/data/cwise_j085131.24-603056.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J085131.24-603056.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L3)", + "spectral_type_code": 73.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j091558.53+254713.0.json b/data/cwise_j091558.53+254713.0.json index 4109a8c7a..38a0a9c4c 100644 --- a/data/cwise_j091558.53+254713.0.json +++ b/data/cwise_j091558.53+254713.0.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J091558.53+254713.0" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T5)", + "spectral_type_code": 85.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j091902.55-574837.3.json b/data/cwise_j091902.55-574837.3.json index 6b2912691..0b3a874a3 100644 --- a/data/cwise_j091902.55-574837.3.json +++ b/data/cwise_j091902.55-574837.3.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J091902.55-574837.3" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T2)", + "spectral_type_code": 82.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j094352.22+335639.1.json b/data/cwise_j094352.22+335639.1.json index 4616b7ca6..7c171814e 100644 --- a/data/cwise_j094352.22+335639.1.json +++ b/data/cwise_j094352.22+335639.1.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J094352.22+335639.1" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L2 red", + "spectral_type_code": 72.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j095259.54-505418.9.json b/data/cwise_j095259.54-505418.9.json index b9bb92901..d5b098616 100644 --- a/data/cwise_j095259.54-505418.9.json +++ b/data/cwise_j095259.54-505418.9.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J095259.54-505418.9" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T2)", + "spectral_type_code": 82.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j101017.43-242300.4.json b/data/cwise_j101017.43-242300.4.json index d59e2597d..9f1153dde 100644 --- a/data/cwise_j101017.43-242300.4.json +++ b/data/cwise_j101017.43-242300.4.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J101017.43-242300.4" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T6)", + "spectral_type_code": 86.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j101317.51-010313.6.json b/data/cwise_j101317.51-010313.6.json index 9cbed6b15..52056702c 100644 --- a/data/cwise_j101317.51-010313.6.json +++ b/data/cwise_j101317.51-010313.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J101317.51-010313.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(M7)", + "spectral_type_code": 67.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j101523.92-111539.6.json b/data/cwise_j101523.92-111539.6.json index ca1fb8ae1..9c2927597 100644 --- a/data/cwise_j101523.92-111539.6.json +++ b/data/cwise_j101523.92-111539.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J101523.92-111539.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L5 beta", + "spectral_type_code": 75.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j103734.29-050749.8.json b/data/cwise_j103734.29-050749.8.json index cdb162fbe..b03d8b932 100644 --- a/data/cwise_j103734.29-050749.8.json +++ b/data/cwise_j103734.29-050749.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J103734.29-050749.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L3)", + "spectral_type_code": 73.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j104053.42-355029.7.json b/data/cwise_j104053.42-355029.7.json index 8891640db..63c325a7c 100644 --- a/data/cwise_j104053.42-355029.7.json +++ b/data/cwise_j104053.42-355029.7.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J104053.42-355029.7" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "T7", + "spectral_type_code": 87.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j115229.05-351105.9.json b/data/cwise_j115229.05-351105.9.json index 9b2ec85b5..20fec2760 100644 --- a/data/cwise_j115229.05-351105.9.json +++ b/data/cwise_j115229.05-351105.9.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J115229.05-351105.9" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T0)", + "spectral_type_code": 80.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j124033.48+460544.7.json b/data/cwise_j124033.48+460544.7.json index 3838f23b4..65d999c5d 100644 --- a/data/cwise_j124033.48+460544.7.json +++ b/data/cwise_j124033.48+460544.7.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J124033.48+460544.7" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(M9)", + "spectral_type_code": 69.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j125858.20+001133.2.json b/data/cwise_j125858.20+001133.2.json index 2aa99ad16..c6f928ad2 100644 --- a/data/cwise_j125858.20+001133.2.json +++ b/data/cwise_j125858.20+001133.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J125858.20+001133.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(M7)", + "spectral_type_code": 67.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j130329.90+512754.0.json b/data/cwise_j130329.90+512754.0.json index 21027628d..6590b37ef 100644 --- a/data/cwise_j130329.90+512754.0.json +++ b/data/cwise_j130329.90+512754.0.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J130329.90+512754.0" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L2 red", + "spectral_type_code": 72.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j130446.64-120023.6.json b/data/cwise_j130446.64-120023.6.json index f133da069..eaa21dca5 100644 --- a/data/cwise_j130446.64-120023.6.json +++ b/data/cwise_j130446.64-120023.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J130446.64-120023.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "M7", + "spectral_type_code": 67.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j131355.15+223005.6.json b/data/cwise_j131355.15+223005.6.json index a86894775..3d224a163 100644 --- a/data/cwise_j131355.15+223005.6.json +++ b/data/cwise_j131355.15+223005.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J131355.15+223005.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L3", + "spectral_type_code": 73.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j132539.70+022309.4.json b/data/cwise_j132539.70+022309.4.json index 713b05053..68f736610 100644 --- a/data/cwise_j132539.70+022309.4.json +++ b/data/cwise_j132539.70+022309.4.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J132539.70+022309.4" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(M9)", + "spectral_type_code": 69.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j132857.58-063747.4.json b/data/cwise_j132857.58-063747.4.json index 8838331c5..34cd8488f 100644 --- a/data/cwise_j132857.58-063747.4.json +++ b/data/cwise_j132857.58-063747.4.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J132857.58-063747.4" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L3 blue", + "spectral_type_code": 73.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j133211.93-374837.9.json b/data/cwise_j133211.93-374837.9.json index 605287722..ffb3c98b6 100644 --- a/data/cwise_j133211.93-374837.9.json +++ b/data/cwise_j133211.93-374837.9.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J133211.93-374837.9" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L5)", + "spectral_type_code": 75.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j133427.70-273053.1.json b/data/cwise_j133427.70-273053.1.json index 6377fd1a2..23ec4fe8f 100644 --- a/data/cwise_j133427.70-273053.1.json +++ b/data/cwise_j133427.70-273053.1.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J133427.70-273053.1" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L0", + "spectral_type_code": 70.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j141737.21+041847.2.json b/data/cwise_j141737.21+041847.2.json index bdc58c9e3..f38d8b4dc 100644 --- a/data/cwise_j141737.21+041847.2.json +++ b/data/cwise_j141737.21+041847.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J141737.21+041847.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "M8 beta", + "spectral_type_code": 68.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j143935.94-804851.5.json b/data/cwise_j143935.94-804851.5.json index 93cf82d05..8ac299d96 100644 --- a/data/cwise_j143935.94-804851.5.json +++ b/data/cwise_j143935.94-804851.5.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J143935.94-804851.5" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L2)", + "spectral_type_code": 72.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j143951.51+260000.3.json b/data/cwise_j143951.51+260000.3.json index 44bb7d7be..89303c183 100644 --- a/data/cwise_j143951.51+260000.3.json +++ b/data/cwise_j143951.51+260000.3.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J143951.51+260000.3" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "T3", + "spectral_type_code": 83.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j144057.87+380432.8.json b/data/cwise_j144057.87+380432.8.json index b8128b4dd..a3fa689ba 100644 --- a/data/cwise_j144057.87+380432.8.json +++ b/data/cwise_j144057.87+380432.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J144057.87+380432.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L4)", + "spectral_type_code": 74.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j151939.68-485820.4.json b/data/cwise_j151939.68-485820.4.json index 1536af124..4bd7d28c2 100644 --- a/data/cwise_j151939.68-485820.4.json +++ b/data/cwise_j151939.68-485820.4.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J151939.68-485820.4" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L6)", + "spectral_type_code": 76.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j152742.44-121528.2.json b/data/cwise_j152742.44-121528.2.json index 1c5e5e016..76bd68fae 100644 --- a/data/cwise_j152742.44-121528.2.json +++ b/data/cwise_j152742.44-121528.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J152742.44-121528.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "M9", + "spectral_type_code": 69.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j153910.07+722757.2.json b/data/cwise_j153910.07+722757.2.json index 93ff3055a..db8c935af 100644 --- a/data/cwise_j153910.07+722757.2.json +++ b/data/cwise_j153910.07+722757.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J153910.07+722757.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(M8)", + "spectral_type_code": 68.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j160654.19-103214.7.json b/data/cwise_j160654.19-103214.7.json index cd8036bb7..daed22c42 100644 --- a/data/cwise_j160654.19-103214.7.json +++ b/data/cwise_j160654.19-103214.7.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J160654.19-103214.7" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L7 blue", + "spectral_type_code": 77.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j162511.27+774946.8.json b/data/cwise_j162511.27+774946.8.json index 1764e2e7a..dea50e2c3 100644 --- a/data/cwise_j162511.27+774946.8.json +++ b/data/cwise_j162511.27+774946.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J162511.27+774946.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L2", + "spectral_type_code": 72.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j165143.63+695259.4.json b/data/cwise_j165143.63+695259.4.json index 591c3064d..91b453359 100644 --- a/data/cwise_j165143.63+695259.4.json +++ b/data/cwise_j165143.63+695259.4.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J165143.63+695259.4" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T1)", + "spectral_type_code": 81.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j165325.10+490439.7.json b/data/cwise_j165325.10+490439.7.json index 383d0810e..069c6e00b 100644 --- a/data/cwise_j165325.10+490439.7.json +++ b/data/cwise_j165325.10+490439.7.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J165325.10+490439.7" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L5)", + "spectral_type_code": 75.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j171308.00+644220.8.json b/data/cwise_j171308.00+644220.8.json index 9817b4580..a79a2b23c 100644 --- a/data/cwise_j171308.00+644220.8.json +++ b/data/cwise_j171308.00+644220.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J171308.00+644220.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L0)", + "spectral_type_code": 70.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j171700.57+724437.3.json b/data/cwise_j171700.57+724437.3.json index fe46adb1a..516532c41 100644 --- a/data/cwise_j171700.57+724437.3.json +++ b/data/cwise_j171700.57+724437.3.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J171700.57+724437.3" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "M9", + "spectral_type_code": 69.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j173859.73+200501.2.json b/data/cwise_j173859.73+200501.2.json index 3a96409a6..d54989300 100644 --- a/data/cwise_j173859.73+200501.2.json +++ b/data/cwise_j173859.73+200501.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J173859.73+200501.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "M6", + "spectral_type_code": 66.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j174426.85+230355.1.json b/data/cwise_j174426.85+230355.1.json index 55c1ab0f4..59ffbdb68 100644 --- a/data/cwise_j174426.85+230355.1.json +++ b/data/cwise_j174426.85+230355.1.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J174426.85+230355.1" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "M8", + "spectral_type_code": 68.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j174509.03+380733.2.json b/data/cwise_j174509.03+380733.2.json index 518468bf6..50d10123c 100644 --- a/data/cwise_j174509.03+380733.2.json +++ b/data/cwise_j174509.03+380733.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J174509.03+380733.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L4 beta", + "spectral_type_code": 74.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j190909.62+553027.1.json b/data/cwise_j190909.62+553027.1.json index 50d0ac073..8b71fb455 100644 --- a/data/cwise_j190909.62+553027.1.json +++ b/data/cwise_j190909.62+553027.1.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J190909.62+553027.1" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L6)", + "spectral_type_code": 76.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j192425.03-532837.1.json b/data/cwise_j192425.03-532837.1.json index 2759e1541..b14fd58b5 100644 --- a/data/cwise_j192425.03-532837.1.json +++ b/data/cwise_j192425.03-532837.1.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J192425.03-532837.1" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(M8)", + "spectral_type_code": 68.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j195956.16-644318.1.json b/data/cwise_j195956.16-644318.1.json index 3f88d6a83..b543ab282 100644 --- a/data/cwise_j195956.16-644318.1.json +++ b/data/cwise_j195956.16-644318.1.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J195956.16-644318.1" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "T5", + "spectral_type_code": 85.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j200304.70-142228.9.json b/data/cwise_j200304.70-142228.9.json index ba9355604..be04176f4 100644 --- a/data/cwise_j200304.70-142228.9.json +++ b/data/cwise_j200304.70-142228.9.json @@ -48,5 +48,17 @@ "comments": "WFCAM filter is a guess. Check reference for actual filter and telescope used. ", "reference": "Alle16.PhDT" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L0 beta", + "spectral_type_code": 70.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j200813.66-124502.4.json b/data/cwise_j200813.66-124502.4.json index 36adb088e..b019f9af0 100644 --- a/data/cwise_j200813.66-124502.4.json +++ b/data/cwise_j200813.66-124502.4.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J200813.66-124502.4" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L7)", + "spectral_type_code": 77.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j202934.80-791013.1.json b/data/cwise_j202934.80-791013.1.json index 0ac35b85c..1add12cb3 100644 --- a/data/cwise_j202934.80-791013.1.json +++ b/data/cwise_j202934.80-791013.1.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J202934.80-791013.1" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L1 blue", + "spectral_type_code": 71.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j205247.07+053855.7.json b/data/cwise_j205247.07+053855.7.json index d7e983671..ce5390a79 100644 --- a/data/cwise_j205247.07+053855.7.json +++ b/data/cwise_j205247.07+053855.7.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J205247.07+053855.7" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L7)", + "spectral_type_code": 77.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j210640.16+250729.0.json b/data/cwise_j210640.16+250729.0.json index e31f6592e..d5dfe64ec 100644 --- a/data/cwise_j210640.16+250729.0.json +++ b/data/cwise_j210640.16+250729.0.json @@ -30,5 +30,17 @@ { "other_name": "CWISE J210640.16+250729.0" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T2)", + "spectral_type_code": 82.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j212342.88+655615.6.json b/data/cwise_j212342.88+655615.6.json index 992bafd38..e48d12c7a 100644 --- a/data/cwise_j212342.88+655615.6.json +++ b/data/cwise_j212342.88+655615.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J212342.88+655615.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T5)", + "spectral_type_code": 85.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j214129.80-024623.6.json b/data/cwise_j214129.80-024623.6.json index a4f1937d4..056ddce41 100644 --- a/data/cwise_j214129.80-024623.6.json +++ b/data/cwise_j214129.80-024623.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J214129.80-024623.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L4 sl. red", + "spectral_type_code": 74.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j214213.99-204659.8.json b/data/cwise_j214213.99-204659.8.json index f4d3c4a67..f10988798 100644 --- a/data/cwise_j214213.99-204659.8.json +++ b/data/cwise_j214213.99-204659.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J214213.99-204659.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(M8)", + "spectral_type_code": 68.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j221418.15+253432.2.json b/data/cwise_j221418.15+253432.2.json index 9af6909ed..ff96fd29b 100644 --- a/data/cwise_j221418.15+253432.2.json +++ b/data/cwise_j221418.15+253432.2.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J221418.15+253432.2" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L9", + "spectral_type_code": 79.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j224452.18-362946.0.json b/data/cwise_j224452.18-362946.0.json index 00e6cd9eb..77c97fb3c 100644 --- a/data/cwise_j224452.18-362946.0.json +++ b/data/cwise_j224452.18-362946.0.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J224452.18-362946.0" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T1)", + "spectral_type_code": 81.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j225525.22-302320.8.json b/data/cwise_j225525.22-302320.8.json index a6060c28f..be5165209 100644 --- a/data/cwise_j225525.22-302320.8.json +++ b/data/cwise_j225525.22-302320.8.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J225525.22-302320.8" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(T8)", + "spectral_type_code": 88.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j231824.58+052142.3.json b/data/cwise_j231824.58+052142.3.json index 03805bc7e..95659556d 100644 --- a/data/cwise_j231824.58+052142.3.json +++ b/data/cwise_j231824.58+052142.3.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J231824.58+052142.3" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "L4", + "spectral_type_code": 74.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j233531.55+014219.6.json b/data/cwise_j233531.55+014219.6.json index 942d92ab2..ea05ab4ea 100644 --- a/data/cwise_j233531.55+014219.6.json +++ b/data/cwise_j233531.55+014219.6.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J233531.55+014219.6" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "T9", + "spectral_type_code": 89.0, + "spectral_type_error": 0.5, + "regime": "nir", + "adopted": true, + "photometric": false, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwise_j235827.96-521813.4.json b/data/cwise_j235827.96-521813.4.json index 8b973bf6b..e6b2dd6d6 100644 --- a/data/cwise_j235827.96-521813.4.json +++ b/data/cwise_j235827.96-521813.4.json @@ -19,5 +19,17 @@ { "other_name": "CWISE J235827.96-521813.4" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(M9)", + "spectral_type_code": 69.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + } ] } \ No newline at end of file diff --git a/data/cwisep_j040351.00-491605.6.json b/data/cwisep_j040351.00-491605.6.json index 45ba1e157..4cce690f7 100644 --- a/data/cwisep_j040351.00-491605.6.json +++ b/data/cwisep_j040351.00-491605.6.json @@ -41,6 +41,16 @@ } ], "SpectralTypes": [ + { + "spectral_type_string": "(T7)", + "spectral_type_code": 87.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + }, { "spectral_type_string": "T8.5", "spectral_type_code": 88.5, diff --git a/data/cwisep_j085938.95+534908.7.json b/data/cwisep_j085938.95+534908.7.json index 7445c8957..5eb3bb3a8 100644 --- a/data/cwisep_j085938.95+534908.7.json +++ b/data/cwisep_j085938.95+534908.7.json @@ -59,6 +59,16 @@ } ], "SpectralTypes": [ + { + "spectral_type_string": "(T9)", + "spectral_type_code": 89.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + }, { "spectral_type_string": "Y0", "spectral_type_code": 90.0, diff --git a/data/ulas_j103131.49+123736.4.json b/data/ulas_j103131.49+123736.4.json index 02bc4d897..ff7a1baf2 100644 --- a/data/ulas_j103131.49+123736.4.json +++ b/data/ulas_j103131.49+123736.4.json @@ -19,5 +19,17 @@ { "other_name": "ULAS J103131.49+123736.4" } + ], + "SpectralTypes": [ + { + "spectral_type_string": "(L3)", + "spectral_type_code": 73.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Skrz16" + } ] } \ No newline at end of file diff --git a/data/wisea_j040702.42+190945.8.json b/data/wisea_j040702.42+190945.8.json index cbfce5a27..1dbd3ead8 100644 --- a/data/wisea_j040702.42+190945.8.json +++ b/data/wisea_j040702.42+190945.8.json @@ -62,6 +62,16 @@ } ], "SpectralTypes": [ + { + "spectral_type_string": "(T1)", + "spectral_type_code": 81.0, + "spectral_type_error": 2.0, + "regime": "nir", + "adopted": true, + "photometric": true, + "comments": null, + "reference": "Roth24" + }, { "spectral_type_string": "T6.5", "spectral_type_code": 86.5, diff --git a/tests/test_data.py b/tests/test_data.py index 809c672ab..f3deffbd0 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -344,7 +344,7 @@ def test_spectral_types_classes(db, string, code_min, code_max, n_spectra): def test_spectral_types(db): n_spectral_types = db.query(db.SpectralTypes).count() - assert n_spectral_types == 3863, f"found {n_spectral_types} spectral types" + assert n_spectral_types == 3950, f"found {n_spectral_types} spectral types" print(f"found {n_spectral_types} total spectral types") n_photometric_spectral_types = ( @@ -352,7 +352,7 @@ def test_spectral_types(db): ) assert ( - n_photometric_spectral_types == 0 + n_photometric_spectral_types == 54 ), f"found {n_photometric_spectral_types} photometric spectral types" print(f"found {n_photometric_spectral_types} photometric spectral types") @@ -360,7 +360,7 @@ def test_spectral_types(db): db.query(db.SpectralTypes).filter(db.SpectralTypes.c.adopted == 1).count() ) assert ( - n_adopted_spectral_types == 1 + n_adopted_spectral_types == 88 ), f"found {n_adopted_spectral_types} adopted spectral types" print(f"found {n_adopted_spectral_types} adopted spectral types") From 27099d1dab78101d3ac7acafc611248b6cefa49e Mon Sep 17 00:00:00 2001 From: Austin Rothermich Date: Fri, 26 Jul 2024 15:16:26 -0400 Subject: [PATCH 15/17] Deleted notebook --- scripts/ingests/Roth24/Spectral_types.ipynb | 55 --------------------- 1 file changed, 55 deletions(-) delete mode 100644 scripts/ingests/Roth24/Spectral_types.ipynb diff --git a/scripts/ingests/Roth24/Spectral_types.ipynb b/scripts/ingests/Roth24/Spectral_types.ipynb deleted file mode 100644 index eabf22150..000000000 --- a/scripts/ingests/Roth24/Spectral_types.ipynb +++ /dev/null @@ -1,55 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "0c8363db", - "metadata": {}, - "outputs": [ - { - "ename": "ModuleNotFoundError", - "evalue": "No module named 'simple'", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", - "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0msimple\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mutils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mspectral_types\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mingest_spectral_types\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconvert_spt_string_to_code\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'simple'" - ] - } - ], - "source": [ - "from simple.utils.spectral_types import ingest_spectral_types, convert_spt_string_to_code" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "a2c0fa5b", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.9" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} From 9a2839f19771839031dce717e0b96cf6ea4dd6e6 Mon Sep 17 00:00:00 2001 From: Austin Rothermich Date: Fri, 26 Jul 2024 15:18:48 -0400 Subject: [PATCH 16/17] Updated Versions.json --- data/Versions.json | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/data/Versions.json b/data/Versions.json index 8b121d713..ef80e9afe 100644 --- a/data/Versions.json +++ b/data/Versions.json @@ -96,9 +96,14 @@ "description": "Ingest of YJHK MKO photometries from ultracool sheet" }, { - "version": "latest", + "version": "2024.7", "start_date": "2024-07-15", + "end_date": "2024-07-26", + "description": "Version in development" + }, +] { + "version": "latest", + "start_date": "2024-07-26", "end_date": null, "description": "Version in development" - } -] \ No newline at end of file + } \ No newline at end of file From 50507b8d24cbd98ec879ee04d378edcd14e04b6e Mon Sep 17 00:00:00 2001 From: Austin Rothermich Date: Fri, 26 Jul 2024 15:25:02 -0400 Subject: [PATCH 17/17] Fixed error in Versions.json --- data/Versions.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/Versions.json b/data/Versions.json index ef80e9afe..d5a678d06 100644 --- a/data/Versions.json +++ b/data/Versions.json @@ -101,9 +101,10 @@ "end_date": "2024-07-26", "description": "Version in development" }, -] { + { "version": "latest", "start_date": "2024-07-26", "end_date": null, "description": "Version in development" - } \ No newline at end of file + } +] \ No newline at end of file