SIMPLE-AstroDB / SIMPLE-db

BSD 3-Clause "New" or "Revised" License
11 stars 22 forks source link

Checking Ingested Spectra #225

Closed Will-Cooper closed 2 years ago

Will-Cooper commented 2 years ago

We need someway to check when ingesting spectra, that the spectrum will be able to be loading when being parsed downstream. For example 2MASS J00325584-4405058 has wavelength units in pixels, which can't really be plotted (alongside anything else at least) on the website. Perhaps in the ingest_utils code when looping through the objects, try to load the object into astrodbkit, then check the unit is some measure of distance unit.

Will-Cooper commented 2 years ago

Similarly, checking the flux unit is a correct measure (e.g. can be converted correctly like erg/ cm^2/ A/ s)

dr-rodriguez commented 2 years ago

I have a fix for the flux units in place, but looking at that object I don't see pixel wavelengths:

data = db.inventory('2MASS J00325584-4405058')
for x in data['Spectra']:
    print(x['instrument'], x['wavelength_units'], x['flux_units'], x['spectrum'])

SpeX um ergs-1cm-2A-1 https://s3.amazonaws.com/bdnyc/SpeX/Prism/spex_prism_0032-4405_U20026.fits
ISAAC None None https://bdnyc.s3.amazonaws.com/ISAAC/2M0032_ISAACspec_JHK_nocosmics.fits
R-C Spec A ergs-1cm-2A-1 https://s3.amazonaws.com/bdnyc/optical_spectra/U20026.fits
LRIS A ergs-1cm-2A-1 https://s3.amazonaws.com/bdnyc/optical_spectra/U20026_0032-4405.fits

The ISSAC spectrum can't be read by specutils at all due to the format so that is the main issue.