Skip to content

Commit

Permalink
getWeff raises error if no period is set
Browse files Browse the repository at this point in the history
  • Loading branch information
mtlam committed Jan 25, 2021
1 parent 24cfde7 commit 01e0aaa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pypulse/singlepulse.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ def getFW(self, value=0.5, simple=False, timeunits=True):
factor = self.getPeriod()/self.getNbins()
return factor*dbin

def getWeff(self, fourier=False, sumonly=False, timeunits=True):
def getWeff(self, fourier=False, sumonly=False):
"""
Calculate the effective width of the pulse
"""
if not timeunits or self.getPeriod() is None:
return None
if self.getPeriod() is None:
raise ValueError("Cannot calculate Weff; period is not set")
P = self.getPeriod()
N = self.getNbins()
U = u.normalize(self.data, simple=True) #remove baseline?
Expand Down

0 comments on commit 01e0aaa

Please sign in to comment.