Exemple #1
0
import skultrafast
print(skultrafast.__version__)

plt.rcParams['figure.dpi'] = 130
plt.rcParams['figure.figsize'] = (3.2, 2)
plt.rcParams['figure.autolayout'] = True

# %%
# The main tool is the `MessPyFile` class. Note the constructor takes all the
# neccesary information to do the processing. Here I will pass all parameters
# explictily for documentation proposes. Some of the parameters are infered
# automatically.

# Get the file location first

fname = data_io.get_example_path('messpy')
print("Tutorial MessPy-file located at %s" % fname)
mpf = messpy.MessPyFile(
    fname,
    invert_data=True,  # Changes the sign of the data
    is_pol_resolved=True,  # If the data was recored polarization resolved.
    pol_first_scan='perp',  # Polarisation of the first scan
    valid_channel=1,  # Which channel to use, recent IR data always uses 1
    # Recent visible data uses 0
)

print(mpf.data.shape)
# %%
# Simlar to TimeResSpec the MessPyFile class has a plotter subclass with various
# plot methods. For example, the `compare_spec` method plots a averaged spectrum
# for each central channel recored.
Exemple #2
0
def test_path_loader():
    p = data_io.get_example_path('sys_response')
    assert Path(p).exists()
    p = data_io.get_example_path('messpy')
    assert Path(p).exists()
"""
Measuring the system response in the mid IR
===========================================

In the mid-IR the system response is measured by monitoring the transmittance of the
probe light through a thin semi-conductor. skultrafast has an helper function to
analyze such a signal.
"""
# %%
from skultrafast import messpy, data_io

fname = data_io.get_example_path('sys_response')
tz_result = messpy.get_t0(fname, display_result=False,
                          t_range=(-2, 0.3),
                          no_slope=False)

# %%
# Newer version of lmfit have a html representation which is used by ipython, e.g.
# in the notebook. Hence the line below will display the fit results.

tz_result.fit_result

Exemple #4
0
def test_2d_load():
    p = data_io.get_example_path('quickcontrol')
    assert Path(p).exists()
Exemple #5
0
import scipy.ndimage as nd
from scipy.stats import linregress
from skultrafast import data_io

# %%
# Nicer plots.

from skultrafast.plot_helpers import enable_style
enable_style()

# %%
# The file contains the measured intensities of the recored lines,
# the set wavelength and the calculated wavelengths, which we want to
# check and adjust.

p = data_io.get_example_path('ir_polyfilm')
a = np.load(p)
list(a.keys())

# %%
# Use some helper variables

wl = a['wl']
N = 63  # center channel
cwl = a['wl'][:, N]
pr = a['probe']

# %%
# Lets plot the spectrum of the center channel.

fig, ax = plt.subplots(figsize=(5, 2.4))