Allow specifying flux column in JWST x1d reader
Closes #1144 . Unfortunately it's not possible to do this across all readers simultaneously, so I implemented it in the JWST reader since that's the one that is causing problems. If this comes up for other missions we can add the keyword to those as well.
lgtm so far, but why isn't this possible more generally? you can just do:
flux = Quantity(data[flux_column])
(and then optionally error = Quantity(data[error_column])) and leave it to the user to specify the column names correctly.
I like the approach here for JWST data and approve of doing this sort of extra hand-holding whenever possible, but on a broader level, the user should be able to override any choices imposed by the registered reader.
but why isn't this possible more generally?
It's not that it isn't possible more generally, it's that we rely on NDIOMixin for the read method, so there's not (I don't think anyway) a central place to add this just once to apply to all the loaders, we would need to add it to each of the loaders individually. I'm happy to take the broader effort to do that, but I figured I'd start with the case that was actually causing problems.
I'm going to go ahead and merge this, we can follow up to extend this to other loaders if desired.
I'm not sure if this is asking too much but can we get a release with this fix please?
I'm not sure if this is asking too much but can we get a release with this fix please?
I'll try to get a release out later this week, since there have been a couple PRs merged. I'm trying to write tests for https://github.com/astropy/specutils/pull/1252 and get it in before I do a release.