Commit 87fb661a authored by Zolnierczuk, Piotr's avatar Zolnierczuk, Piotr
Browse files

bug fix for no up/down echos (e.g. paramagnetic)

- implied --only-echo
parent 6adb79a1
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -279,11 +279,15 @@ def plot_atari(hdfile, iecho=None, **kwargs):
        ax.axhline(res['average'][0]-res['amplitude'][0], color=dcol, lw=1, ls='--')

        minup, maxup = None, None
        try:
            minup, maxup = 0, max((max(up), max(dn)))*1.2
        except ValueError:
            only_echo =True

        if only_echo:
            _txt = r'$A(Q,t)$=%.3g$\pm$%.3g' % res['amplitude']
            minup, maxup = None, None
        else:
            minup = 0
            maxup = max((max(up), max(dn)))*1.2
            res['up'] = average(up),sqrt(sum(up)/len(up))
            res['dn'] = average(dn),sqrt(sum(dn)/len(dn))
            R  = 2*res['amplitude'][0]/( res['up'][0] - res['dn'][0] )
@@ -515,6 +519,7 @@ def plot_echo(hdfile, iecho=None, **kwargs):
                             incoherent=incoherent)
        (phase_ef0, phase_err) , (xef,yef), res = _
        if center_only:
            only_echo = only_echo or not (len(up) or len(dn))
            res['current0'] = (phase_ef0, phase_err)
            if not only_echo:
                res['up'] = average(up), sqrt(sum(up)/len(up))
@@ -576,6 +581,7 @@ def plot_echo(hdfile, iecho=None, **kwargs):
                ave   = average(y[:nph])
                #std   = np.std(y[:nph])

                only_echo = only_echo or not (len(up) or len(dn))
                if udave<min_counts or ave<min_counts:
                    plot_single_echo(ax, (cur, y, ey), (nph,n_idx['up']), label='(%s,%s)' % (i,j),
                                    only_echo=only_echo,
@@ -593,7 +599,7 @@ def plot_echo(hdfile, iecho=None, **kwargs):
                    R = 2*res['amplitude'][0]/(upave - dnave)
                    #if abs(R)<min_amp:
                    #    continue

                    if not only_echo:
                        res['up'] = upave, sqrt(sum(up)/len(up))
                        res['dn'] = dnave, sqrt(sum(dn)/len(dn))
                    res['current0'] = (phase_ef, phase_err)
+2 −2
Original line number Diff line number Diff line
@@ -3,8 +3,8 @@ PySEN revision module
"""
import sys
__version__  = "1.2"
__release__  = "rc4"
__date__     = "Oct 20, 2022"
__release__  = "rc5"
__date__     = "Nov 12, 2022"

def version(full=False):
    "get pysen version number"