Add interactive offset_y
This commit is contained in:
parent
c637bdce6a
commit
f504c7dd69
2 changed files with 25 additions and 6 deletions
|
|
@ -81,6 +81,13 @@ def plot_diffractogram(data, options={}):
|
|||
options['xlim'] = [diffractogram[options['x_vals']].min(), diffractogram[options['x_vals']].max()]
|
||||
|
||||
|
||||
if options['interactive_session_active']:
|
||||
if options['offset']:
|
||||
if (options['offset_x'] != options['current_offset_x']) or (options['offset_y'] != options['current_offset_y']):
|
||||
for i, (diff, wl) in enumerate(zip(data['diffractogram'], data['wavelength'])):
|
||||
xrd.io.apply_offset(diff, wl, i, options)
|
||||
|
||||
|
||||
# Start inteactive session with ipywidgets. Disables options['interactive'] in order for the interactive loop to not start another interactive session
|
||||
if options['interactive']:
|
||||
options['interactive'] = False
|
||||
|
|
@ -156,7 +163,9 @@ def plot_diffractogram(data, options={}):
|
|||
if options['interactive_session_active']:
|
||||
btp.update_widgets(options=options)
|
||||
|
||||
xrd.io.up
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return diffractogram, fig, ax
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue