Add option to exclude (make region = 0) in diffs

This commit is contained in:
rasmusthog 2022-10-11 19:57:05 +02:00
parent 2a2f092f8b
commit 2deb640b3d
2 changed files with 10 additions and 0 deletions

View file

@ -714,6 +714,15 @@ def read_data(data, options={}, index=0):
elif file_extension in['xy', 'xye']:
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']:
# Make copy of the original intensities before any changes are made through normalisation or offset, to easily revert back if need to update.

View file

@ -28,6 +28,7 @@ def plot_diffractogram(data, options={}):
'xunit': '$^{\circ}$', 'yunit': None,
'xlim': None, 'ylim': None,
'normalise': True,
'exclude': None,
'multiply': 1, # Factor to multiply the normalised data - only used if normalising.
'drawdown': False,
'offset': True,