-
Notifications
You must be signed in to change notification settings - Fork 3
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
specutils excise_regions is not inclusive on the first boundary #378
Comments
Great work. Since the issue is with Could you share the location of the data you're using to reproduce and investigate the issue. We should also submit an issue to Regarding the region_mask = (spectral_axis >= region.lower) & (spectral_axis < region.upper) |
The data is in
|
I'm able to manipulate my local specutils install to be inclusive on both ends of each excision region (It was as simple as replacing a < with a <= in manipulation.utils.true_exciser). I don't know how worth it it is to PR specutils with this, since it seems like a big change to how excision works for everyone else that uses specutils. It also correctly uses the true_exciser, rather than the linear exciser. I am going to test the baseline subtractions again, and see if this is the only thing that needs to change to fix issue 86. |
@etsmit does the From the fix_exclude: bool
If True, fix exclude regions that are out of bounds of the specctral axis to be within the spectral axis. Default:False |
I don't want to change the default behavior in specutils, which is to be consistent with generic python slicing, but astropy/specutils#1171 adds an optional keyword to toggle on inclusive upper bounds in fitting and excision. Is that sufficient to meet your needs here?
Just wanted to say that I appreciate that you all took the step of reaching out rather than just quietly dropping specutils! The benefits of open source development 🙂 |
@rosteen Yes, that would solve our issue. Thanks a lot! |
Great - I just merged that update into |
dysh update in PR 403 |
When developing a numpy baseline routine for issue 86 I realized that the first boundary of a given excise region was skipped.
This is lower sideband data, so channel 0 is the highest frequency (right side). You can see that the plot removes the left side (doesn't plot), skips over the signal in the middle, and removes most of the right side except for channel 0, which is marked by the straight line going up. This obviously doesn't have much significance as far as baseline fitting, but it is an oddity that should be addressed.
Obviously, putting -1 as the left boundary returns an error, but using the frequencies also returns the same behavior. For example, putting the left boundary as 1.40168216 GHz (the furthest left channel) returns an out-of-bounds error, and dropping the frequency doesn't excise that channel.
Along that thought, I would like to request that region boundaries that are out-of-bounds just snap to the edge of the spectrum (with a warning) instead of returning the out-of-bounds error. It feels kind of silly to put a valid frequency value that is the edge of the band and to just have it error out.
Also, these are all in specutils, so it's unclear what we can do from the dysh side.
The text was updated successfully, but these errors were encountered: