Loading pysen/atarilib.py +2 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,8 @@ Spectrum = namedtuple('Spectrum', ['lam','dlam','flux']) def fit_poly_current(curr, counts, iphase, deg=4, dix=3): "fit poly for phasetables and atari plot" cnts, _ = counts imx = iphase or np.argmax(cnts) # FIXME: skipping first and last points imx = iphase or np.argmax(cnts[1:-1]) imx1 = max(0 , imx-dix) imx2 = min(len(cnts), imx+dix) xf = curr[imx1:imx2+1] Loading scripts/echoplot.py +17 −9 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ def echo_plot(hdfile, iecho=0, **kwargs): comment = comment.decode("utf-8") sample = comment.split()[0] ntaus = hdfile.attrs['scan_length'] n_idx = { 'dn': hdfile['/'].attrs['point_to_down'], 'up': hdfile['/'].attrs['point_to_up'] , 'nphases': hdfile['/'].attrs['no_of_phases'] } Loading @@ -50,20 +49,30 @@ def echo_plot(hdfile, iecho=0, **kwargs): if center_only: ntaus = 0 for echo in list(hdfile['/data'].values()): if iecho is None or echo.attrs['id'] == iecho: ntaus = ntaus + 1 print(ntaus) if ntaus>4: nxtau = 4 nytau = int(np.ceil(ntaus/4)) else: nxtau = 1 nytau = ntaus #print(nxtau, nytau) #fig0, axes0 = plt.subplots(nxtau,nytau, figsize=(8,8)) fig0 = plt.figure(figsize=(8,8)) fig0.suptitle(r'%s | %s' % (sample, base)) itau = 0 for echo in list(hdfile['/data'].values()): if iecho is not None and echo.attrs['id'] != iecho: print("skipping ", echo.name) continue else: print("processing", echo.name) pass itau = itau + 1 phase = echo['phase'] physics = echo['phys'] Loading Loading @@ -105,8 +114,7 @@ def echo_plot(hdfile, iecho=0, **kwargs): lam0=lam0, phase0=phase0, phasesens=phasesens) if center_only: ie = int(echo.attrs['id']) ax = fig0.add_subplot(nxtau, nytau, int(echo.attrs['id'])) ax = fig0.add_subplot(nxtau, nytau, itau) fig0.suptitle(r'%s | %s | $\lambda$=%.2g$\AA$ $Q$=%.3f$\AA^{-1}$ ' % (sample, base, lam0/ANGSTROM, q0)) ax.errorbar(cur[:nph], y[:nph], yerr=ey[:nph], fmt='k.', lw=2, ms=3) ax.plot(xef, yef, 'r-', label=r'$\tau$=%.3gns' % tau0) Loading @@ -116,7 +124,7 @@ def echo_plot(hdfile, iecho=0, **kwargs): ax.legend() ax.grid() #ax.set_xticklabels([]) if ie%nytau!=1: if itau%nytau!=1: ax.set_yticklabels([]) continue Loading Loading
pysen/atarilib.py +2 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,8 @@ Spectrum = namedtuple('Spectrum', ['lam','dlam','flux']) def fit_poly_current(curr, counts, iphase, deg=4, dix=3): "fit poly for phasetables and atari plot" cnts, _ = counts imx = iphase or np.argmax(cnts) # FIXME: skipping first and last points imx = iphase or np.argmax(cnts[1:-1]) imx1 = max(0 , imx-dix) imx2 = min(len(cnts), imx+dix) xf = curr[imx1:imx2+1] Loading
scripts/echoplot.py +17 −9 Original line number Diff line number Diff line Loading @@ -37,7 +37,6 @@ def echo_plot(hdfile, iecho=0, **kwargs): comment = comment.decode("utf-8") sample = comment.split()[0] ntaus = hdfile.attrs['scan_length'] n_idx = { 'dn': hdfile['/'].attrs['point_to_down'], 'up': hdfile['/'].attrs['point_to_up'] , 'nphases': hdfile['/'].attrs['no_of_phases'] } Loading @@ -50,20 +49,30 @@ def echo_plot(hdfile, iecho=0, **kwargs): if center_only: ntaus = 0 for echo in list(hdfile['/data'].values()): if iecho is None or echo.attrs['id'] == iecho: ntaus = ntaus + 1 print(ntaus) if ntaus>4: nxtau = 4 nytau = int(np.ceil(ntaus/4)) else: nxtau = 1 nytau = ntaus #print(nxtau, nytau) #fig0, axes0 = plt.subplots(nxtau,nytau, figsize=(8,8)) fig0 = plt.figure(figsize=(8,8)) fig0.suptitle(r'%s | %s' % (sample, base)) itau = 0 for echo in list(hdfile['/data'].values()): if iecho is not None and echo.attrs['id'] != iecho: print("skipping ", echo.name) continue else: print("processing", echo.name) pass itau = itau + 1 phase = echo['phase'] physics = echo['phys'] Loading Loading @@ -105,8 +114,7 @@ def echo_plot(hdfile, iecho=0, **kwargs): lam0=lam0, phase0=phase0, phasesens=phasesens) if center_only: ie = int(echo.attrs['id']) ax = fig0.add_subplot(nxtau, nytau, int(echo.attrs['id'])) ax = fig0.add_subplot(nxtau, nytau, itau) fig0.suptitle(r'%s | %s | $\lambda$=%.2g$\AA$ $Q$=%.3f$\AA^{-1}$ ' % (sample, base, lam0/ANGSTROM, q0)) ax.errorbar(cur[:nph], y[:nph], yerr=ey[:nph], fmt='k.', lw=2, ms=3) ax.plot(xef, yef, 'r-', label=r'$\tau$=%.3gns' % tau0) Loading @@ -116,7 +124,7 @@ def echo_plot(hdfile, iecho=0, **kwargs): ax.legend() ax.grid() #ax.set_xticklabels([]) if ie%nytau!=1: if itau%nytau!=1: ax.set_yticklabels([]) continue Loading