コード例 #1
0
ファイル: single_pixel.py プロジェクト: wright-group/NISE
def get_pixel(TOs=[1, 2, 3, 4, 5, 6],
              out_group=None,
              mp=True,
              use_inhom=False,
              w1s=None,
              w2s=None,
              d2s=None,
              d1s=None):
    w1 = trive.w1
    w2 = trive.w2
    d2 = trive.d2
    d1 = trive.d1
    if w1s is None: w1.points = np.array([H_1.Omega.wa_central])
    else: w1.points = w1s
    if w2s is None: w2.points = np.array([H_1.Omega.wa_central])
    else: w2.points = w2s
    if d2s is None: d2.points = np.array([0])
    else: d2.points = d2s
    if d1s is None: d1.points = np.array([0])
    else: d1s.points = d1s

    #w1.points = np.linspace(5000, 9000, num=61)
    #w2.points = np.linspace(5000, 9000, num=61)
    #trive.ws.points = np.linspace(6000, 8800, num=21)
    #d2.points = np.linspace(-100, 100, num=11)
    #d1.points = np.linspace(-125, 125, num=15)
    trive.exp.timestep = 2.0
    if use_inhom:
        inhom_object = inhom.Inhom(inhom_sampling='linear',
                                   num=100,
                                   sigma=100.0,
                                   zeta_bound=2)
    else:
        inhom_object = inhom.Inhom()
    H = H_1.Omega()
    if out_group is None: pass
    else: H.out_group = out_group
    H.TOs = TOs
    trive.exp.late_buffer = 250.
    out1 = trive.exp.scan(w1, w2, d1, d2, H=H, inhom_object=inhom_object)
    if out1.array.size < 4:
        mp = False
    out1.run(autosave=False, mp=True, chunk=False)
    return out1
コード例 #2
0
        t.exp.set_coord(t.ss, 45.)
        #t.d2.points = np.array([-75, -25, 0, 25, 75])#, 150, 250, 500])
        #np.linspace(-75, 225, num=13)
        w1 = t.w1
        w2 = t.w2
        ws = t.ws
        d2 = t.d2
        d1 = t.d1
        w1.points = np.linspace(5000, 9000, num=41)
        w2.points = np.linspace(5000, 9000, num=41)
        #trive.ws.points = np.linspace(6000, 8800, num=21)
        d2.points = np.linspace(-200, 200, num=41)
        d1.points = np.linspace(-200, 200, num=11)
        t.exp.timestep = 2.0

        inhom_object = inhom.Inhom()
        H_1.Omega.tau_ag = tau
        H_1.Omega.tau_2aa = tau
        H_1.Omega.tau_2ag = tau
        H = H_1.Omega()
        H.TOs = TOs
        # make early buffer a little longer due to chirp
        t.early_buffer = 120.
        t.exp.late_buffer = H.tau_ag * 5
        #out1 = t.exp.scan(w1, w2, d2, H=H, inhom_object=inhom_object)
        t.exp.set_coord(dzs, 0.)
        #out1 = t.exp.scan(d1, d2, H=H, inhom_object=inhom_object)
        out1 = t.exp.scan(w1, w2, d1, H=H, inhom_object=inhom_object)
        out1.run(autosave=autosave, mp=True, chunk=False)
        t.exp.set_coord(dzs, 1.5e-5)
        out2 = t.exp.scan(w1, w2, d1, H=H, inhom_object=inhom_object)
コード例 #3
0
ファイル: test_evolve.py プロジェクト: wright-group/NISE
autosave = False
imported = False
add_nrb = False
use_inhom = False
nrb_level = 1.  # amplitude, relative to sig max
slitwidth = 120.0  # width in wavenumbers; set to none if no slit
# takes ~ 50 pts per second (with no inhomogeneity)

trive.exp.set_coord(trive.d1, 0.)
trive.exp.set_coord(trive.d2, 0.)
trive.exp.set_coord(trive.ss, 45.)
trive.w1.points = np.array([8300.])
trive.w2.points = np.array([6700.])
#trive.d2.points = np.array([-75, -25, 0, 25, 75])#, 150, 250, 500])
#np.linspace(-75, 225, num=13)
w1 = trive.w1
w2 = trive.w2
ws = trive.ws
d2 = trive.d2
trive.exp.timestep = 2.0
if use_inhom:
    inhom_object = inhom.Inhom(inhom_sampling='linear', num=10, sigma=100.0)
else:
    inhom_object = inhom.Inhom()
