specutils icon indicating copy to clipboard operation
specutils copied to clipboard

Allow specifying flux column in JWST x1d reader

Open rosteen opened this issue 6 months ago • 1 comments

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.

rosteen avatar Jun 27 '25 16:06 rosteen

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.

keflavich avatar Jun 27 '25 16:06 keflavich

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.

rosteen avatar Jul 02 '25 15:07 rosteen

I'm going to go ahead and merge this, we can follow up to extend this to other loaders if desired.

rosteen avatar Jul 14 '25 13:07 rosteen

I'm not sure if this is asking too much but can we get a release with this fix please?

kelle avatar Jul 17 '25 18:07 kelle

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.

rosteen avatar Jul 22 '25 13:07 rosteen