Skip to content

Commit

Permalink
better assure that mback arrays are available, force re-processing if…
Browse files Browse the repository at this point in the history
… needed
  • Loading branch information
newville committed Aug 12, 2024
1 parent c12a872 commit 2581b72
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions larch/wxxas/xasnorm_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,7 @@ def onPlotSel(self, evt=None):
elif norm_method.startswith('area'):
yarray_name = 'norm_area'
ylabel = "%s (Area)" % ylabel

voff = self.wids['plot_voff'].GetValue()
plot_traces = []
newplot = True
Expand All @@ -576,7 +577,7 @@ def onPlotSel(self, evt=None):
dgroup = self.controller.get_group(groupname)
if dgroup is None:
continue
self.ensure_xas_processed(dgroup)
self.ensure_xas_processed(dgroup, force_mback =('mback' in yarray_name))

if erange is not None and hasattr(dgroup, 'e0') and 'xmin' not in popts:
popts['xmin'] = dgroup.e0 + erange[0]
Expand Down Expand Up @@ -1082,16 +1083,7 @@ def plot(self, dgroup, title=None, plot_yarrays=None, yoff=0,
if groupname is None:
return

self.ensure_xas_processed(dgroup)

if ((getattr(dgroup, 'plot_yarrays', None) is None or
getattr(dgroup, 'energy', None) is None or
getattr(dgroup, 'mu', None) is None or
getattr(dgroup, 'e0', None) is None or
getattr(dgroup, 'dmude', None) is None or
getattr(dgroup, 'd2mude', None) is None or
getattr(dgroup, 'norm', None) is None)):
self.process(dgroup=dgroup)
self.ensure_xas_processed(dgroup, force_mback=True)
self.get_plot_arrays(dgroup)

if plot_yarrays is None and hasattr(dgroup, 'plot_yarrays'):
Expand Down

0 comments on commit 2581b72

Please sign in to comment.