Skip to content

Commit

Permalink
W1935-15 JWST spectra and photometry ingest, spectra and photometry u…
Browse files Browse the repository at this point in the history
…tils improvements (#458)


* improvements and tests for `ingest_spectrum` and photometry functions

* plotting test to ingest_spectrum

* new function to check if spectra are plottable

* JSON files for JWST source

* reorg of photometry utils. prep to move to astrodb_scripts.
  • Loading branch information
kelle authored Feb 19, 2024
1 parent 797ae10 commit 74ece17
Show file tree
Hide file tree
Showing 21 changed files with 1,408 additions and 781 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest ads
pip install pytest ads matplotlib
pip install astrodbkit2
pip install git+https://github.com/astrodbtoolkit/astrodb_scripts.git@main
Expand Down
7 changes: 7 additions & 0 deletions data/Instruments.json
Original file line number Diff line number Diff line change
Expand Up @@ -446,5 +446,12 @@
"telescope": "LCO",
"description": null,
"reference": null
},
{
"instrument": "NIRSpec",
"mode": "FS",
"telescope": "JWST",
"description": "Fixed Slit",
"reference": null
}
]
18 changes: 18 additions & 0 deletions data/PhotometryFilters.json
Original file line number Diff line number Diff line change
Expand Up @@ -418,5 +418,23 @@
"ucd": "em.IR.NIR",
"effective_wavelength": 9793.5,
"width": 907.02
},
{
"band": "JWST/MIRI.F1000W",
"ucd": "em.IR.8-15um",
"effective_wavelength": 98793.448532805,
"width": 18679.183123014
},
{
"band": "JWST/MIRI.F1280W",
"ucd": "em.IR.8-15um",
"effective_wavelength": 127059.67976377,
"width": 25306.737398933
},
{
"band": "JWST/MIRI.F1800W",
"ucd": "em.IR.15-30um",
"effective_wavelength": 178734.17093674,
"width": 29839.892353346
}
]
6 changes: 6 additions & 0 deletions data/Publications.json
Original file line number Diff line number Diff line change
Expand Up @@ -6940,5 +6940,11 @@
"bibcode": "2022A&A...663A..84L",
"doi": "10.1051/0004-6361/202243516",
"description": "Physical properties and trigonometric distance of the peculiar dwarf WISE J181005.5\u2212101002.3"
},
{
"reference": "Fahe24",
"bibcode": "",
"doi": "",
"description": "Methane Emission From a Cool Brown Dwarf"
}
]
10 changes: 8 additions & 2 deletions data/Versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,15 @@
"description": "Included Roth sources, fixed Bard14 spectra"
},
{
"version": "latest",
"version": "2024.1",
"start_date": "2023-12-29",
"end_date": "2024-02-15",
"description": "Added JWST spectrum for WISE 1935-1546"
},
{
"version": "latest",
"start_date": "2024-02-15",
"end_date": null,
"description": "Version in development"
}
]
]
42 changes: 42 additions & 0 deletions data/cwisep_j193518.58-154620.3.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,48 @@
"epoch": null,
"comments": null,
"reference": "Meis20.74"
},
{
"band": "JWST/MIRI.F1000W",
"magnitude": 13.740,
"magnitude_error": 0.005,
"telescope": "JWST",
"epoch": null,
"comments": null,
"reference": "Fahe24"
},
{
"band": "JWST/MIRI.F1280W",
"magnitude": 13.126,
"magnitude_error": 0.007,
"telescope": "JWST",
"epoch": null,
"comments": null,
"reference": "Fahe24"
},
{
"band": "JWST/MIRI.F1800W",
"magnitude": 12.107,
"magnitude_error": 0.017,
"telescope": "JWST",
"epoch": null,
"comments": null,
"reference": "Fahe24"
}
],
"Spectra": [
{
"spectrum": "https://bdnyc.s3.amazonaws.com/JWST/NIRSpec/jw02124-o051_s00001_nirspec_f290lp-g395h-s200a1-subs200a1_x1d_manual.fits",
"original_spectrum": null,
"local_spectrum": null,
"regime": "nir",
"telescope": "JWST",
"instrument": "NIRSpec",
"mode": "FS",
"observation_date": "2022-10-17T00:00:00",
"comments": "F290LP-G395H",
"reference": "Fahe24",
"other_references": null
}
],
"SpectralTypes": [
Expand Down
1 change: 1 addition & 0 deletions documentation/PhotometryFilters.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Columns marked with an asterisk (*) may not be empty.
| width | width of band | Angstroms (10<sup>-10</sup>m) | |

## Notes
- Useful functions: `ingest_photometry_filter`, `fetch_svo`, `assign_ucd`
- Band names are listed at the [SVO filter profile service](http://svo2.cab.inta-csic.es/svo/theory/fps3/index.php?mode=browse&gname=Spitzer&asttype=).
- UCDs are listed in the [IVOA controlled vocabulary](https://www.ivoa.net/documents/UCD1+/20200212/PEN-UCDlist-1.4-20200212.html#tth_sEcB).
Common ones for cool stars are:
Expand Down
2 changes: 1 addition & 1 deletion scripts/examples/plotting_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import astropy.units as u
from sqlalchemy import func, and_, Integer, cast
from scripts.ingests.utils import load_simpledb, logger
from scripts.ingests.simple_utils import convert_spt_code_to_string_to_code
from scripts.utils.simple_utils import convert_spt_code_to_string_to_code
from astrodbkit2.spectra import load_spectrum

plt.interactive(False)
Expand Down
142 changes: 0 additions & 142 deletions scripts/ingests/add_photometry_filters.py

This file was deleted.

92 changes: 92 additions & 0 deletions scripts/ingests/ingest_jwst_Fahe24.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
from astrodb_scripts import load_astrodb, ingest_instrument, ingest_publication
from schema.schema import *
from scripts.utils.ingest_spectra_utils import ingest_spectrum
from scripts.utils.photometry import ingest_photometry_filter, ingest_photometry
import logging

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

logger = logging.getLogger("AstroDB")
logger.setLevel(logging.INFO)

db = load_astrodb("SIMPLE.sqlite", recreatedb=RECREATE_DB)

file = (
"https://bdnyc.s3.amazonaws.com/JWST/NIRSpec/jw02124-o051_s00001_nirspec_f290lp-"
"g395h-s200a1-subs200a1_x1d_manual.fits"
)

ingest_instrument(
db,
telescope="JWST",
instrument="NIRSpec",
mode="FS",
)

ingest_publication(
db,
publication="Fahe24",
description="Methane Emission From a Cool Brown Dwarf",
ignore_ads=True,
)

ingest_spectrum(
db,
source="CWISEP J193518.58-154620.3",
spectrum=file,
regime="nir",
telescope="JWST",
instrument="NIRSpec",
mode="FS",
obs_date="2022-10-17",
reference="Fahe24",
comments="F290LP-G395H",
)

filter_names = ["F1000W", "F1280W", "F1800W"]
for filter_name in filter_names:
ingest_photometry_filter(
db,
telescope="JWST",
instrument="MIRI",
filter_name=filter_name,
)

# MIRI.F1000W - (13.740374118847015, 0.00509224851727859) &
# MIRI.F1280W - (13.125575556995827, 0.00711303904668107) &
# MIRI.F1800W - (12.108791667404923, 0.01817644357837899)

ingest_photometry(
db,
source="CWISEP J193518.58-154620.3",
band="JWST/MIRI.F1000W",
telescope="JWST",
magnitude=13.740,
magnitude_error=0.005,
reference="Fahe24",
)

ingest_photometry(
db,
source="CWISEP J193518.58-154620.3",
band="JWST/MIRI.F1280W",
telescope="JWST",
magnitude=13.126,
magnitude_error=0.007,
reference="Fahe24",
)

ingest_photometry(
db,
source="CWISEP J193518.58-154620.3",
band="JWST/MIRI.F1800W",
telescope="JWST",
magnitude=12.107,
magnitude_error=0.017,
reference="Fahe24",
)

# WRITE THE JSON FILES
if SAVE_DB:
db.save_database(directory="data/")
File renamed without changes.
Empty file added scripts/utils/__init__.py
Empty file.
Loading

0 comments on commit 74ece17

Please sign in to comment.