H = H_1.Omega()
H.out_group = [[13, 14, 15, 16], [12, 17]]
H.Gamma_bb = 0.  # eliminate coupling to examine cross-peak
out1 = trive.exp.scan(w1, w2, H=H, inhom_object=inhom_object)
out1.run(autosave=autosave)
コード例 #4
0
 w1 = trive.w1
 w2 = trive.w2
 ws = trive.ws
 d2 = trive.d2
 d1 = trive.d1
 w1.points = np.linspace(5000, 9000, num=121)
 w2.points = np.linspace(5000, 9000, num=121)
 #trive.ws.points = np.linspace(6000, 8800, num=21)
 d2.points = np.linspace(-100, 0, num=2)
 #d1.points = np.linspace(-125, 125, num=15)
 trive.exp.timestep = 2.0
 if use_inhom:
     #inhom_object = inhom.Inhom(inhom_sampling='linear', num=5, sigma=50.0)
     if gh_quad:
         inhom_object = inhom.Inhom(inhom_sampling='gh',
                                    num=7,
                                    sigma=100.0)
     else:
         inhom_object = inhom.Inhom(inhom_sampling='linear',
                                    num=100,
                                    sigma=100.0,
                                    zeta_bound=2)
 else:
     inhom_object = inhom.Inhom()
 H = H_1.Omega()
 H.TOs = TOs
 trive.exp.late_buffer = 250.
 out1 = trive.exp.scan(w1, w2, d2, H=H, inhom_object=inhom_object)
 #out1 = trive.exp.scan(d1, d2, H=H, inhom_object=inhom_object)
 if mp:
     out1.run(autosave=autosave, mp=True, chunk=False)
コード例 #5
0
ファイル: figures.py プロジェクト: kjczech/WrightData
 def add_data(ax, dpr, label, show_x=False):
     pulse_width = 50.
     slitwidth = 120.
     w_laser = 7050.
     # get axes from experiment
     w1 = trive.w1
     w2 = trive.w2
     ws = trive.ws
     d2 = trive.d2
     d1 = trive.d1
     # define points
     d2_points = np.zeros((1))
     d1_points = np.zeros((1))
     d1.points = d1_points
     d2.points = d2_points
     # set coords
     trive.exp.set_coord(w1, w_laser)
     trive.exp.set_coord(w2, w_laser)
     trive.exp.set_coord(trive.ss, pulse_width)
     trive.exp.timestep = 0.5
     # definitions external to the loop
     inhom_object = inhom.Inhom()
     m.Mono.slitwidth = slitwidth
     H1 = H0.Omega(tau_ag=pulse_width * dpr,
                   tau_2aa=pulse_width * dpr,
                   tau_2ag=pulse_width * dpr,
                   TOs=[6])
     H1.out_group = [[1], [5], [6]]
     H1.wa_central = 7000.
     # exciton-exciton coupling
     H1.a_coupling = 75.  # cm-1
     H1.mu_ag = 1.0
     H1.mu_2aa = H1.mu_ag  # HO approx (1.414) vs. uncorr. electron approx. (1.)
     # change late buffer
     trive.exp.early_buffer = 250
     trive.exp.late_buffer = 500  #H0.Omega.tau_ag * 3 * max(dpr,1.)
     trive.exp.get_coords()
     # run
     out = trive.exp.scan(d1, d2, H=H1, inhom_object=inhom_object)
     out.run(autosave=False, mp=False)
     # process
     tprime = np.arange(-out.early_buffer, out.late_buffer,
                        trive.exp.timestep)
     # convert the coherence to a rotating wave for easy phase analysis
     y = out.sig[0, 0, 0]
     y1 = np.exp(
         1j * H1.wa_central * NISE.lib.misc.wn_to_omega * tprime) * y
     y1 /= np.abs(y1).max()
     # try to convert signal to phase
     y2 = np.arctan(np.imag(y1) / np.real(y1))
     y3 = np.diff(y2)
     # filter for continuity
     for i in range(y3.size):
         if y3[i] > 3:
             print i, '>'
             y2[i + 1:] -= np.pi
         elif y3[i] < -3:
             print i, '<'
             y2[i + 1:] += np.pi
     # redefine the derivitive on y2 with disconitnuities removed
     y3 = np.diff(y2)
     y2 /= NISE.lib.misc.wn_to_omega
     y3 /= out.timestep * NISE.lib.misc.wn_to_omega
     #y3[y3>1] = 0.
     y3 -= H1.wa_central
     y3 *= -1
     # plot ----------------------------------------------------------------
     ax.axvline(0, color='k', lw=2, zorder=10)
     # line
     ax.plot(tprime / pulse_width,
             np.abs(y1) / np.abs(y1).max(),
             linewidth=2.,
             color='k',
             zorder=10)
     # colored inside
     color = (y3 - H1.wa_central) / (w_laser - H1.wa_central)
     import matplotlib.colors as colors
     import matplotlib.cm as cmx
     coolwarm = cm = plt.get_cmap('coolwarm')
     cNorm = colors.Normalize(vmin=0, vmax=1.)
     scalarMap = cmx.ScalarMappable(norm=cNorm, cmap=cm)
     for i in range(len(tprime[1:])):
         # calculate the color to use, given the instantaneous frequency
         colorVal = scalarMap.to_rgba(color[i])
         ax.plot([tprime[i + 1] / pulse_width, tprime[i + 1] / pulse_width],
                 [0, np.abs(y1)[i]],
                 color=colorVal)
     # excitation pulse
     t = tprime / pulse_width
     yi = normalized_gauss(t, 1)
     yi /= yi.max()
     ax.plot(t, yi, color='grey', lw=2, zorder=15)
     # finish
     if show_x:
         ax.set_xlabel(r'$\mathsf{t / w_t}$', fontsize=18)
     else:
         plt.setp(ax.get_xticklabels(), visible=False)
     ax.set_ylabel(r'$\mathsf{|\rho_{10}(t)|}$', fontsize=18)
     ax.set_xlim(-1.5, 2.25)
     ax.set_ylim(0., 1.1)
     ax.set_xticks([-1, 0, 1, 2])
     ax.set_yticks([0, 0.5, 1.])
     plt.setp(ax.get_yticklabels(), visible=False)
     ax.grid()
     wt.artists.corner_text(label, fontsize=18, background_alpha=1.)
