Loading RAMAN experimental file

Here we load experimental LABSPEC spectra and plot them.

import spectrochempy as scp

Define the folder where are the spectra:

datadir = scp.preferences.datadir
ramandir = datadir / "ramandata/labspec"

Read some data:

A = scp.read_labspec("Activation.txt", directory=ramandir)
A
NDDataset: [float64] unitless (shape: (y:532, x:1024))[Activation]
Summary
name
:
Activation
author
:
runner@runnervmrg6be
created
:
2026-03-29 02:33:43+00:00
description
:
Spectrum acquisition : 2016-05-01 11:22:14
history
:
2026-03-29 02:33:43+00:00> Imported from LabSpec6 text file
/home/runner/.spectrochempy/testdata/ramandata/labspec/Activation.txt
Data
title
:
Counts
values
:
...
[[3.277e+05 3.278e+05 ... 7.594e+05 7.607e+05]
[3.239e+05 3.252e+05 ... 7.513e+05 7.501e+05]
...
[5.711e+04 5.69e+04 ... 9.721e+04 9.697e+04]
[ 3831 3826 ... 6476 6385]]
shape
:
(y:532, x:1024)
Dimension `x`
size
:
1024
title
:
Raman shift
coordinates
:
[ 198.2 199.8 ... 1692 1693] cm⁻¹
Dimension `y`
size
:
532
title
:
Time
coordinates
:
[ 0 308.4 ... 1.689e+05 1.692e+05] s
labels
:
[ 2016-05-01 11:22:14 2016-05-01 11:27:14 ... 2016-05-03 07:32:14 2016-05-03 07:37:14]


Now plot them:

_ = A.plot()
plot read raman from labspec

As it is a 2D dataset, we can plot it as an image:

_ = A.plot_image()
plot read raman from labspec

or a contour plot:

_ = A.plot_map()
plot read raman from labspec

We can also read the content of a folder, and merge all spectra:

B = scp.read_labspec(ramandir / "subdir")
_ = B.plot()
plot read raman from labspec

This ends the example ! The following line can be uncommented if no plot shows when running the .py script with python

# scp.show()

Total running time of the script: (0 minutes 3.359 seconds)