From 8d8cad966df30b631fb14fe98d4cd8482b3349dd Mon Sep 17 00:00:00 2001 From: rasmusvt Date: Tue, 10 May 2022 17:29:22 +0200 Subject: [PATCH] Allow plotting of multiple beamline scans (quickfix) --- nafuma/xrd/io.py | 2 +- nafuma/xrd/plot.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nafuma/xrd/io.py b/nafuma/xrd/io.py index b3f3951..2511ff1 100644 --- a/nafuma/xrd/io.py +++ b/nafuma/xrd/io.py @@ -59,7 +59,7 @@ def integrate_1d(data, options={}, index=0): # Get image array from filename if not passed - if 'image' not in data.keys(): + if 'image' not in data.keys() or not data['image']: data['image'] = get_image_array(data['path'][index]) # Instanciate the azimuthal integrator from pyFAI from the calibrant (.poni-file) diff --git a/nafuma/xrd/plot.py b/nafuma/xrd/plot.py index 8dd6a27..c45582b 100644 --- a/nafuma/xrd/plot.py +++ b/nafuma/xrd/plot.py @@ -75,6 +75,9 @@ def plot_diffractogram(data, options={}): data['diffractogram'][index] = diffractogram data['wavelength'][index] = wavelength + # FIXME This is a quick fix as the image is not reloaded when passing multiple beamline datasets + data['image'] = None + # Sets the xlim if this has not bee specified if not options['xlim']: options['xlim'] = [data['diffractogram'][0][options['x_vals']].min(), data['diffractogram'][0][options['x_vals']].max()]