Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data ingest request from: Nasedkin+ 2024 #519

Open
nenasedk opened this issue Jun 27, 2024 · 8 comments
Open

Data ingest request from: Nasedkin+ 2024 #519

nenasedk opened this issue Jun 27, 2024 · 8 comments

Comments

@nenasedk
Copy link

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
Copy link
Collaborator

kelle commented Jun 27, 2024

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
Copy link
Collaborator

kelle commented Jun 27, 2024

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
Copy link
Author

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
Copy link
Collaborator

kelle commented Jun 28, 2024

  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
Copy link
Collaborator

kelle commented Jun 28, 2024

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
Copy link
Collaborator

kelle commented Jul 1, 2024

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
Copy link

dhomeier commented Jul 2, 2024

  • 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
Copy link

dhomeier commented Jul 2, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants