Commit 61b86139 authored by Roland Bacon's avatar Roland Bacon

Add option to exclude wavelength range in get_emlines

parent 4240f02f
Pipeline #3762 passed with stages
in 11 minutes and 26 seconds
3.5dev (XX/XX/2020)
-------------------
- Add a parameter in `mpdaf.sdetect.linelist.get_emlines` to exclude a wavelength range (useful for AO spectra with masked Na region)
3.4 (17/01/2020)
----------------
......
......@@ -120,7 +120,7 @@ emlines = np.array([
def get_emlines(iden=None, z=0, vac=True, lbrange=None, margin=25, sel=None,
ltype=None, doublet=False, restframe=False, table=False,
family=None):
family=None, exlbrange=None):
"""Return list of emission lines
Parameters
......@@ -149,6 +149,8 @@ def get_emlines(iden=None, z=0, vac=True, lbrange=None, margin=25, sel=None,
family : int
select line with the given family (0=abs, 1=Balmer, 2=Forbidden,
3=Resonant).
exlbrange : array-like
wavelength range to exclude in observed frame (ex for AO spectra)
"""
em = emlines.copy()
if iden is not None:
......@@ -177,6 +179,12 @@ def get_emlines(iden=None, z=0, vac=True, lbrange=None, margin=25, sel=None,
else:
em = em[em['c'] - margin >= lbrange[0]]
em = em[em['c'] + margin <= lbrange[1]]
if exlbrange is not None:
if restframe:
em = em[(em['c']*(1+z) < exlbrange[0]) | (em['c']*(1+z) > exlbrange[1])]
else:
em = em[(em['c'] < exlbrange[0]) | (em['c'] > exlbrange[1])]
if sel is not None:
em = em[em['s'] == sel]
if ltype is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment