Import of Bruker OPUS files

Bruker OPUS files have also a proprietary file format. The Opus reader (read_opus() ) of spectrochempy is essentially a wrapper of the python module brukeropus developed by Josh Duran. The use of read_opus() is similar to that of read_omnic().

Basic loading of OPUS file

Individual Opus files can be opened and loaded as a new NDDataset using:

[1]:
import spectrochempy as scp
  SpectroChemPy's API - v.0.8.2.dev7
©Copyright 2014-2025 - A.Travert & C.Fernandez @ LCS
[2]:
Z = scp.read_opus("irdata/OPUS/test.0002")
Z
Running on GitHub Actions
MPL Configuration directory: /home/runner/.config/matplotlib
Stylelib directory: /home/runner/.config/matplotlib/stylelib
[2]:
NDDataset: [float64] a.u. (shape: (y:1, x:2567))[test]
Summary
name
:
test
author
:
runner@fv-az2211-104
created
:
2025-04-27 01:45:47+00:00
description
:
Dataset from opus files.
Spectra type: Absorbance
history
:
2025-04-27 01:45:47+00:00> 2025-04-27 01:45:47.874444+00:00: import from opus files
Data
title
:
absorbance
values
:
...
[[0.0002479 0.0002325 ... 0.5809 0.6376]] a.u.
shape
:
(y:1, x:2567)
Dimension `x`
size
:
2567
title
:
wavenumber
coordinates
:
[ 3998 3997 ... 700.7 699.4] cm⁻¹
Dimension `y`
size
:
1
title
:
acquisition timestamp (GMT)
coordinates
:
[1.581e+09] s
labels
:
...
[[ 2020-02-06 12:10:06.368000+00:00]
[ MCT D317 1mm² [8500 - 700 Cm-1]]
[ /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0002]]

Note: In the previous use of read_opus(), we have assumed that the file is in datadir folder (see the import tutorial or more details on this). If this not the case, you should use an absolute path or a relative path to the current notebook folder.

For multifile loading, one can use:

[3]:
Z1 = scp.read_opus("test.0000", "test.0001", "test.0002", directory="irdata/OPUS")
Z1
[3]:
NDDataset: [float64] a.u. (shape: (y:3, x:2567))[test]
Summary
name
:
test
author
:
runner@fv-az2211-104
created
:
2025-04-27 01:45:47+00:00
description
:
Concatenation of 3 datasets:
( test, test, test )
history
:
2025-04-27 01:45:47+00:00> Created by concatenate
2025-04-27 01:45:47+00:00> Merged from several files
Data
title
:
absorbance
values
:
...
[[0.000459 0.0004219 ... 0.5771 0.6324]
[0.000451 0.0004229 ... 0.5752 0.6311]
[0.0002479 0.0002325 ... 0.5809 0.6376]] a.u.
shape
:
(y:3, x:2567)
Dimension `x`
size
:
2567
title
:
wavenumber
coordinates
:
[ 3998 3997 ... 700.7 699.4] cm⁻¹
Dimension `y`
size
:
3
title
:
acquisition timestamp (GMT)
coordinates
:
[1.581e+09 1.581e+09 1.581e+09] s
labels
:
...
[[ 2020-02-06 12:09:58.095000+00:00 2020-02-06 12:10:02.232000+00:00 2020-02-06 12:10:06.368000+00:00]
[ MCT D317 1mm² [8500 - 700 Cm-1] MCT D317 1mm² [8500 - 700 Cm-1] MCT D317 1mm² [8500 - 700 Cm-1]]
[ /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0000 /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0001
/home/runner/.spectrochempy/testdata/irdata/OPUS/test.0002]]

Note: By default all files in the given directory are merged as a single dataset if they are compatibles (i.e., same shape, same type of experiment…). If they cannot be merged due to imcompatible shape or type, separate datasets are returned with dataset merged in different groups.

For instance in the following, two dataset will be returned:

[4]:
LZ1 = scp.read_opus(
    "test.0000", "test.0001", "test.0002", "background.0", directory="irdata/OPUS"
)
LZ1
[4]:
List (len=2, type=NDDataset)
    0: NDDataset: [float64] a.u. (shape: (y:3, x:2567))[test]
    Summary
    name
    :
    test
    author
    :
    runner@fv-az2211-104
    created
    :
    2025-04-27 01:45:47+00:00
    description
    :
    Concatenation of 3 datasets:
    ( test, test, test )
    history
    :
    2025-04-27 01:45:48+00:00> Created by concatenate
    2025-04-27 01:45:48+00:00> Merged from several files
    Data
    title
    :
    absorbance
    values
    :
    ...
    [[0.000459 0.0004219 ... 0.5771 0.6324]
    [0.000451 0.0004229 ... 0.5752 0.6311]
    [0.0002479 0.0002325 ... 0.5809 0.6376]] a.u.
    shape
    :
    (y:3, x:2567)
    Dimension `x`
    size
    :
    2567
    title
    :
    wavenumber
    coordinates
    :
    [ 3998 3997 ... 700.7 699.4] cm⁻¹
    Dimension `y`
    size
    :
    3
    title
    :
    acquisition timestamp (GMT)
    coordinates
    :
    [1.581e+09 1.581e+09 1.581e+09] s
    labels
    :
    ...
    [[ 2020-02-06 12:09:58.095000+00:00 2020-02-06 12:10:02.232000+00:00 2020-02-06 12:10:06.368000+00:00]
    [ MCT D317 1mm² [8500 - 700 Cm-1] MCT D317 1mm² [8500 - 700 Cm-1] MCT D317 1mm² [8500 - 700 Cm-1]]
    [ /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0000 /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0001
    /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0002]]
    1: NDDataset: [float64] unitless (shape: (y:1, x:4096))[background]
    Summary
    name
    :
    background
    author
    :
    runner@fv-az2211-104
    created
    :
    2025-04-27 01:45:47+00:00
    description
    :
    Concatenation of 1 datasets:
    ( background )
    history
    :
    2025-04-27 01:45:48+00:00> Created by concatenate
    2025-04-27 01:45:48+00:00> Merged from several files
    Data
    title
    :
    single-channel reference spectra
    values
    :
    ...
    [[ 0.01242 0.01243 ... 0.001023 0.01261]]
    shape
    :
    (y:1, x:4096)
    Dimension `x`
    size
    :
    4096
    title
    :
    wavenumber
    coordinates
    :
    [ 5265 5263 ... 1.286 0] cm⁻¹
    Dimension `y`
    size
    :
    1
    title
    :
    acquisition timestamp (GMT)
    coordinates
    :
    [1.581e+09] s
    labels
    :
    ...
    [[ 2020-02-06 12:01:55.349000+00:00]
    [ MCT D317 1mm² [8500 - 700 Cm-1]]
    [ /home/runner/.spectrochempy/testdata/irdata/OPUS/background.0]]

Multifile loading can also be achieved by only specifying the directory to read, if all files in a directory must be read:

[5]:
LZ = scp.read_opus("irdata/OPUS")
LZ
[5]:
List (len=2, type=NDDataset)
    0: NDDataset: [float64] a.u. (shape: (y:4, x:2567))[test]
    Summary
    name
    :
    test
    author
    :
    runner@fv-az2211-104
    created
    :
    2025-04-27 01:45:48+00:00
    description
    :
    Concatenation of 1 datasets:
    ( test )
    history
    :
    2025-04-27 01:45:48+00:00> Created by concatenate
    2025-04-27 01:45:48+00:00> Merged from several files
    Data
    title
    :
    absorbance
    values
    :
    ...
    [[0.000459 0.0004219 ... 0.5771 0.6324]
    [0.000451 0.0004229 ... 0.5752 0.6311]
    [0.0002479 0.0002325 ... 0.5809 0.6376]
    [0.0003685 0.0003442 ... 0.5827 0.6388]] a.u.
    shape
    :
    (y:4, x:2567)
    Dimension `x`
    size
    :
    2567
    title
    :
    wavenumber
    coordinates
    :
    [ 3998 3997 ... 700.7 699.4] cm⁻¹
    Dimension `y`
    size
    :
    4
    title
    :
    acquisition timestamp (GMT)
    coordinates
    :
    [1.581e+09 1.581e+09 1.581e+09 1.581e+09] s
    labels
    :
    ...
    [[ 2020-02-06 12:09:58.095000+00:00 2020-02-06 12:10:02.232000+00:00 2020-02-06 12:10:06.368000+00:00 2020-02-06 12:10:10.505000+00:00]
    [ MCT D317 1mm² [8500 - 700 Cm-1] MCT D317 1mm² [8500 - 700 Cm-1] MCT D317 1mm² [8500 - 700 Cm-1] MCT D317 1mm² [8500 - 700 Cm-1]]
    [ /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0000 /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0001
    /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0002 /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0003]]
    1: NDDataset: [float64] unitless (shape: (y:1, x:4096))[background]
    Summary
    name
    :
    background
    author
    :
    runner@fv-az2211-104
    created
    :
    2025-04-27 01:45:48+00:00
    description
    :
    Concatenation of 1 datasets:
    ( background )
    history
    :
    2025-04-27 01:45:48+00:00> Created by concatenate
    2025-04-27 01:45:48+00:00> Merged from several files
    Data
    title
    :
    single-channel reference spectra
    values
    :
    ...
    [[ 0.01242 0.01243 ... 0.001023 0.01261]]
    shape
    :
    (y:1, x:4096)
    Dimension `x`
    size
    :
    4096
    title
    :
    wavenumber
    coordinates
    :
    [ 5265 5263 ... 1.286 0] cm⁻¹
    Dimension `y`
    size
    :
    1
    title
    :
    acquisition timestamp (GMT)
    coordinates
    :
    [1.581e+09] s
    labels
    :
    ...
    [[ 2020-02-06 12:01:55.349000+00:00]
    [ MCT D317 1mm² [8500 - 700 Cm-1]]
    [ /home/runner/.spectrochempy/testdata/irdata/OPUS/background.0]]

As previously two datasets are returned due to the imcompatible types and shapes of the experiments.

If one desire to load of files into separate datasets, then set the merge attribute to False.

[6]:
LZ1 = scp.read_opus("irdata/OPUS", merge=False)
LZ1
[6]:
List (len=5, type=NDDataset)
    0: NDDataset: [float64] a.u. (shape: (y:1, x:2567))[test]
    Summary
    name
    :
    test
    author
    :
    runner@fv-az2211-104
    created
    :
    2025-04-27 01:45:48+00:00
    description
    :
    Dataset from opus files.
    Spectra type: Absorbance
    history
    :
    2025-04-27 01:45:48+00:00> 2025-04-27 01:45:48.325697+00:00: import from opus files
    Data
    title
    :
    absorbance
    values
    :
    ...
    [[0.000459 0.0004219 ... 0.5771 0.6324]] a.u.
    shape
    :
    (y:1, x:2567)
    Dimension `x`
    size
    :
    2567
    title
    :
    wavenumber
    coordinates
    :
    [ 3998 3997 ... 700.7 699.4] cm⁻¹
    Dimension `y`
    size
    :
    1
    title
    :
    acquisition timestamp (GMT)
    coordinates
    :
    [1.581e+09] s
    labels
    :
    ...
    [[ 2020-02-06 12:09:58.095000+00:00]
    [ MCT D317 1mm² [8500 - 700 Cm-1]]
    [ /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0000]]
    1: NDDataset: [float64] a.u. (shape: (y:1, x:2567))[test]
    Summary
    name
    :
    test
    author
    :
    runner@fv-az2211-104
    created
    :
    2025-04-27 01:45:48+00:00
    description
    :
    Dataset from opus files.
    Spectra type: Absorbance
    history
    :
    2025-04-27 01:45:48+00:00> 2025-04-27 01:45:48.332299+00:00: import from opus files
    Data
    title
    :
    absorbance
    values
    :
    ...
    [[0.000451 0.0004229 ... 0.5752 0.6311]] a.u.
    shape
    :
    (y:1, x:2567)
    Dimension `x`
    size
    :
    2567
    title
    :
    wavenumber
    coordinates
    :
    [ 3998 3997 ... 700.7 699.4] cm⁻¹
    Dimension `y`
    size
    :
    1
    title
    :
    acquisition timestamp (GMT)
    coordinates
    :
    [1.581e+09] s
    labels
    :
    ...
    [[ 2020-02-06 12:10:02.232000+00:00]
    [ MCT D317 1mm² [8500 - 700 Cm-1]]
    [ /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0001]]
    2: NDDataset: [float64] a.u. (shape: (y:1, x:2567))[test]
    Summary
    name
    :
    test
    author
    :
    runner@fv-az2211-104
    created
    :
    2025-04-27 01:45:48+00:00
    description
    :
    Dataset from opus files.
    Spectra type: Absorbance
    history
    :
    2025-04-27 01:45:48+00:00> 2025-04-27 01:45:48.339073+00:00: import from opus files
    Data
    title
    :
    absorbance
    values
    :
    ...
    [[0.0002479 0.0002325 ... 0.5809 0.6376]] a.u.
    shape
    :
    (y:1, x:2567)
    Dimension `x`
    size
    :
    2567
    title
    :
    wavenumber
    coordinates
    :
    [ 3998 3997 ... 700.7 699.4] cm⁻¹
    Dimension `y`
    size
    :
    1
    title
    :
    acquisition timestamp (GMT)
    coordinates
    :
    [1.581e+09] s
    labels
    :
    ...
    [[ 2020-02-06 12:10:06.368000+00:00]
    [ MCT D317 1mm² [8500 - 700 Cm-1]]
    [ /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0002]]
    3: NDDataset: [float64] a.u. (shape: (y:1, x:2567))[test]
    Summary
    name
    :
    test
    author
    :
    runner@fv-az2211-104
    created
    :
    2025-04-27 01:45:48+00:00
    description
    :
    Dataset from opus files.
    Spectra type: Absorbance
    history
    :
    2025-04-27 01:45:48+00:00> 2025-04-27 01:45:48.345588+00:00: import from opus files
    Data
    title
    :
    absorbance
    values
    :
    ...
    [[0.0003685 0.0003442 ... 0.5827 0.6388]] a.u.
    shape
    :
    (y:1, x:2567)
    Dimension `x`
    size
    :
    2567
    title
    :
    wavenumber
    coordinates
    :
    [ 3998 3997 ... 700.7 699.4] cm⁻¹
    Dimension `y`
    size
    :
    1
    title
    :
    acquisition timestamp (GMT)
    coordinates
    :
    [1.581e+09] s
    labels
    :
    ...
    [[ 2020-02-06 12:10:10.505000+00:00]
    [ MCT D317 1mm² [8500 - 700 Cm-1]]
    [ /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0003]]
    4: NDDataset: [float64] unitless (shape: (y:1, x:4096))[background]
    Summary
    name
    :
    background
    author
    :
    runner@fv-az2211-104
    created
    :
    2025-04-27 01:45:48+00:00
    description
    :
    Dataset from opus files.
    Spectra type: Single-channel reference spectra
    history
    :
    2025-04-27 01:45:48+00:00> 2025-04-27 01:45:48.320086+00:00: import from opus files
    Data
    title
    :
    single-channel reference spectra
    values
    :
    ...
    [[ 0.01242 0.01243 ... 0.001023 0.01261]]
    shape
    :
    (y:1, x:4096)
    Dimension `x`
    size
    :
    4096
    title
    :
    wavenumber
    coordinates
    :
    [ 5265 5263 ... 1.286 0] cm⁻¹
    Dimension `y`
    size
    :
    1
    title
    :
    acquisition timestamp (GMT)
    coordinates
    :
    [1.581e+09] s
    labels
    :
    ...
    [[ 2020-02-06 12:01:55.349000+00:00]
    [ MCT D317 1mm² [8500 - 700 Cm-1]]
    [ /home/runner/.spectrochempy/testdata/irdata/OPUS/background.0]]

Loading given type of OPUS spectra

By default absortion spectra (AB) are load, if present in the file.

Opus file however can contain several types of spectra and they can be retrieved eventually using the correct type in the call to read_opus:

Types possibly availables and readables by read_opus are listed here:

  • AB: Absorbance (default if present in the file)

  • TR: Transmittance

  • KM: Kubelka-Munk

  • RAM: Raman

  • EMI: Emission

  • RFL: Reflectance

  • LRF: log(Reflectance)

  • ATR: ATR

  • PAS: Photoacoustic

  • RF: Single-channel reference spectra

  • SM: Single-channel sample spectra

  • IGRF: Reference interferogram

  • IGSM: Sample interferogram

  • PHRF: Reference phase

  • PHSM: Sample phase

It is possible to know which are the other types availables in the original file:

[7]:
Z.meta.other_data_types
[7]:
['RF', 'IGRF', 'AB', 'SM', 'PHSM', 'IGSM']

Thus if one wants to load the single-channel sample spectra, the read function syntax would be:

[8]:
ZSM = scp.read_opus("irdata/OPUS/test.0002", type="SM")
ZSM
[8]:
NDDataset: [float64] unitless (shape: (y:1, x:2567))[test]
Summary
name
:
test
author
:
runner@fv-az2211-104
created
:
2025-04-27 01:45:48+00:00
description
:
Dataset from opus files.
Spectra type: Single-channel sample spectra
history
:
2025-04-27 01:45:48+00:00> 2025-04-27 01:45:48.373968+00:00: import from opus files
Data
title
:
single-channel sample spectra
values
:
...
[[ 0.02253 0.02255 ... 0.0008783 0.0007268]]
shape
:
(y:1, x:2567)
Dimension `x`
size
:
2567
title
:
wavenumber
coordinates
:
[ 3998 3997 ... 700.7 699.4] cm⁻¹
Dimension `y`
size
:
1
title
:
acquisition timestamp (GMT)
coordinates
:
[1.581e+09] s
labels
:
...
[[ 2020-02-06 12:10:06.368000+00:00]
[ MCT D317 1mm² [8500 - 700 Cm-1]]
[ /home/runner/.spectrochempy/testdata/irdata/OPUS/test.0002]]

Reading OPUS file Metadata

As just seen above, more informations can be obtained on the experiment and spectrometer parameters using the dataset metadata (meta attribute).

For instance, to get a display of all metadata:

