Exemplo n.º 1
0
def init_containers():
    """Initialization of the spectra containers

    """
    cont_p_re = qr.TwoDSpectrumContainer()
    cont_p_re.use_indexing_type("integer")
    cont_p_nr = qr.TwoDSpectrumContainer()
    cont_p_nr.use_indexing_type("integer")
    cont_m_re = qr.TwoDSpectrumContainer()
    cont_m_re.use_indexing_type("integer")
    cont_m_nr = qr.TwoDSpectrumContainer()
    cont_m_nr.use_indexing_type("integer")

    return (cont_p_re, cont_p_nr, cont_m_re, cont_m_nr)
Exemplo n.º 2
0
def step_given_2(context):
    """

        And I have an empty TwoDSpectrum container

    """
    container = qr.TwoDSpectrumContainer()
    context.container = container
Exemplo n.º 3
0
def _container(context, N, cls):

    import numpy

    Nn = int(N)

    spectra = []

    def func(x, y, t):

        Delta = 10.0
        omega = 2.0 * 3.14159 / 20.0
        gamma = 1.0 / 100.0

        data = numpy.zeros((len(x), len(y)))

        for i_x in range(len(x)):
            data[i_x, :] = numpy.exp(-((x[i_x]+y)/Delta)**2)* \
                                numpy.cos(omega*t)*numpy.exp(-t/gamma)

        return data

    time = cls(0.0, Nn, 2.0)
    xrange = qr.ValueAxis(-50.0, 100, 1.0)
    yrange = qr.ValueAxis(-50.0, 100, 1.0)

    cont = qr.TwoDSpectrumContainer()
    cont.use_indexing_type(time)

    for k_n in range(Nn):
        tt = time.data[k_n]
        data = func(xrange.data, yrange.data, tt)
        spect = qr.TwoDSpectrum()
        spect.set_resolution("off")
        spect.set_data_flag("total")

        #spect.set_data(data)
        spect._add_data(data, dtype="total")

        spect.set_axis_1(xrange)
        spect.set_axis_3(yrange)
        spectra.append(spect)

        cont.set_spectrum(spect, tt)

    context.container = cont
Exemplo n.º 4
0
        print("Simulation stops, because `stop_after_propagation == True`")
        exit()

print("Calculating 2D spectra:")

#
# Laser pulse weighting is on the way
#

#spectrum = qr.DFunction(time, values)
# lab.set_pulse_spectra((0,1,2,3), stype="power", spectrum )

#
# we define a container for 2D spectra
#
cont = qr.TwoDSpectrumContainer(t2axis=time_so)
#
# spectra will be indexed by the times in the time axis `time_so`
#
cont.use_indexing_type(time_so)

#
# We define two-time axes, which will be FFTed and will define the omega_1 and
# omega_3 axes of the 2D spectrum
#
t1axis = qr.TimeAxis(0.0, t1_N_steps, t1_time_step)
t3axis = qr.TimeAxis(0.0, t3_N_steps, t3_time_step)

#
# This calculator calculated 2D spectra from the effective width defined above
#
Exemplo n.º 5
0
                         INP.special_pair))

if use_trimer:
    E0 = INP.special_pair["E_Pplus"]
else:
    E0 = INP.E_P # transition energy (in 1/cm) of the reference monomer


###############################################################################
###############################################################################
###############################################################################

#
# Container for resulting 2D maps
#
cont_p_re = qr.TwoDSpectrumContainer()
cont_p_re.use_indexing_type("integer")
cont_p_nr = qr.TwoDSpectrumContainer()
cont_p_nr.use_indexing_type("integer")
cont_m_re = qr.TwoDSpectrumContainer()
cont_m_re.use_indexing_type("integer")
cont_m_nr = qr.TwoDSpectrumContainer()
cont_m_nr.use_indexing_type("integer")


#
#
#   LOOP OVER SIMULATIONS
#
#
Exemplo n.º 6
0
    E0 = sp.params["E0"]
    dE = sp.params["dE"]
    omega = sp.params["omega"]
    return [[E0, "--k"], [E0 + dE, "--b"], [E0 + dE - omega, "--r"]]


if do_nodes:
    nodes = [i for i in range(Nnods)]  #0, 1, 2, 3, 4]
else:
    nodes = [0]

print("\n*** Making energy gap scan movie ***\n")

for ext_i in ext:

    cont = qr.TwoDSpectrumContainer()
    cont.use_indexing_type("integer")

    #
    # Unite nodes
    #
    ii = 0
    print("Creating spectral container ...")
    for node in nodes:

        if do_nodes:
            ndp = "_" + str(node)
        else:
            ndp = ""

        file_name = os.path.join(target_dir,
Exemplo n.º 7
0
w1_min = rwa_cm - 700.0
w1_max = rwa_cm + 700.0
w3_min = rwa_cm - 700.0
w3_max = rwa_cm + 700.0

window_2D = [w1_min, w1_max, w3_min, w3_max]
t_start = time.time()

#
# Plotting with given units on axes
#
with energy_units("1/cm"):
    
    k = 0
    twods = qr.TwoDSpectrumContainer(t2s)
    
    for tt2 in t2s.data:
        
        # calculate spectra iteratively
        spect = tcalc.calculate_next()
        # save memory by trimming the spectrum
        spect.trim_to(window=window_2D)
        # save it to a container
        twods.set_spectrum(spect)
        # plot it
        #spect.plot(window=window_2D) #,vmax=1.0, cbmax=cbmax)
        # save figure
        #figname = "fig"+str(round(tt2))+".png"
        #print("saving file: ", figname, " with 2D spectrum at ", tt2, "fs")
        #spect.savefig(figname)