File: ex1_getinfo.py

package info (click to toggle)
python-renishawwire 0.1.16-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,056 kB
  • sloc: python: 1,368; makefile: 28
file content (28 lines) | stat: -rw-r--r-- 859 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /usr/bin/env python3

################################################################
# The example shows how to retrieve metadata from wdf file     #
# spectra_files/sp.wdf contains 1 single-point Raman spectrum #
################################################################

from renishawWiRE import WDFReader
from _path import curdir

# import pytest


def main():
    for name in ("sp", "line", "depth", "mapping", "undefined", "streamline"):
        filename = curdir / "spectra_files" / "{0}.wdf".format(name)
        print("Testing: ", filename.as_posix())
        # if debug=True, debug information will show in stderr
        reader = WDFReader(filename, debug=True)
        assert reader is not None
        # Explicitly print into stdout
        reader.print_info()
        reader.close()
    return


if __name__ == "__main__":
    main()