SIMPLE-AstroDB / SIMPLE-db

Curated collection of data for low mass stars, brown dwarfs, and directly imaged exoplanets.
https://simple-bd-archive.org/
BSD 3-Clause "New" or "Revised" License
11 stars 22 forks source link

Data ingest request from: Nasedkin+ 2024 #519

Open nenasedk opened 4 months ago

nenasedk commented 4 months ago

There are currently no spectra or photometry included for the HR 8799 planets. In my publication from this year (here), I compiled the archival spectra and photometry, together with new GRAVITY spectra for all four of the planets (currently accepted and available as a preprint, waiting on the production office). All of the data is available on zenodo. It would be great to get this data included in the SIMPLE database, and I'd be happy to get the data reformatted if necessary so that it can be included.

kelle commented 4 months ago

Thanks so much for this!

One thing that would be helpful would be to check that the spectra are easily readable into a specutils Spectrum1D object and thus easily plottable by the website. Could you use the spectrum_plottable function to check the spectra? If they are not plottable, then we can chat about how to reformat them.

kelle commented 4 months ago

I don't see a table in the paper with the metadata of the spectra. It would be great if you could compile that information into a table using this template

nenasedk commented 4 months ago

Hi @kelle , thanks for getting to this so quickly! It seems none of my data are formatted correctly out of the box. I think a lot of it should be fairly straightforward to get it into the specutils.Spectrum1D format (once I figure that out!). However, for several of my datasets it might not be so straightforward - we measured covariance matrices for several of the observations, and it's not obvious to me that the Spectrum1D format can handle a full covariance matrix rather than just 1D uncertainties. So a few questions:

  1. Is there an easy tool to convert a text file with wavelenght, flux and uncertainties into a spectrum1D?
  2. Is there a way to include the covariance matrices?

The metadata is included in table A.3 in the paper - is this what you were looking for? If there's not an easy way to ingest that table then I'll just fill out the google sheet.

kelle commented 4 months ago
  1. There is no comprehensive tool to do the conversion because every file is different. But there are many ways to read in text files into Python objects. Astropy table is one option: https://docs.astropy.org/en/stable/io/ascii/index.html
  2. I am not sure about covariance matrix question. I'll post this question in astropy Slack.
kelle commented 4 months ago

I didn't see Table A.3, but yes, that table contains most of the info we need but it would still be most useful if you could fill out the Google sheet.

kelle commented 4 months ago

ok, so, turns out there is not currently functionality for covariance matrices, but it is a good idea! I've opened two issues:

Please consider uploading your spectra with covariance matrices (in whatever form you have them) to these issues.

dhomeier commented 4 months ago
  • Is there an easy tool to convert a text file with wavelenght, flux and uncertainties into a spectrum1D?

Spectrum1D has a builtin loader for ascii files that should handle basic columnar input https://github.com/astropy/specutils/blob/d16d91a077417a7aacdee06d2b259fa887908b14/specutils/io/default_loaders/ascii.py#L26-L42 (sorry, the default loaders are apparently nowhere linked even in the API docs). Not sure if it will support (1D) uncertainties out of the box, but it should provided you identify the respective column, e.g. by setting

column_mapping = {'FLUX': ('flux', 'Jy'), 'STDDEV': ('uncertainty', 'mJy')}

but currently this will only accept StdDevUncertainty, i.e. a unit matching the flux unit.

dhomeier commented 4 months ago

@nenasedk the FITS spectra in your observations cannot even be read with Astropy since their headers are using unit strings not permitted but the FITS standard. Changing the header accordingly, e.g. TUNIT3 = 'W^2/m^4/um^2', they are read in as Table and can also be read automatically with specutils (using the tabular-fits format), but this will interpret the ERROR column as uncertainty because, as noted above, the loader currently does not permit conversion of a VarianceUncertainty. Spectrum1D itself would accept variance or inverse variance, but not an uncertainty of different shape than the flux column.