Skip to content
Snippets Groups Projects
Commit 4cb4f415 authored by Laurent Mercadier's avatar Laurent Mercadier
Browse files

Merge branch 'xas_plot_title' into 'master'

Fixes bug in XAS plot title

See merge request SCS/ToolBox!60
parents d452a318 8b012a25
No related branches found
No related tags found
1 merge request!60Fixes bug in XAS plot title
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
import numpy as np import numpy as np
import matplotlib.gridspec as gridspec import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import re
def absorption(T, Io): def absorption(T, Io):
""" Compute the absorption A = -ln(T/Io) """ Compute the absorption A = -ln(T/Io)
...@@ -190,9 +191,9 @@ def xas(nrun, bins=None, Iokey='SCS_SA3', Itkey='MCP3apd', nrjkey='nrj', Iooffse ...@@ -190,9 +191,9 @@ def xas(nrun, bins=None, Iokey='SCS_SA3', Itkey='MCP3apd', nrjkey='nrj', Iooffse
color='C1', alpha=0.2) color='C1', alpha=0.2)
ax1_twin.set_ylabel('Io') ax1_twin.set_ylabel('Io')
try: try:
proposalNB=int(nrun.attrs['runFolder'].split('/')[-4][1:]) proposalNB=int(re.findall(r'p(\d{6})', nrun.attrs['runFolder'])[0])
runNB=int(nrun.attrs['runFolder'].split('/')[-2][1:]) runNB=int(re.findall(r'r(\d{4})', nrun.attrs['runFolder'])[0])
ax1.set_title('run {:d} p{:}'.format(runNB, proposalNB)) ax1.set_title(f'run {runNB} p{proposalNB}')
except: except:
f.suptitle(nrun.attrs['plot_title']) f.suptitle(nrun.attrs['plot_title'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment