Short term fix for heatmap generation with beamline data

This commit is contained in:
rasmusvt 2022-08-26 13:24:17 +02:00
parent 7285f47db3
commit 9ed675b8cb

View file

@ -362,6 +362,10 @@ def generate_heatmap(data, options={}):
if options['increase_contrast']: if options['increase_contrast']:
if d['I'].min() < 0:
d['I'] = d['I'] - d['I'].min()
d['I'] = d['I']**(1/options['contrast_factor']) d['I'] = d['I']**(1/options['contrast_factor'])
twotheta = np.append(twotheta, d['2th'].to_numpy()) twotheta = np.append(twotheta, d['2th'].to_numpy())
@ -418,6 +422,9 @@ def generate_heatmap(data, options={}):
scan_numbers = [] scan_numbers = []
temperatures = [] temperatures = []
# FIXME This is a very bad check for whether it is HTXRD or not - it bascailly just excludes any files that has a .poni-file passed. Make more rigorous in future!
if not 'calibrant' in data.keys():
for i, filename in enumerate(data['path']): for i, filename in enumerate(data['path']):
scan_numbers.append(i) scan_numbers.append(i)
temperatures.append(xrd.io.read_metadata_from_xy(filename)['temperature']) temperatures.append(xrd.io.read_metadata_from_xy(filename)['temperature'])
@ -436,6 +443,9 @@ def generate_heatmap(data, options={}):
options['heatmap.ylabel'] = 'Temperature' options['heatmap.ylabel'] = 'Temperature'
options['heatmap.yunit'] = '$^\circ$C' options['heatmap.yunit'] = '$^\circ$C'
else:
yticks, yticklabels = None, None