astropy / specutils

An Astropy coordinated package for astronomical spectroscopy. Maintainers: @rosteen @keflavich @eteq
http://specutils.readthedocs.io/en/latest/
169 stars 127 forks source link

Create method to extract "minimal bounding" region #746

Open rosteen opened 3 years ago

rosteen commented 3 years ago

spectral-cube has a method to extract the minimal valid sub-cube, see the docs here. If I recall correctly one can currently extract multiple regions from a Spectrum1D object with extract_spectral_region, but that cuts out any data in between the regions. It would be good to have a method to extract the minimum bounding cube (or lower dimensional equivalent) of any provided regions.

eteq commented 3 years ago

I'm confused by this @rosteen - isn't the spectral-cube version of this about the spatial region? I.e., drawing like a circular region in the spatial part of the cube and then extracting the smallest cube that contains that spatial region?

To be fair, this suggestion is still useful, but I'm not sure if it's the same as the spectral-cube method?

rosteen commented 3 years ago

I think the spectral-cube version is agnostic about spectral vs spatial dimensions - it extracts the minimum non-masked cube by trimming in whatever dimensions are needed. I was far more ambiguous than I should have been in my description here, but the intent was to duplicate the spectral-cube functionality. @ibusko created #774 to explicitly lay out the requirement to handle the spatial dimensions.