[9]:
Z.meta
[9]:
OPUS Parameters
other_data_types
:
['RF', 'IGRF', 'AB', 'SM', 'PHSM', 'IGSM']
Sample/Result Parameters [params]
Optical Parameters [optical]
Accessory [acc]
:
Compartiment Echantillon #1112355F
Aperture Setting [apt]
:
1.5 mm
Beamsplitter [bms]
:
KBr
Measurement Channel [chn]
:
Sample Compartment
Detector [dtc]
:
LN-MCT Photovoltaic 1mm 8H Fast [Internal Pos.2]
High Pass Filter [hpf]
:
0
Low Pass Filter [lpf]
:
40.0
Optical Filter Setting [opf]
:
Open
Preamplifier Gain [pgn]
:
3
Extended Ready Check [rdx]
:
0
Source [src]
:
MIR
Scanner Velocity [vel]
:
120.
External Sync [son]
:
Off
Fourier Transform Parameters [fourier_transform]
Apodization Function [apf]
:
B3
End Frequency Limit for File [hfq]
:
700.0
Start Frequency Limit for File [lfq]
:
4000.0
Nonlinearity Correction [nli]
:
1
Phase Resolution [phr]
:
32.0
Phase Correction Mode [phz]
:
ML
Stored Phase Mode [spz]
:
NO
Zero Filling Factor [zff]
:
2
Acquisition Parameters [acquisition]
Additional Data Treatment [adt]
:
0
Acquisition Mode [aqm]
:
SN
Correlation Test Mode [cor]
:
0
Delay Before Measurement [del]
:
0
Stabilization Delay [dly]
:
0
Wanted High Freq Limit [hfw]
:
4000.0
Wanted Low Freq Limit [lfw]
:
400.0
Number of Sample Scans [nss]
:
32
Result Spectrum Type [plf]
:
AB
Resolution (cm-1) [res]
:
4.0
Sample Scans or Time [sot]
:
0
Command Line for Additional Data Treatment [tcl]
:
To Do List [tdl]
:
16777271
Sample Signal Gain [sgn]
:
-1
Sample Origin Parameters [sample_origin]
Building [bld]
:
Operator Name [cnm]
:
Administrator
Company [cpy]
:
Department [dpm]
:
Experiment [exp]
:
transmissionfederico.xpm
Location [lct]
:
Sample Form [sfm]
:
Energie=9700
Sample Name [snm]
:
MCT D317 1mm² [8500 - 700 Cm-1]
Experiment Path [xpp]
:
C:\Documents and Settings\fts\Bureau\LCSAGH FTIR
Instrument Status [ist]
:
OK
Character Encoding Code Page [cpg]
:
1252
Instrument Status Parameters [instrument_status]
High Folding Limit [hfl]
:
5265.987417333333
Low Folding Limit [lfl]
:
0.0
Laser Wavenumber [lwn]
:
15797.962252
Absolute Peak Pos in Laser*2 [abp]
:
52329
Sample Spacing Divisor [ssp]
:
3
Actual Signal Gain [asg]
:
4
Actual Reference Gain [arg]
:
4
Number of Sample Scans [ass]
:
32
Number of Good Forward Scans [gfw]
:
32
Number of Good Backward Scans [gbw]
:
0
Number of Bad Forward Scans [bfw]
:
0
Number of Bad Backward Scans [bbw]
:
0
Peak Amplitude [pka]
:
-5013
Peak Location [pkl]
:
562
Backward Peak Amplitude [pra]
:
1
Backward Peak Location [prl]
:
-1
Peak Amplitude Channel 2 [p2a]
:
1
Peak Location Channel 2 [p2l]
:
1
Backward Peak Amplitude Channel 2 [p2r]
:
1
Backward Peak Location Channel 2 [p2k]
:
1
Data Acquisition Status [daq]
:
0
Actual Signal Gain Channel 2 [ag2]
:
1
Relative Humidity Interferometer [hum]
:
3
Sample Spacing Multiplier [ssm]
:
1
Running Sample Number [rsn]
:
181951
Correlation Rejection Reason [crr]
:
0
Start Time (sec) [srt]
:
1580994606.3689988
Duration (sec) [dur]
:
4.053997039794922
Scanner Temperature [tsc]
:
25.8
Max Velocity Deviation [mvd]
:
1.678957223892212
Pressure Interferometer (hPa) [prs]
:
1029.99997
Analog Signal 1 [an1]
:
0.0
Analog Signal 2 [an2]
:
0.0
Firmware Version [vsn]
:
1.546 Oct 27 2011
Instrument Serial Number [srn]
:
0173
NL Alpha [nla]
:
1.0032635274973252
NL Beta [nlb]
:
-0.008074354619042486
Unknown INC [inc]
:
680.0
Unknown INE [ine]
:
0.8999999761581421
Instrument Type [ins]
:
VERTEX 80V
Focal Length [foc]
:
100.0
Ready Check [rdy]
:
1
Reference Parameters [rf_params]
Reference Instrument Status Parameters [instrument_status]
High Folding Limit [hfl]
:
5265.987417333333
Low Folding Limit [lfl]
:
0.0
Laser Wavenumber [lwn]
:
15797.962252
Absolute Peak Pos in Laser*2 [abp]
:
52329
Sample Spacing Divisor [ssp]
:
3
Actual Reference Gain [arg]
:
4
Actual Signal Gain [asg]
:
4
Number of Sample Scans [ass]
:
32
Number of Good Forward Scans [gfw]
:
32
Number of Good Backward Scans [gbw]
:
0
Number of Bad Forward Scans [bfw]
:
0
Number of Bad Backward Scans [bbw]
:
0
Peak Amplitude [pka]
:
-5274
Peak Location [pkl]
:
562
Backward Peak Amplitude [pra]
:
1
Backward Peak Location [prl]
:
-1
Peak Amplitude Channel 2 [p2a]
:
1
Peak Location Channel 2 [p2l]
:
1
Backward Peak Amplitude Channel 2 [p2r]
:
1
Backward Peak Location Channel 2 [p2k]
:
1
Data Acquisition Status [daq]
:
0
Actual Signal Gain Channel 2 [ag2]
:
1
Relative Humidity Interferometer [hum]
:
3
Sample Spacing Multiplier [ssm]
:
1
Running Sample Number [rsn]
:
1666915
Correlation Rejection Reason [crr]
:
0
Start Time (sec) [srt]
:
1580994115.349999
Duration (sec) [dur]
:
4.053997039794922
Scanner Temperature [tsc]
:
25.8
Max Velocity Deviation [mvd]
:
1.509278655052185
Pressure Interferometer (hPa) [prs]
:
1029.99997
Analog Signal 1 [an1]
:
0.1067311915111817
Analog Signal 2 [an2]
:
0.24102481595995506
Firmware Version [vsn]
:
1.546 Oct 27 2011
Instrument Serial Number [srn]
:
0173
NL Alpha [nla]
:
1.003937884834645
NL Beta [nlb]
:
-0.009290070393253367
Unknown INC [inc]
:
680.0
Unknown INE [ine]
:
0.8999999761581421
Instrument Type [ins]
:
VERTEX 80V
Focal Length [foc]
:
100.0
Ready Check [rdy]
:
1
Number of Reference Scans [ars]
:
32
Reference Optical Parameters [optical]
Accessory [acc]
:
Compartiment Echantillon #1112355F
Aperture Setting [apt]
:
1.5 mm
Beamsplitter [bms]
:
KBr
Detector [dtc]
:
LN-MCT Photovoltaic 1mm 8H Fast [Internal Pos.2]
High Pass Filter [hpf]
:
0
Low Pass Filter [lpf]
:
40.0
Optical Filter Setting [opf]
:
Open
Reference Preamplifier Gain [pgr]
:
3
Reference Measurement Channel [rch]
:
Sample Compartment
Extended Ready Check [rdx]
:
0
Source [src]
:
MIR
Scanner Velocity [vel]
:
120.
External Sync [son]
:
Off
Reference Acquisition Parameters [acquisition]
Additional Data Treatment [adt]
:
0
Acquisition Mode [aqm]
:
SN
Correlation Test Mode [cor]
:
0
Delay Before Measurement [del]
:
0
Stabilization Delay [dly]
:
0
Wanted High Freq Limit [hfw]
:
4000.0
Wanted Low Freq Limit [lfw]
:
400.0
Number of Background Scans [nsr]
:
32
Result Spectrum Type [plf]
:
AB
Resolution (cm-1) [res]
:
4.0
Reference Signal Gain [rgn]
:
-1
Scans or Time (Reference) [str]
:
0
Command Line for Additional Data Treatment [tcl]
:
To Do List [tdl]
:
16777271
Reference Fourier Transform Parameters [fourier_transform]
Apodization Function [apf]
:
B3
End Frequency Limit for File [hfq]
:
700.0
Start Frequency Limit for File [lfq]
:
4000.0
Nonlinearity Correction [nli]
:
1
Phase Resolution [phr]
:
32.0
Phase Correction Mode [phz]
:
ML
Stored Phase Mode [spz]
:
NO
Zero Filling Factor [zff]
:
2

To display only a sub-group of metadata, you can use :

[10]:
Z.meta.params.fourier_transform
[10]:
Fourier Transform Parameters
Apodization Function [apf]
:
B3
End Frequency Limit for File [hfq]
:
700.0
Start Frequency Limit for File [lfq]
:
4000.0
Nonlinearity Correction [nli]
:
1
Phase Resolution [phr]
:
32.0
Phase Correction Mode [phz]
:
ML
Stored Phase Mode [spz]
:
NO
Zero Filling Factor [zff]
:
2

or a single parameter:

[11]:
Z.meta.params.optical.bms
[11]:
Beamsplitter
value
:
KBr
[12]:
Z.meta.params.optical.bms.value
[12]:
'KBr'

Acting on a parameter

Metadata modification, addition, deletion are forbidden by default (readonly=True).

For instance, if one want to add a new parameters, the following is not permitted and then raise an error:

[13]:
try:
    Z.meta.xxx = "forbidden"
except ValueError:
    scp.error_("meta data dictionary is read only!")
 ERROR | SpectroChemPyError: meta data dictionary is read only!

To add a new value (or to modifify/delete an existing value), the readonly flag must be unset before the operation:

[14]:
Z.meta.readonly = False
Z.meta.xxx = "permitted"
Z.meta
[14]:
OPUS Parameters
other_data_types
:
['RF', 'IGRF', 'AB', 'SM', 'PHSM', 'IGSM']
xxx
:
permitted
Sample/Result Parameters [params]
Optical Parameters [optical]
Accessory [acc]
:
Compartiment Echantillon #1112355F
Aperture Setting [apt]
:
1.5 mm
Beamsplitter [bms]
:
KBr
Measurement Channel [chn]
:
Sample Compartment
Detector [dtc]
:
LN-MCT Photovoltaic 1mm 8H Fast [Internal Pos.2]
High Pass Filter [hpf]
:
0
Low Pass Filter [lpf]
:
40.0
Optical Filter Setting [opf]
:
Open
Preamplifier Gain [pgn]
:
3
Extended Ready Check [rdx]
:
0
Source [src]
:
MIR
Scanner Velocity [vel]
:
120.
External Sync [son]
:
Off
Fourier Transform Parameters [fourier_transform]
Apodization Function [apf]
:
B3
End Frequency Limit for File [hfq]
:
700.0
Start Frequency Limit for File [lfq]
:
4000.0
Nonlinearity Correction [nli]
:
1
Phase Resolution [phr]
:
32.0
Phase Correction Mode [phz]
:
ML
Stored Phase Mode [spz]
:
NO
Zero Filling Factor [zff]
:
2
Acquisition Parameters [acquisition]
Additional Data Treatment [adt]
:
0
Acquisition Mode [aqm]
:
SN
Correlation Test Mode [cor]
:
0
Delay Before Measurement [del]
:
0
Stabilization Delay [dly]
:
0
Wanted High Freq Limit [hfw]
:
4000.0
Wanted Low Freq Limit [lfw]
:
400.0
Number of Sample Scans [nss]
:
32
Result Spectrum Type [plf]
:
AB
Resolution (cm-1) [res]
:
4.0
Sample Scans or Time [sot]
:
0
Command Line for Additional Data Treatment [tcl]
:
To Do List [tdl]
:
16777271
Sample Signal Gain [sgn]
:
-1
Sample Origin Parameters [sample_origin]
Building [bld]
:
Operator Name [cnm]
:
Administrator
Company [cpy]
:
Department [dpm]
:
Experiment [exp]
:
transmissionfederico.xpm
Location [lct]
:
Sample Form [sfm]
:
Energie=9700
Sample Name [snm]
:
MCT D317 1mm² [8500 - 700 Cm-1]
Experiment Path [xpp]
:
C:\Documents and Settings\fts\Bureau\LCSAGH FTIR
Instrument Status [ist]
:
OK
Character Encoding Code Page [cpg]
:
1252
Instrument Status Parameters [instrument_status]
High Folding Limit [hfl]
:
5265.987417333333
Low Folding Limit [lfl]
:
0.0
Laser Wavenumber [lwn]
:
15797.962252
Absolute Peak Pos in Laser*2 [abp]
:
52329
Sample Spacing Divisor [ssp]
:
3
Actual Signal Gain [asg]
:
4
Actual Reference Gain [arg]
:
4
Number of Sample Scans [ass]
:
32
Number of Good Forward Scans [gfw]
:
32
Number of Good Backward Scans [gbw]
:
0
Number of Bad Forward Scans [bfw]
:
0
Number of Bad Backward Scans [bbw]
:
0
Peak Amplitude [pka]
:
-5013
Peak Location [pkl]
:
562
Backward Peak Amplitude [pra]
:
1
Backward Peak Location [prl]
:
-1
Peak Amplitude Channel 2 [p2a]
:
1
Peak Location Channel 2 [p2l]
:
1
Backward Peak Amplitude Channel 2 [p2r]
:
1
Backward Peak Location Channel 2 [p2k]
:
1
Data Acquisition Status [daq]
:
0
Actual Signal Gain Channel 2 [ag2]
:
1
Relative Humidity Interferometer [hum]
:
3
Sample Spacing Multiplier [ssm]
:
1
Running Sample Number [rsn]
:
181951
Correlation Rejection Reason [crr]
:
0
Start Time (sec) [srt]
:
1580994606.3689988
Duration (sec) [dur]
:
4.053997039794922
Scanner Temperature [tsc]
:
25.8
Max Velocity Deviation [mvd]
:
1.678957223892212
Pressure Interferometer (hPa) [prs]
:
1029.99997
Analog Signal 1 [an1]
:
0.0
Analog Signal 2 [an2]
:
0.0
Firmware Version [vsn]
:
1.546 Oct 27 2011
Instrument Serial Number [srn]
:
0173
NL Alpha [nla]
:
1.0032635274973252
NL Beta [nlb]
:
-0.008074354619042486
Unknown INC [inc]
:
680.0
Unknown INE [ine]
:
0.8999999761581421
Instrument Type [ins]
:
VERTEX 80V
Focal Length [foc]
:
100.0
Ready Check [rdy]
:
1
Reference Parameters [rf_params]
Reference Instrument Status Parameters [instrument_status]
High Folding Limit [hfl]
:
5265.987417333333
Low Folding Limit [lfl]
:
0.0
Laser Wavenumber [lwn]
:
15797.962252
Absolute Peak Pos in Laser*2 [abp]
:
52329
Sample Spacing Divisor [ssp]
:
3
Actual Reference Gain [arg]
:
4
Actual Signal Gain [asg]
:
4
Number of Sample Scans [ass]
:
32
Number of Good Forward Scans [gfw]
:
32
Number of Good Backward Scans [gbw]
:
0
Number of Bad Forward Scans [bfw]
:
0
Number of Bad Backward Scans [bbw]
:
0
Peak Amplitude [pka]
:
-5274
Peak Location [pkl]
:
562
Backward Peak Amplitude [pra]
:
1
Backward Peak Location [prl]
:
-1
Peak Amplitude Channel 2 [p2a]
:
1
Peak Location Channel 2 [p2l]
:
1
Backward Peak Amplitude Channel 2 [p2r]
:
1
Backward Peak Location Channel 2 [p2k]
:
1
Data Acquisition Status [daq]
:
0
Actual Signal Gain Channel 2 [ag2]
:
1
Relative Humidity Interferometer [hum]
:
3
Sample Spacing Multiplier [ssm]
:
1
Running Sample Number [rsn]
:
1666915
Correlation Rejection Reason [crr]
:
0
Start Time (sec) [srt]
:
1580994115.349999
Duration (sec) [dur]
:
4.053997039794922
Scanner Temperature [tsc]
:
25.8
Max Velocity Deviation [mvd]
:
1.509278655052185
Pressure Interferometer (hPa) [prs]
:
1029.99997
Analog Signal 1 [an1]
:
0.1067311915111817
Analog Signal 2 [an2]
:
0.24102481595995506
Firmware Version [vsn]
:
1.546 Oct 27 2011
Instrument Serial Number [srn]
:
0173
NL Alpha [nla]
:
1.003937884834645
NL Beta [nlb]
:
-0.009290070393253367
Unknown INC [inc]
:
680.0
Unknown INE [ine]
:
0.8999999761581421
Instrument Type [ins]
:
VERTEX 80V
Focal Length [foc]
:
100.0
Ready Check [rdy]
:
1
Number of Reference Scans [ars]
:
32
Reference Optical Parameters [optical]
Accessory [acc]
:
Compartiment Echantillon #1112355F
Aperture Setting [apt]
:
1.5 mm
Beamsplitter [bms]
:
KBr
Detector [dtc]
:
LN-MCT Photovoltaic 1mm 8H Fast [Internal Pos.2]
High Pass Filter [hpf]
:
0
Low Pass Filter [lpf]
:
40.0
Optical Filter Setting [opf]
:
Open
Reference Preamplifier Gain [pgr]
:
3
Reference Measurement Channel [rch]
:
Sample Compartment
Extended Ready Check [rdx]
:
0
Source [src]
:
MIR
Scanner Velocity [vel]
:
120.
External Sync [son]
:
Off
Reference Acquisition Parameters [acquisition]
Additional Data Treatment [adt]
:
0
Acquisition Mode [aqm]
:
SN
Correlation Test Mode [cor]
:
0
Delay Before Measurement [del]
:
0
Stabilization Delay [dly]
:
0
Wanted High Freq Limit [hfw]
:
4000.0
Wanted Low Freq Limit [lfw]
:
400.0
Number of Background Scans [nsr]
:
32
Result Spectrum Type [plf]
:
AB
Resolution (cm-1) [res]
:
4.0
Reference Signal Gain [rgn]
:
-1
Scans or Time (Reference) [str]
:
0
Command Line for Additional Data Treatment [tcl]
:
To Do List [tdl]
:
16777271
Reference Fourier Transform Parameters [fourier_transform]
Apodization Function [apf]
:
B3
End Frequency Limit for File [hfq]
:
700.0
Start Frequency Limit for File [lfq]
:
4000.0
Nonlinearity Correction [nli]
:
1
Phase Resolution [phr]
:
32.0
Phase Correction Mode [phz]
:
ML
Stored Phase Mode [spz]
:
NO
Zero Filling Factor [zff]
:
2

It is advised to set back the readonly flag to True.