diff --git a/beamtime/plotting.py b/beamtime/plotting.py index 780a022..e8c5457 100644 --- a/beamtime/plotting.py +++ b/beamtime/plotting.py @@ -151,9 +151,9 @@ def adjust_plot(fig, ax, options): # FIXME THIS NEEDS REWORK FOR IT TO FUNCTION PROPERLY! - if options['xticks']: - ax.set_xticks(np.arange(plot_data['start'], plot_data['end']+1)) - ax.set_xticklabels(options['xticks']) + #if options['xticks']: + # ax.set_xticks(np.arange(plot_data['start'], plot_data['end']+1)) + # ax.set_xticklabels(options['xticks']) # else: # ax.set_xticks(np.arange(plot_data['start'], plot_data['end']+1)) # ax.set_xticklabels([x/2 for x in np.arange(plot_data['start'], plot_data['end']+1)]) diff --git a/beamtime/xanes/calib.py b/beamtime/xanes/calib.py index 2ef6c4d..6a4c8f6 100644 --- a/beamtime/xanes/calib.py +++ b/beamtime/xanes/calib.py @@ -13,7 +13,7 @@ def rbkerbest(): ##Better to make a new function that loops through the files, and performing the split_xanes_scan on -def split_xanes_scan(root, destination=None, replace=False): +def split_xanes_scan(filename, destination=None, replace=False): #root is the path to the beamtime-folder #destination should be the path to the processed data diff --git a/beamtime/xrd/plot.py b/beamtime/xrd/plot.py index cc6baa3..950a27f 100644 --- a/beamtime/xrd/plot.py +++ b/beamtime/xrd/plot.py @@ -7,6 +7,7 @@ import numpy as np import math import ipywidgets as widgets +from IPython.display import display import beamtime.xrd as xrd import beamtime.auxillary as aux @@ -657,54 +658,6 @@ def prettify_labels(label): return labels_dict[label] -def plot_diffractograms(paths, kind, options=None): - - - fig, ax = prepare_diffractogram_plot(options=options) - - diffractograms = [] - - for path in paths: - diffractogram = xrd.io.read_data(path=path, kind=kind, options=options) - diffractograms.append(diffractogram) - - - required_options = ['type', 'xvals', 'yvals', 'x_offset', 'y_offset', 'normalise', 'normalise_around', 'reverse_order'] - default_options = { - 'type': 'stacked', - 'xvals': '2th', - 'yvals': 'I', - 'x_offset': 0, - 'y_offset': 0.2, - 'normalise': True, - 'normalise_around': None, - 'reverse_order': False - } - - - # If reverse_order is enabled, reverse the order - if options['reverse_order']: - diffractograms = reverse_diffractograms(diffractograms) - - - # If normalise is enbaled, normalise all the diffractograms - if options['normalise']: - if not options['normalise_around']: - for diffractogram in diffractograms: - diffractogram["I"] = diffractogram["I"]/diffractogram["I"].max() - else: - diffractogram["I"] = diffractogram["I"]/diffractogram["I"].loc[(diffractogram['2th'] > options['normalise_around'][0]) & (diffractogram['2th'] < options['normalise_around'][1])].max() - - - if options['type'] == 'stacked': - for diffractogram in diffractograms: - diffractogram.plot(x=options['xvals'], y=options['yvals'], ax=ax) - - - fig, ax = prettify_diffractogram_plot(fig=fig, ax=ax, options=options) - - - return diffractogram, fig, ax def reverse_diffractograms(diffractograms):