Energy time amplitude

[1]:
import nexus as nx
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import colors

# ----------------- cavity in reflection geometry -------------

# ------------------------- Fe layer --------------------------
lay_Fe = nx.Layer(id = "Fe",
                material = nx.Material.Template(nx.lib.material.Fe_enriched),
                thickness = 1.5,
                roughness = 0.3)

site1 = nx.Hyperfine(magnetic_field = 0)

lay_Fe.material.hyperfine_sites = [site1]

# ----------------------------- Pt layers -----------------------------
lay_Pt_top = nx.Layer(id = "Pt top",
                material = nx.Material.Template(nx.lib.material.Pt),
                thickness = 2,
                roughness = 0.3)

lay_Pt = nx.Layer(id = "Pt",
                material = nx.Material.Template(nx.lib.material.Pt),
                thickness = 15,
                roughness = 0.3)

# -------------------------- C ---------------------------

lay_C = nx.Layer(id = "C",
                material = nx.Material.Template(nx.lib.material.C),
                thickness = 10,
                roughness = 0.3)

# --------------------- substrate ---------------------------------
lay_substrate = nx.Layer(id = "Si sub",
                material = nx.Material.Template(nx.lib.material.Si),
                thickness = nx.inf,
                roughness = 0.3)

sample_cavity = nx.Sample(id = "simple layers",
                          layers = [lay_Pt_top,
                                    lay_C,
                                    lay_Fe,
                                    lay_C,
                                    lay_Pt,
                                    lay_substrate],
                           geometry = "r",
                           angle = 0.148,
                           roughness = "a")

# ------------- Stainless steel foil in forward geometry ----------------
foil = nx.Layer(id = "StainSteel",
                material = nx.Material.Template(nx.lib.material.SS_enriched),
                thickness = 3000)

site_foil = nx.Hyperfine(
    isomer = -0.09,  # mm/s
    quadrupole = 0.6,
    isotropic = True)

foil.material.hyperfine_sites = [site_foil]

sample_foil = nx.Sample(id = "simple foil ",
                        layers = [foil],
                        geometry = "f")

beam  = nx.Beam()
beam.LinearSigma()

exp = nx.Experiment(beam = beam,
                    objects = [sample_cavity, sample_foil],
                    isotope = nx.moessbauer.Fe57,
                    id = "my exp")

# define a detuning for the sample on the drive
sample_foil.drive_detuning = np.linspace(-200, 200, 1024)  # Gamma

ets = nx.EnergyTimeAmplitude(experiment = exp,
                            time_length = 200.0,
                            time_step = 0.2,
                            mode = "i",
                            electronic = False)

timescale, amp = ets()

[2]:
print(amp.shape)
(1024, 1001, 2)
[3]:
intensity = np.square(np.abs(amp[:,:,0])) + np.square(np.abs(amp[:,:,1]))
##print(intensity)
[4]:
plt.imshow(intensity.T,
           cmap=plt.cm.plasma,
           norm=colors.LogNorm(),
           aspect='auto',
           origin = 'lower',
           extent=(min(sample_foil.drive_detuning), max(sample_foil.drive_detuning), min(timescale), max(timescale)))

plt.colorbar(orientation='vertical', label = r'amplitude ($\sqrt{\Gamma / \mathrm{ns}}$)')
plt.xlabel(r'detuning ($\Gamma$)')
plt.ylabel('time (ns)')
plt.show()
../../_images/tutorial_methods_nb_energy_time_amplitude_4_0.png