catherinezucker / radfil

Building Radial Density Profiles for Interstellar Filaments
GNU General Public License v3.0
14 stars 8 forks source link

Range of radii used in background subtraction #2

Closed hopehhchen closed 7 years ago

hopehhchen commented 7 years ago

The current codes do not allow selection of the radius range by (min, max).

hopehhchen commented 7 years ago

Maybe this could be fixed by merging the current bgdist and bgdistfrom to one parameter that takes a 2-tuple or 2-list representing the minimum and the maximum radii. This would be something similar to the bounds parameter in scipy.optimize.curve_fit or astropy.modeling.models.

When the new input parameter takes a tuple like (5., numpy.inf), it will be equivalent to "using all data points outside 5 [pc]" in the original code.

We can also add sigma clipping in the future. See astropy.modeling examples.

catherinezucker commented 7 years ago

Sounds like a plan! I can implement this one.

hopehhchen commented 7 years ago

Done. Now bgdist takes a list/array/tuple of a shape (2, ). This will be used as the lower and upper bounds for choosing data points in background fitting/subtraction.