Skip to content

Commit

Permalink
more cleaning in refactor_vlim
Browse files Browse the repository at this point in the history
  • Loading branch information
ntejos committed Aug 4, 2016
1 parent 297e33e commit d5bc488
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
3 changes: 0 additions & 3 deletions linetools/isgm/tests/test_use_abscomp.py
Expand Up @@ -54,8 +54,6 @@ def mk_comp(ctype,vlim=[-300.,300]*u.km/u.s,add_spec=False, use_rand=True,
iline.attrib['flag_N'] = 1
iline.analy['spec'] = xspec
iline.limits.set(vlim)
#iline.analy['vlim'] = vlim
#iline.analy['wvlim'] = iline.wrest * (1 + zcomp + ltu.give_dz(vlim, zcomp))
_,_ = ltaa.linear_clm(iline.attrib) # Loads N, sig_N
abslines.append(iline)
# Component
Expand All @@ -71,7 +69,6 @@ def test_add_absline():
# failed addition
bad_absline = AbsLine('CIV 1550')
bad_absline.limits.set([500, 1000]*u.km/u.s)
#bad_absline.analy['vlim'] = [500, 1000]*u.km/u.s
bad_absline.attrib['coord'] = SkyCoord(20,20, unit='deg')
abscomp.add_absline(bad_absline)

Expand Down
1 change: 0 additions & 1 deletion linetools/scripts/lt_absline.py
Expand Up @@ -66,7 +66,6 @@ def plot_absline(iinp,logN,b, show=True):
# Calculate EW
aline.analy['spec'] = xspec
aline.limits.set([wrest-15., wrest+15]*u.AA)
#aline.analy['wvlim'] = np.array([wrest-15., wrest+15])*u.AA
aline.measure_ew()
print(aline)
print('EW = {:g}'.format(aline.attrib['EW']))
Expand Down
17 changes: 0 additions & 17 deletions linetools/spectralline.py
Expand Up @@ -265,15 +265,6 @@ def cut_spec(self, normalize=False):
raise ValueError('Expecting a unit!')

# Pixels for evaluation
'''
if np.sum(self.analy['wvlim'].value > 0.):
pix = self.analy['spec'].pix_minmax(self.analy['wvlim'])[0]
elif np.sum(np.abs(self.analy['vlim'].value) > 0.):
pix = self.analy['spec'].pix_minmax(
self.attrib['z'], self.wrest, self.analy['vlim'])[0]
else:
raise ValueError('spectralline.cut_spec: Need to set wvlim or vlim!')
'''
if self.limits.is_set():
pix = self.analy['spec'].pix_minmax(self.limits.wvlim)[0]
else:
Expand Down Expand Up @@ -305,8 +296,6 @@ def cut_spec(self, normalize=False):
def measure_ew(self, flg=1, initial_guesses=None):
""" Measures the observer frame equivalent width
[[Note this requires the keys `wvlim` and `spec` in analy to
be set!]]
Note this requires self.limits to be initialized
Default is simple boxcar integration.
Observer frame, not rest-frame (use measure_restew()
Expand Down Expand Up @@ -442,12 +431,6 @@ def coincident_line(self, specline):
True if there is overlap in wvobs space, False otherwise.
"""
'''
if np.sum(self.analy['wvlim'] != init_analy['wvlim']) == 0:
raise ValueError("{} has not set its analy['wvlim'] values!".format(self.__repr__()))
if np.sum(specline.analy['wvlim'] != init_analy['wvlim']) == 0:
raise ValueError("{} has not set its analy['wvlim'] values!".format(specline.__repr__()))
'''
if not self.limits.is_set():
raise ValueError("{} has not set its limits!".format(self.__repr__()))
if not specline.limits.is_set():
Expand Down

0 comments on commit d5bc488

Please sign in to comment.