From b8b81dc0470db330a2ba4a9ec29625bb7d4d28d7 Mon Sep 17 00:00:00 2001 From: LishaRamon <149431682+LishaRamon@users.noreply.github.com> Date: Fri, 29 Dec 2023 17:41:01 -0500 Subject: [PATCH] Update Bard14 Spectra (#439) * Update to some Bard14 spectra --------- Co-authored-by: Kelle Cruz --- data/2mass_j04285096-2253227.json | 8 +-- data/2mass_j04510093-3402150.json | 8 +-- data/2mass_j05002100+0330501.json | 16 ++--- data/2mass_j06411840-4322329.json | 8 +-- data/2mass_j06521977-2534505.json | 12 ++-- data/2mass_j07511645-2530432.json | 4 +- data/2mass_j12560183-1257276.json | 8 +-- data/2mass_j13204427+0409045.json | 8 +-- data/2mass_j13595510-4034582.json | 12 ++-- data/2mass_j14402293+1339230.json | 8 +-- data/2mass_j14563831-2809473.json | 16 ++--- data/2massi_j0953212-101420.json | 8 +-- data/Versions.json | 8 ++- data/lhs_2021.json | 8 +-- data/lp__938-71.json | 8 +-- data/sips_j0058-0651.json | 4 +- data/tvlm_831-161058.json | 8 +-- data/tvlm_868-110639.json | 8 +-- scripts/ingests/ingest_bard14_spectra.py | 87 ++++++++++++++++++++++++ 19 files changed, 170 insertions(+), 77 deletions(-) create mode 100644 scripts/ingests/ingest_bard14_spectra.py diff --git a/data/2mass_j04285096-2253227.json b/data/2mass_j04285096-2253227.json index 705c6eea9..32bbe548f 100644 --- a/data/2mass_j04285096-2253227.json +++ b/data/2mass_j04285096-2253227.json @@ -262,8 +262,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/0428-2253.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J04285096-2253227_2012-09-25.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0428-2253.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/0428-2253.txt", "regime": "nir", "telescope": "IRTF", @@ -275,8 +275,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/u10286.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J04285096-2253227_2012-09-25.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0428-2253.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/u10286.fits", "regime": "optical", "telescope": "KPNO 4m", diff --git a/data/2mass_j04510093-3402150.json b/data/2mass_j04510093-3402150.json index 55c0341f7..86ac0d413 100644 --- a/data/2mass_j04510093-3402150.json +++ b/data/2mass_j04510093-3402150.json @@ -301,8 +301,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/0451-3402.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J04510093-3402150_2012-09-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0451-3402.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/0451-3402.txt", "regime": "nir", "telescope": "IRTF", @@ -314,8 +314,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/U10334.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J04510093-3402150_2012-09-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0451-3402.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/U10334.fits", "regime": "optical", "telescope": "CTIO 4m", diff --git a/data/2mass_j05002100+0330501.json b/data/2mass_j05002100+0330501.json index 92b24dde6..940caf095 100644 --- a/data/2mass_j05002100+0330501.json +++ b/data/2mass_j05002100+0330501.json @@ -232,8 +232,8 @@ ], "Spectra": [ { - "spectrum": "https://bdnyc.s3.amazonaws.com/xshooter/2M0500_total.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J05002100%2b0330501_2012-12-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0500%2B0330.txt", "local_spectrum": null, "regime": "em.IR.NIR", "telescope": "ESO VLT", @@ -245,8 +245,8 @@ "other_references": null }, { - "spectrum": "https://bdnyc.s3.amazonaws.com/xshooter/2M0500_total.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J05002100%2b0330501_2012-12-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0500%2B0330.txt", "local_spectrum": null, "regime": "em.opt", "telescope": "ESO VLT", @@ -258,8 +258,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/0500%2B0330.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J05002100%2b0330501_2012-12-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0500%2B0330.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/0500+0330.txt", "regime": "nir", "telescope": "IRTF", @@ -271,8 +271,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/u20197.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J05002100%2b0330501_2012-12-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0500%2B0330.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/u20197.fits", "regime": "optical", "telescope": "KPNO 4m", diff --git a/data/2mass_j06411840-4322329.json b/data/2mass_j06411840-4322329.json index 90fbfdbe6..458dbb39a 100644 --- a/data/2mass_j06411840-4322329.json +++ b/data/2mass_j06411840-4322329.json @@ -220,8 +220,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/0641-4322.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J06411840-4322329_2012-12-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0641-4322.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/0641-4322.txt", "regime": "nir", "telescope": "IRTF", @@ -233,8 +233,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/U20252.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J06411840-4322329_2012-12-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0641-4322.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/U20252.fits", "regime": "optical", "telescope": "CTIO 4m", diff --git a/data/2mass_j06521977-2534505.json b/data/2mass_j06521977-2534505.json index 6514979c6..7ca808a1e 100644 --- a/data/2mass_j06521977-2534505.json +++ b/data/2mass_j06521977-2534505.json @@ -274,8 +274,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/SpeX/Prism/U50078_0652-2534_060902.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J06521977-2534505_2009-01-25.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/U50078_JHK_2009jan25.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/U50078_0652-2534_060902.fits", "regime": "nir", "telescope": "IRTF", @@ -287,8 +287,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/U50078_JHK_2009jan25.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J06521977-2534505_2009-01-25.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/U50078_JHK_2009jan25.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/U50078_JHK_2009jan25.txt", "regime": "nir", "telescope": "IRTF", @@ -300,8 +300,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/SpeX/Prism/U50078_0652-2534_091104.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J06521977-2534505_2009-01-25.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/U50078_JHK_2009jan25.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/U50078_0652-2534_091104.fits", "regime": "nir", "telescope": "IRTF", diff --git a/data/2mass_j07511645-2530432.json b/data/2mass_j07511645-2530432.json index 54f136b3f..56e971db8 100644 --- a/data/2mass_j07511645-2530432.json +++ b/data/2mass_j07511645-2530432.json @@ -265,8 +265,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/U50080_JHK_2009nov04.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J07511645-2530432_2009-11-04.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/U50080_JHK_2009nov04.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/U50080_JHK_2009nov04.txt", "regime": "nir", "telescope": "IRTF", diff --git a/data/2mass_j12560183-1257276.json b/data/2mass_j12560183-1257276.json index eed3a0b12..6f15633b6 100644 --- a/data/2mass_j12560183-1257276.json +++ b/data/2mass_j12560183-1257276.json @@ -30,6 +30,9 @@ { "other_name": "VHS 1256-1257b" }, + { + "other_name": "VHS 1256b" + }, { "other_name": "VHS J125601.92-125723.9 b" }, @@ -38,9 +41,6 @@ }, { "other_name": "WISEA J125601.66-125728.7" - }, - { - "other_name": "VHS 1256b" } ], "Parallaxes": [ @@ -267,4 +267,4 @@ "reference": "Gauz15" } ] -} +} \ No newline at end of file diff --git a/data/2mass_j13204427+0409045.json b/data/2mass_j13204427+0409045.json index abeb1fcc3..1be178485 100644 --- a/data/2mass_j13204427+0409045.json +++ b/data/2mass_j13204427+0409045.json @@ -262,8 +262,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/1320%2B0409.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J13204427%2b0409045_2013-04-24.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/1320%2B0409.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/1320+0409.txt", "regime": "nir", "telescope": "IRTF", @@ -275,8 +275,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/optical_spectra/U20475.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J13204427%2b0409045_2013-04-24.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/1320%2B0409.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/U20475.fits", "regime": "optical", "telescope": "CTIO 4m", diff --git a/data/2mass_j13595510-4034582.json b/data/2mass_j13595510-4034582.json index 7b9d216d0..41b2a7ff1 100644 --- a/data/2mass_j13595510-4034582.json +++ b/data/2mass_j13595510-4034582.json @@ -238,8 +238,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/SpeX/Prism/1359-4034_2012-03-30.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J13595510-4034582_2013-04-25.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/1359-4034_2013-04-25.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/1359-4034_2012-03-30.txt", "regime": "nir", "telescope": "IRTF", @@ -251,8 +251,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/1359-4034_2013-04-25.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J13595510-4034582_2013-04-25.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/1359-4034_2013-04-25.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/1359-4034_2013-04-25.txt", "regime": "nir", "telescope": "IRTF", @@ -264,8 +264,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/U20543.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J13595510-4034582_2013-04-25.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/1359-4034_2013-04-25.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/U20543.fits", "regime": "optical", "telescope": "CTIO 4m", diff --git a/data/2mass_j14402293+1339230.json b/data/2mass_j14402293+1339230.json index 5fd461d8f..fd9270050 100644 --- a/data/2mass_j14402293+1339230.json +++ b/data/2mass_j14402293+1339230.json @@ -280,8 +280,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/1440%2B1339.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J14402293%2b1339230_2013-03-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/1440%2B1339.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/1440+1339.txt", "regime": "nir", "telescope": "IRTF", @@ -293,8 +293,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/U11230.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J14402293%2b1339230_2013-03-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/1440%2B1339.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/U11230.fits", "regime": "optical", "telescope": "KPNO 2.1m", diff --git a/data/2mass_j14563831-2809473.json b/data/2mass_j14563831-2809473.json index f7f94c798..5f471abf2 100644 --- a/data/2mass_j14563831-2809473.json +++ b/data/2mass_j14563831-2809473.json @@ -277,8 +277,8 @@ ], "Spectra": [ { - "spectrum": "https://bdnyc.s3.amazonaws.com/IRS/2MASS+J14563831-2809473.fits", - "original_spectrum": "https://bdnyc.s3.amazonaws.com/IRS/1456-2809_IRS_spectrum.dat", + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J14563831-2809473_2008-07-29.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/spex_prism_lhs3003_080729.txt", "local_spectrum": null, "regime": "mir", "telescope": "Spitzer", @@ -290,8 +290,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/LHS3003_SL.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J14563831-2809473_2008-07-29.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/spex_prism_lhs3003_080729.txt", "local_spectrum": "$BDNYC_spectra/IRS/IRS_DimSuns_S12/LHS3003_SL.txt", "regime": "mir", "telescope": "Spitzer", @@ -303,8 +303,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/spex_prism_lhs3003_080729.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J14563831-2809473_2008-07-29.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/spex_prism_lhs3003_080729.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/spex_prism_lhs3003_080729.txt", "regime": "nir", "telescope": "IRTF", @@ -316,8 +316,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/U11264.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASS+J14563831-2809473_2008-07-29.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/spex_prism_lhs3003_080729.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/U11264.fits", "regime": "optical", "telescope": "KPNO 2.1m", diff --git a/data/2massi_j0953212-101420.json b/data/2massi_j0953212-101420.json index 747cc7c8f..585c93b40 100644 --- a/data/2massi_j0953212-101420.json +++ b/data/2massi_j0953212-101420.json @@ -216,8 +216,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/SpeX/Prism/U10857_JHK_2008jan12.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASSI+J0953212-101420_2008-01-12.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/SpeX/Prism/U10857_JHK_2008jan12.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/U10857_JHK_2008jan12.txt", "regime": "nir", "telescope": "IRTF", @@ -229,8 +229,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/optical_spectra/U10857_0953-1014.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/2MASSI+J0953212-101420_2008-01-12.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/SpeX/Prism/U10857_JHK_2008jan12.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/U10857_0953-1014.fits", "regime": "optical", "telescope": "Magellan II Clay", diff --git a/data/Versions.json b/data/Versions.json index 9df07db7e..347dc6fea 100644 --- a/data/Versions.json +++ b/data/Versions.json @@ -54,8 +54,14 @@ "description": "Added two sources" }, { - "version": "latest", + "version": "2023.5", "start_date": "2023-12-12", + "end_date": "2023-12-29", + "description": "Included Roth sources, fixed Bard14 spectra" + }, + { + "version": "latest", + "start_date": "2023-12-29", "end_date": null, "description": "Version in development" } diff --git a/data/lhs_2021.json b/data/lhs_2021.json index 2f09fad07..e1a6778f4 100644 --- a/data/lhs_2021.json +++ b/data/lhs_2021.json @@ -325,8 +325,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/0830%2B0947.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/LHS+2021_2012-12-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0830%2B0947.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/0830+0947.txt", "regime": "nir", "telescope": "IRTF", @@ -338,8 +338,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/u20302.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/LHS+2021_2012-12-27.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0830%2B0947.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/u20302.fits", "regime": "optical", "telescope": "KPNO 4m", diff --git a/data/lp__938-71.json b/data/lp__938-71.json index e09c0db65..ff06d5d1b 100644 --- a/data/lp__938-71.json +++ b/data/lp__938-71.json @@ -265,8 +265,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/LHS132.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/LP++938-71_2008-09-07.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/LHS132.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/LHS132.txt", "regime": "nir", "telescope": "IRTF", @@ -278,8 +278,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/u20049.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/LP++938-71_2008-09-07.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/LHS132.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/u20049.fits", "regime": "optical", "telescope": "CTIO 1.5m", diff --git a/data/sips_j0058-0651.json b/data/sips_j0058-0651.json index 4a32cd434..10467b447 100644 --- a/data/sips_j0058-0651.json +++ b/data/sips_j0058-0651.json @@ -214,8 +214,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/0058-0651.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/SIPS+J0058-0651_2008-07-14.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0058-0651.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/0058-0651.txt", "regime": "nir", "telescope": "IRTF", diff --git a/data/tvlm_831-161058.json b/data/tvlm_831-161058.json index 81d8726b5..61e443cf7 100644 --- a/data/tvlm_831-161058.json +++ b/data/tvlm_831-161058.json @@ -271,8 +271,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/0251%2B0047.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/TVLM+831-161058_2013-09-03.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0251%2B0047.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/0251+0047.txt", "regime": "nir", "telescope": "IRTF", @@ -284,8 +284,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/u20130.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/TVLM+831-161058_2013-09-03.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/0251%2B0047.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/u20130.fits", "regime": "optical", "telescope": "KPNO 4m", diff --git a/data/tvlm_868-110639.json b/data/tvlm_868-110639.json index b4b724ca9..554df3a8d 100644 --- a/data/tvlm_868-110639.json +++ b/data/tvlm_868-110639.json @@ -301,8 +301,8 @@ ], "Spectra": [ { - "spectrum": "https://s3.amazonaws.com/bdnyc/1510-0241.txt", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/TVLM+868-110639_2009-06-29.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/1510-0241.txt", "local_spectrum": "$BDNYC_spectra/SpeX/Prism/1510-0241.txt", "regime": "nir", "telescope": "IRTF", @@ -314,8 +314,8 @@ "other_references": null }, { - "spectrum": "https://s3.amazonaws.com/bdnyc/U20602.fits", - "original_spectrum": null, + "spectrum": "https://bdnyc.s3.amazonaws.com/SpeX/Prism/TVLM+868-110639_2009-06-29.fits", + "original_spectrum": "https://s3.amazonaws.com/bdnyc/1510-0241.txt", "local_spectrum": "$BDNYC_spectra/optical_spectra/U20602.fits", "regime": "optical", "telescope": "KPNO 2.1m", diff --git a/scripts/ingests/ingest_bard14_spectra.py b/scripts/ingests/ingest_bard14_spectra.py new file mode 100644 index 000000000..90343c369 --- /dev/null +++ b/scripts/ingests/ingest_bard14_spectra.py @@ -0,0 +1,87 @@ +from scripts.ingests.ingest_utils import * +from scripts.ingests.utils import * +from astropy.io import ascii +import requests + + +SAVE_DB = False # True: save the data files(json) in addition to modifying the .db file +RECREATE_DB = True # recreates the .db file from the data files +# LOAD THE DATABASE +db = load_simpledb('SIMPLE.db', recreatedb=RECREATE_DB) + +#bard14 url : https://docs.google.com/spreadsheets/d/11o5NRGA7jSbHKaTNK7SJnu_DTECjsyZ6rY3rcznYsJk/edit#gid=0 + +SHEET_ID = '11o5NRGA7jSbHKaTNK7SJnu_DTECjsyZ6rY3rcznYsJk' +SHEET_NAME = 'bard14' +full = 'all' + +url = f'https://docs.google.com/spreadsheets/d/{SHEET_ID}/gviz/tq?tqx=out:csv&sheet={full}' + +bard14_table = ascii.read( + url, + format="csv", + data_start=1, + header_start=0, + guess=False, + fast_reader=False, + delimiter=",", +) + +#print result table +print(bard14_table.info) + + +#function to update all spectra in the database +def update_all_spectra(db): + + for row in bard14_table: + source_value = row['Source'] + spectrum_value = row['Spectrum'] + original_spectrum_value = row['Original Spectrum'] + + + print(source_value) + print(spectrum_value) + print(original_spectrum_value) + + # Add a separator between rows for better readability + print("-" * 50) + + + # The website is up if the status code is 200 (checking validity of links) + request_response1 = requests.head(spectrum_value) + status_code1 = (request_response1.status_code) + + if status_code1 != 200: + msg = f"Link invalid:{spectrum_value}" + raise SimpleError(msg) + + + request_response2 = requests.head(original_spectrum_value) + status_code2 = (request_response2.status_code) + + if status_code2 != 200: + msg2 = f"Link invalid:{original_spectrum_value}" + raise SimpleError(msg2) + + print(status_code1) + print(status_code2) + + #update data in loop + with db.engine.begin() as conn: + conn.execute(db.Spectra.update() + .where(db.Spectra.c.source == source_value) + .values(spectrum = spectrum_value)) + + conn.execute(db.Spectra.update() + .where(db.Spectra.c.source == source_value) + .values(original_spectrum = original_spectrum_value)) + + +#Call spectra function +update_all_spectra(db) + + +# WRITE THE JSON FILES +if SAVE_DB: + db.save_database(directory="data/") \ No newline at end of file