コード例 #6
0
        print 'did not find coords_set'
        out1.coords_set = [[0, 3], [2, 3], [1, 3], [0, 2]]
        out1.save()
    w1 = out1.axis_objs[0]
    w2 = out1.axis_objs[1]
else:
    trive.exp.set_coord(trive.d1, 0.)
    trive.exp.set_coord(trive.d2, 0.)
    trive.w1.points = np.linspace(6000, 8000, num=21)
    trive.w2.points = np.linspace(6000, 8000, num=21)
    trive.d2.points = np.linspace(-50, 200, num=6)
    w1 = trive.w1
    w2 = trive.w2
    d2 = trive.d2
    trive.exp.timestep = 4.0
    inhom_object = inhom.Inhom()#inhom_sampling='linear', num=5, sigma=100.0)
    out1 = trive.exp.scan(w1, w2, d2, H=H_ab.Omega(), inhom_object=inhom_object)
    out1.run(autosave=autosave)

if add_nrb:
    nrb1 = out1.nrb()
    nrb1_max = np.abs(nrb1).sum(axis=-1).max()
    out1_smax = np.abs(out1.sig).sum(axis=-1).max()
    print nrb1_max, out1_smax
    nrb1 *= out1_smax / nrb1_max * nrb_level
    print np.abs(nrb1).max(), np.abs(out1.sig).max()
    out1.sig = out1.sig.sum(axis=-2)[...,None,:]
    out1.sig += nrb1[...,None,:]


sig1 = m.Measure(out1, m.Mono, m.SLD)
コード例 #7
0
ファイル: test_H_PbSe2.py プロジェクト: wright-group/NISE
    trive.exp.set_coord(trive.d1, 25.)
    trive.exp.set_coord(trive.d2, 0.)
    trive.exp.set_coord(trive.ss, 45.)
    trive.w1.points = np.linspace(6000, 9000, num=21)
    trive.w2.points = np.linspace(6000, 9000, num=20)
    trive.ws.points = np.linspace(6000, 8800, num=21)
    trive.d2.points = np.linspace(-125, 125, num=11)
    #trive.d2.points = np.array([-75, -25, 0, 25, 75])#, 150, 250, 500])
    #np.linspace(-75, 225, num=13)
    w1 = trive.w1
    w2 = trive.w2
    ws = trive.ws
    d2 = trive.d2
    trive.exp.timestep = 2.0
    if use_inhom:
        inhom_object = inhom.Inhom(inhom_sampling='linear', num=5, sigma=75.0)
    else:
        inhom_object = inhom.Inhom()
    H = H_1.Omega()
    H.out_group = [[13, 14, 15, 16], [12, 17]]
    #H.Gamma_bb  = 0. # eliminate coupling to examine cross-peak
    out1 = trive.exp.scan(w1, w2, d2, H=H, inhom_object=inhom_object)
    out1.run(autosave=autosave)
"""
outsig = out1.sig.copy()
print out1.sig.shape
out1.sig = outsig[...,1:2,:]
print out1.sig.shape
#"""
if add_nrb:
    nrb1 = out1.nrb()