spacetelescope / specviz

An interactive astronomical 1D spectra analysis tool.
http://specviz.readthedocs.io
BSD 3-Clause "New" or "Revised" License
43 stars 31 forks source link

Fix ROIs in model generation; fixes #604 and #602 #669

Closed nmearl closed 5 years ago

nmearl commented 5 years ago

FIxes #604 and #602.

brechmos-stsci commented 5 years ago

I think I need a bit of guidance here. I am not sure how to setup in order to get to that bit of code. I loaded a 1D data file, created two regions (hoping to use those to exclude for model fitting), then created a 2nd order polynomial. The fitting works (but it is a bad fit). How do I specify that these two regions I created should be used to exclude?

Or quite possibly I am missing something with what @hcferguson was doing in https://github.com/spacetelescope/specviz/issues/604 and what this fix is for.

This does appear to fix https://github.com/spacetelescope/specviz/issues/602.

nmearl commented 5 years ago

The ROIs represent regions to be included. The code retrieves the current ROI selection (inc_regs), and then inverts them to get the non-ROI selection of the spectrum (exc_regs), and feeds that into the specutils utilities (since they take excluded regions, not included regions). Hope that makes sense!

brechmos-stsci commented 5 years ago

Cool. Seems to work for me, then.