Skip to content

Commit

Permalink
Merge pull request #275 from licode/elastic_peak
Browse files Browse the repository at this point in the history
ENH: Pileup peaks added
  • Loading branch information
tacaswell committed Jun 24, 2015
2 parents fa55ede + 5a629c6 commit 056e586
Show file tree
Hide file tree
Showing 5 changed files with 347 additions and 217 deletions.
6 changes: 3 additions & 3 deletions skxray/fitting/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

def snip_method(spectrum,
e_off, e_lin, e_quad,
xmin=0, xmax=2048, epsilon=2.96,
xmin=0, xmax=4096, epsilon=2.96,
width=0.5, decrease_factor=np.sqrt(2),
spectral_binning=None,
con_val=None,
Expand Down Expand Up @@ -178,7 +178,7 @@ def snip_method(spectrum,
temp = (background[lo_index.astype(np.int)] +
background[hi_index.astype(np.int)]) / 2.

bg_index = background > temp
bg_index = background > temp
background[bg_index] = temp[bg_index]

current_width = window_p
Expand All @@ -195,7 +195,7 @@ def snip_method(spectrum,
temp = (background[lo_index.astype(np.int)] +
background[hi_index.astype(np.int)]) / 2.

bg_index = background > temp
bg_index = background > temp
background[bg_index] = temp[bg_index]

# decrease the width and repeat
Expand Down
9 changes: 6 additions & 3 deletions skxray/fitting/base/parameter_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@
'bound_type': 'lohi',
'description': 'Incident E [keV]',
'max': 13.0,
'min': 9.0, 'value': 11.0},
'min': 9.0,
'value': 10.0},
'compton_amplitude': {
'bound_type': 'none',
'max': 10000000.0,
Expand Down Expand Up @@ -300,7 +301,8 @@
'min': -1e-06,
'tool_tip': 'E(channel) = a0 + a1*channel+ a2*channel**2',
'value': 0.0},
'fwhm_fanoprime': {'bound_type': 'fixed',
'fwhm_fanoprime': {
'bound_type': 'fixed',
'description': 'fwhm Coef, b2',
'max': 0.0001,
'min': 1e-07,
Expand All @@ -322,7 +324,8 @@
'value': 13.5,
'default_value': 13.5,
'description': 'E high [keV]'},
'epsilon': 3.51 # electron hole energy
'epsilon': 3.51, # electron hole energy
"background_width": 0.5
}
}

Expand Down
4 changes: 2 additions & 2 deletions skxray/fitting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class ElasticModel(Model):

def __init__(self, *args, **kwargs):
super(ElasticModel, self).__init__(elastic, *args, **kwargs)
set_default(self, elastic)
#set_default(self, elastic)
self.set_param_hint('epsilon', value=2.96, vary=False)


Expand All @@ -139,7 +139,7 @@ class ComptonModel(Model):
def __init__(self, *args, **kwargs):

super(ComptonModel, self).__init__(compton, *args, **kwargs)
set_default(self, compton)
#set_default(self, compton)
self.set_param_hint('epsilon', value=2.96, vary=False)


Expand Down
Loading

0 comments on commit 056e586

Please sign in to comment.