Add option to exclude (make region = 0) in diffs
This commit is contained in:
parent
2a2f092f8b
commit
2deb640b3d
2 changed files with 10 additions and 0 deletions
|
|
@ -715,6 +715,15 @@ def read_data(data, options={}, index=0):
|
||||||
diffractogram, wavelength = read_xy(data=data, options=options, index=index)
|
diffractogram, wavelength = read_xy(data=data, options=options, index=index)
|
||||||
|
|
||||||
|
|
||||||
|
if options['exclude']:
|
||||||
|
|
||||||
|
if not isinstance(options['exclude'], list):
|
||||||
|
options['exclude'] = [options['exclude']]
|
||||||
|
|
||||||
|
for excl in options['exclude']:
|
||||||
|
diffractogram['I'].loc[(diffractogram['2th'] > excl[0]) & (diffractogram['2th'] < excl[1])] = 0
|
||||||
|
|
||||||
|
|
||||||
if options['offset'] or options['normalise']:
|
if options['offset'] or options['normalise']:
|
||||||
# Make copy of the original intensities before any changes are made through normalisation or offset, to easily revert back if need to update.
|
# Make copy of the original intensities before any changes are made through normalisation or offset, to easily revert back if need to update.
|
||||||
diffractogram['I_org'] = diffractogram['I']
|
diffractogram['I_org'] = diffractogram['I']
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ def plot_diffractogram(data, options={}):
|
||||||
'xunit': '$^{\circ}$', 'yunit': None,
|
'xunit': '$^{\circ}$', 'yunit': None,
|
||||||
'xlim': None, 'ylim': None,
|
'xlim': None, 'ylim': None,
|
||||||
'normalise': True,
|
'normalise': True,
|
||||||
|
'exclude': None,
|
||||||
'multiply': 1, # Factor to multiply the normalised data - only used if normalising.
|
'multiply': 1, # Factor to multiply the normalised data - only used if normalising.
|
||||||
'drawdown': False,
|
'drawdown': False,
|
||||||
'offset': True,
|
'offset': True,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue